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/i386/fenv.s | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/fenv/i386') diff --git a/src/fenv/i386/fenv.s b/src/fenv/i386/fenv.s index a8540add..eaeb6bed 100644 --- a/src/fenv/i386/fenv.s +++ b/src/fenv/i386/fenv.s @@ -4,6 +4,7 @@ .type feclearexcept,@function feclearexcept: mov 4(%esp),%ecx + and $0x3f,%ecx fnstsw %ax # consider sse fenv as well if the cpu has XMM capability call 1f @@ -50,6 +51,7 @@ feclearexcept: .type feraiseexcept,@function feraiseexcept: mov 4(%esp),%eax + and $0x3f,%eax sub $32,%esp fnstenv (%esp) or %al,4(%esp) @@ -58,9 +60,9 @@ feraiseexcept: xor %eax,%eax ret -.global fesetround -.type fesetround,@function -fesetround: +.global __fesetround +.type __fesetround,@function +__fesetround: mov 4(%esp),%ecx push %eax xor %eax,%eax @@ -147,6 +149,7 @@ fesetenv: .type fetestexcept,@function fetestexcept: mov 4(%esp),%ecx + and $0x3f,%ecx fnstsw %ax # consider sse fenv as well if the cpu has XMM capability call 1f -- cgit v1.2.1