summaryrefslogtreecommitdiff
path: root/sysdeps/powerpc/powerpc32/fpu/s_round.S
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/powerpc/powerpc32/fpu/s_round.S')
-rw-r--r--sysdeps/powerpc/powerpc32/fpu/s_round.S31
1 files changed, 8 insertions, 23 deletions
diff --git a/sysdeps/powerpc/powerpc32/fpu/s_round.S b/sysdeps/powerpc/powerpc32/fpu/s_round.S
index 39eab232f6..96fc2984fd 100644
--- a/sysdeps/powerpc/powerpc32/fpu/s_round.S
+++ b/sysdeps/powerpc/powerpc32/fpu/s_round.S
@@ -19,27 +19,12 @@
#include <sysdep.h>
- .section .rodata
- .align 3
- .type TWO52.0,@object
- .size TWO52.0,8
-TWO52.0:
- .long 0x43300000
- .long 0
- .type POINTFIVE.0,@object
- .size POINTFIVE.0,8
-POINTFIVE.0:
- .long 0x3fe00000
- .long 0
-
.section .rodata.cst8,"aM",@progbits,8
- .align 3
+ .align 2
.LC0: /* 2**52 */
- .long 0x43300000
- .long 0
+ .long 0x59800000
.LC1: /* 0.5 */
- .long 0x3fe00000
- .long 0
+ .long 0x3f000000
/* double [fp1] round (double x [fp1])
IEEE 1003.1 round function. IEEE specifies "round to the nearest
@@ -51,6 +36,7 @@ POINTFIVE.0:
"Round toward Zero" mode and round by adding +-0.5 before rounding
to the integer value. */
+ .section ".text"
ENTRY (__round)
mffs fp11 /* Save current FPU rounding mode. */
#ifdef SHARED
@@ -59,10 +45,10 @@ ENTRY (__round)
mflr r10
lwz r9,.LC0@got(10)
mtlr r11
- lfd fp13,0(r9)
+ lfs fp13,0(r9)
#else
lis r9,.LC0@ha
- lfd fp13,.LC0@l(r9)
+ lfs fp13,.LC0@l(r9)
#endif
fabs fp0,fp1
fsub fp12,fp13,fp13 /* generate 0.0 */
@@ -71,11 +57,10 @@ ENTRY (__round)
bnllr- cr7
mtfsfi 7,1 /* Set rounding mode toward 0. */
#ifdef SHARED
- lwz r9,.LC1@got(10)
- lfd fp10,0(r9)
+ lfs fp10,.LC1-.LC0(r9)
#else
lis r9,.LC1@ha
- lfd fp10,.LC1@l(r9)
+ lfs fp10,.LC1@l(r9)
#endif
ble- cr6,.L4
fadd fp1,fp1,fp10 /* x+= 0.5; */