summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/libc/sparc64/gen/assym.s3
-rw-r--r--lib/libc/sparc64/gen/modf.S5
2 files changed, 6 insertions, 2 deletions
diff --git a/lib/libc/sparc64/gen/assym.s b/lib/libc/sparc64/gen/assym.s
index ecc22b4..7b205db 100644
--- a/lib/libc/sparc64/gen/assym.s
+++ b/lib/libc/sparc64/gen/assym.s
@@ -13,3 +13,6 @@
#define SIG_BLOCK 1
#define SIG_SETMASK 3
+
+#define FSR_RD_MASK 0xc0000000
+#define FSR_RD_RD_Z 0x40000000
diff --git a/lib/libc/sparc64/gen/modf.S b/lib/libc/sparc64/gen/modf.S
index 6e5913b..a9242d8 100644
--- a/lib/libc/sparc64/gen/modf.S
+++ b/lib/libc/sparc64/gen/modf.S
@@ -51,7 +51,8 @@
#endif /* SYSLIBC_RCS and not lint */
#include <machine/asm.h>
-#include <machine/fsr.h>
+
+#include "assym.s"
/*
* double modf(double val, double *iptr)
@@ -129,7 +130,7 @@ ENTRY(modf)
st %fsr, [%fp + SPOFF - 4] ! %l5 = current FSR mode
set FSR_RD_MASK, %l3 ! %l3 = rounding direction mask
ld [%fp + SPOFF - 4], %l5
- set FSR_RD(FSR_RD_Z), %l4
+ set FSR_RD_RD_Z, %l4
andn %l5, %l3, %l6
or %l6, %l4, %l6 ! round towards zero, please
and %l5, %l3, %l5 ! save original rounding mode
OpenPOWER on IntegriCloud