about summary refs log tree commit diff
path: root/src/fenv/powerpc
diff options
context:
space:
mode:
authorSzabolcs Nagy <nsz@port70.net>2013-08-18 20:08:18 +0000
committerSzabolcs Nagy <nsz@port70.net>2013-08-18 20:08:18 +0000
commita6b0170a7f51fdea9beec57ae794221290af232b (patch)
tree22651ba3480fc272933133af780e6beb10ab2d3d /src/fenv/powerpc
parentd8764bf84022397ff9d22310f78fcd78d801e2bf (diff)
downloadmusl-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/powerpc')
-rw-r--r--src/fenv/powerpc/fenv.s9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/fenv/powerpc/fenv.s b/src/fenv/powerpc/fenv.s
index 9c424d8e..3886d168 100644
--- a/src/fenv/powerpc/fenv.s
+++ b/src/fenv/powerpc/fenv.s
@@ -1,6 +1,7 @@
 .global feclearexcept
 .type feclearexcept,@function
 feclearexcept:
+	andis 3,3,0x3e00
 	# if (r3 & FE_INVALID) r3 |= all_invalid_flags
 	andis. 0,3,0x2000
 	stwu 1,-16(1)
@@ -28,6 +29,7 @@ feclearexcept:
 .global feraiseexcept
 .type feraiseexcept,@function
 feraiseexcept:
+	andis 3,3,0x3e00
 	# if (r3 & FE_INVALID) r3 |= software_invalid_flag
 	andis. 0,3,0x2000
 	stwu 1,-16(1)
@@ -51,6 +53,7 @@ feraiseexcept:
 .global fetestexcept
 .type fetestexcept,@function
 fetestexcept:
+	andis 3,3,0x3e00
 	# return r3 & fpscr
 	stwu 1,-16(1)
 	mffs 0
@@ -72,9 +75,9 @@ fegetround:
 	clrlwi 3,3,30
 	blr
 
-.global fesetround
-.type fesetround,@function
-fesetround:
+.global __fesetround
+.type __fesetround,@function
+__fesetround:
 	# note: invalid input is not checked, r3 < 4 must hold
 	# fpscr = (fpscr & -4U) | r3
 	stwu 1,-16(1)