Changeset 8e7c9fe in mainline for uspace/lib/math/arch/amd64/src/trunc.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
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/math/arch/amd64/src/trunc.S
r3eb0c85 r8e7c9fe 1 1 # 2 # Copyright (c) 20 06 Jakub Jermar2 # 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 32 33 .set noat 34 .set noreorder 35 .option pic2 33 .global trunc 36 34 37 .globl __thread_entry 38 39 ## User-space thread entry point for all but the first threads. 40 # 41 # 42 .ent __thread_entry 43 __thread_entry: 44 .frame $sp, ABI_STACK_FRAME, $ra 45 .cpload $t9 35 trunc: 36 pushq %rbp 37 movq %rsp, %rbp 46 38 47 # 48 # v0 contains address of uarg. 49 # 50 add $a0, $v0, 0 39 # store x87 control word in the red zone 51 40 52 # Allocate the stack frame.53 addiu $sp, -ABI_STACK_FRAME41 fnstcw -8(%rbp) 42 movw -8(%rbp), %ax 54 43 55 # Allow PIC code56 .cprestore 1644 # set rounding control to truncate 45 # (no masking necessary for this flag) 57 46 58 jal __thread_main 59 nop 47 orw $X87_CONTROL_WORD_RC_TRUNCATE, %ax 48 movw %ax, -16(%rbp) 49 fldcw -16(%rbp) 60 50 61 # 62 # Not reached. 63 # 64 addiu $sp, ABI_STACK_FRAME 65 .end __thread_entry 51 # truncate 52 53 movsd %xmm0, -16(%rbp) 54 fldl -16(%rbp) 55 frndint 56 fstpl -16(%rbp) 57 movsd -16(%rbp), %xmm0 58 59 # restore original control word 60 61 fldcw -8(%rbp) 62 63 leave 64 retq
Note:
See TracChangeset
for help on using the changeset viewer.