Changeset 8e7c9fe in mainline for uspace/lib/math/arch/ia32/src/trunc.S
- Timestamp:
- 2014-09-12T03:45:25Z (10 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/ia32/src/trunc.S
r3eb0c85 r8e7c9fe 1 1 # 2 # Copyright (c) 201 2 Vojtech Horky2 # Copyright (c) 2014 Martin Decky 3 3 # All rights reserved. 4 4 # … … 27 27 # 28 28 29 #include <libarch/x87.h> 29 30 30 BINARY = msim 31 LIBS = $(LIBCLUI_PREFIX)/libclui.a 32 POSIX_COMPAT = y 33 # Needed because MSIM is not that strict as HelenOS 34 EXTRA_CFLAGS = -Wno-error -I$(LIBCLUI_PREFIX) 31 .text 35 32 36 include Makefile.sources 33 .global trunc 37 34 38 include $(USPACE_PREFIX)/Makefile.common 35 trunc: 36 pushl %ebp 37 movl %esp, %ebp 38 subl $8, %esp 39 40 # store x87 control word 41 42 fnstcw -4(%ebp) 43 movw -4(%ebp), %ax 44 45 # set rounding control to truncate 46 # (no masking necessary for this flag) 47 48 orw $X87_CONTROL_WORD_RC_TRUNCATE, %ax 49 movw %ax, -8(%ebp) 50 fldcw -8(%ebp) 51 52 # truncate 53 54 fldl 8(%ebp) 55 frndint 56 57 # restore original control word 58 59 fldcw -4(%ebp) 60 61 leave 62 ret
Note:
See TracChangeset
for help on using the changeset viewer.