diff options
author | Szabolcs Nagy <nsz@port70.net> | 2013-08-18 20:08:18 +0000 |
---|---|---|
committer | Szabolcs Nagy <nsz@port70.net> | 2013-08-18 20:08:18 +0000 |
commit | a6b0170a7f51fdea9beec57ae794221290af232b (patch) | |
tree | 22651ba3480fc272933133af780e6beb10ab2d3d /src/fenv/x86_64/fenv.s | |
parent | d8764bf84022397ff9d22310f78fcd78d801e2bf (diff) | |
download | musl-a6b0170a7f51fdea9beec57ae794221290af232b.tar.gz musl-a6b0170a7f51fdea9beec57ae794221290af232b.tar.xz musl-a6b0170a7f51fdea9beec57ae794221290af232b.zip |
fix fenv exception functions to mask their argument
fesetround.c is a wrapper to do the arch independent argument check (on archs where rounding mode is not stored in 2 bits __fesetround still has to check its arguments) on powerpc fe*except functions do not accept the extra invalid flags of its fpscr register the useless FENV_ACCESS pragma was removed from feupdateenv
Diffstat (limited to 'src/fenv/x86_64/fenv.s')
-rw-r--r-- | src/fenv/x86_64/fenv.s | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/fenv/x86_64/fenv.s b/src/fenv/x86_64/fenv.s index dda6b61a..6aaf25eb 100644 --- a/src/fenv/x86_64/fenv.s +++ b/src/fenv/x86_64/fenv.s @@ -3,6 +3,7 @@ feclearexcept: # maintain exceptions in the sse mxcsr, clear x87 exceptions mov %edi,%ecx + and $0x3f,%ecx fnstsw %ax test %eax,%ecx jz 1f @@ -20,16 +21,17 @@ feclearexcept: .global feraiseexcept .type feraiseexcept,@function -feraiseexcept: +feraiseexcept: + and $0x3f,%edi stmxcsr -8(%rsp) or %edi,-8(%rsp) ldmxcsr -8(%rsp) xor %eax,%eax ret -.global fesetround -.type fesetround,@function -fesetround: +.global __fesetround +.type __fesetround,@function +__fesetround: push %rax xor %eax,%eax mov %edi,%ecx @@ -85,6 +87,7 @@ fesetenv: .global fetestexcept .type fetestexcept,@function fetestexcept: + and $0x3f,%edi push %rax stmxcsr (%rsp) pop %rsi |