Changeset 8e7c9fe in mainline for uspace/lib/math/arch/ia32/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/ia32/src/cos.S (moved) (moved from uspace/lib/c/arch/mips64/src/fibril.S ) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/math/arch/ia32/src/cos.S
r3eb0c85 r8e7c9fe 1 1 # 2 # Copyright (c) 20 03-2004 Jakub Jermar2 # Copyright (c) 2014 Martin Decky 3 3 # All rights reserved. 4 4 # … … 27 27 # 28 28 29 #include <libarch/x87.h> 30 29 31 .text 30 32 31 .set noat 32 .set noreorder 33 .global cos 33 34 34 #include <libarch/context_offset.h> 35 36 .global context_save 37 .global context_restore 38 39 context_save: 40 CONTEXT_SAVE_ARCH_CORE $a0 35 cos: 36 # compute cosine (no stack frame) 41 37 42 # context_save returns 1 43 j $ra 44 li $v0, 1 45 46 context_restore: 47 CONTEXT_RESTORE_ARCH_CORE $a0 38 fldl 4(%esp) 39 fcos 48 40 49 # Just for the jump into first function, 50 # but one instruction should not bother us 51 move $t9, $ra 41 # detect if source operand is out of range 52 42 53 # context_restore returns 0 54 j $ra 55 xor $v0, $v0 43 fnstsw %ax 44 andw $X87_STATUS_WORD_C2_MASK, %ax 45 jnz fix_range 46 47 ret 48 49 # argument reduction 50 51 fix_range: 52 fldpi 53 fadd %st(0) 54 fxch %st(1) 55 56 reduce: 57 fprem1 58 fnstsw %ax 59 andw $X87_STATUS_WORD_C2_MASK, %ax 60 jnz reduce 61 62 fstpl %st(1) 63 fcos 64 65 ret
Note:
See TracChangeset
for help on using the changeset viewer.
