From a6b0170a7f51fdea9beec57ae794221290af232b Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Sun, 18 Aug 2013 20:08:18 +0000 Subject: 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 --- src/fenv/x86_64/fenv.s | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/fenv/x86_64/fenv.s') 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 -- cgit v1.2.1