Changeset 8e7c9fe in mainline for uspace/lib/math/arch/amd64/src/cos.S
- Timestamp:
- 2014-09-12T03:45:25Z (11 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- c53b58e
- Parents:
- 3eb0c85 (diff), 105d8d6 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)links above to see all the changes relative to each parent. - File:
-
- 1 moved
-
uspace/lib/math/arch/amd64/src/cos.S (moved) (moved from uspace/lib/c/arch/mips64/src/entryjmp.S ) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/math/arch/amd64/src/cos.S
r3eb0c85 r8e7c9fe 1 1 # 2 # Copyright (c) 20 08 Jiri Svoboda2 # Copyright (c) 2014 Martin Decky 3 3 # All rights reserved. 4 4 # … … 27 27 # 28 28 29 #include <libarch/ stack.h>29 #include <libarch/x87.h> 30 30 31 31 .text 32 .section .text33 .global entry_point_jmp34 .set noreorder35 32 36 ## void entry_point_jmp(void *entry_point, void *pcb); 37 # 38 # $a0 (=$4) contains entry_point 39 # $a1 (=$5) contains pcb 40 # 41 # Jump to program entry point 42 .ent entry_point_jmp 43 entry_point_jmp: 44 # tmp := entry_point 45 move $t9, $a0 33 .global cos 34 35 cos: 36 pushq %rbp 37 movq %rsp, %rbp 46 38 47 # Pass pcb to the entry point in $a0 48 move $a0, $a1 39 # compute cosine (using red zone) 49 40 50 jr $t9 51 addiu $sp, -ABI_STACK_FRAME 52 addiu $sp, ABI_STACK_FRAME 53 .end entry_point_jmp 41 movsd %xmm0, -8(%rbp) 42 fldl -8(%rbp) 43 44 fcos 45 46 # detect if source operand is out of range 47 48 fnstsw %ax 49 andw $X87_STATUS_WORD_C2_MASK, %ax 50 jnz fix_range 51 52 fstpl -8(%rbp) 53 movsd -8(%rbp), %xmm0 54 55 leave 56 retq 57 58 # argument reduction 59 60 fix_range: 61 fldpi 62 fadd %st(0) 63 fxch %st(1) 64 65 reduce: 66 fprem1 67 fnstsw %ax 68 andw $X87_STATUS_WORD_C2_MASK, %ax 69 jnz reduce 70 71 fstpl %st(1) 72 fcos 73 74 fstpl -8(%rbp) 75 movsd -8(%rbp), %xmm0 76 77 leave 78 retq
Note:
See TracChangeset
for help on using the changeset viewer.
