summaryrefslogtreecommitdiff
path: root/sysdeps/powerpc/powerpc64/fpu/s_roundf.S
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/powerpc/powerpc64/fpu/s_roundf.S')
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/s_roundf.S18
1 files changed, 10 insertions, 8 deletions
diff --git a/sysdeps/powerpc/powerpc64/fpu/s_roundf.S b/sysdeps/powerpc/powerpc64/fpu/s_roundf.S
index cb18758197..c78310e8a7 100644
--- a/sysdeps/powerpc/powerpc64/fpu/s_roundf.S
+++ b/sysdeps/powerpc/powerpc64/fpu/s_roundf.S
@@ -1,5 +1,5 @@
/* roundf function. PowerPC64 version.
- Copyright (C) 2004 Free Software Foundation, Inc.
+ Copyright (C) 2004-2014 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -19,18 +19,20 @@
#include <sysdep.h>
.section ".toc","aw"
+ .p2align 3
.LC0: /* 2**23 */
- .tc FD_4b000000_0[TC],0x4b00000000000000
+ .long 0x4b000000
.LC1: /* 0.5 */
- .tc FD_3f000000_0[TC],0x3f00000000000000
+ .long 0x3f000000
+
.section ".text"
-
+
/* float [fp1] roundf (float x [fp1])
- IEEE 1003.1 round function. IEEE specifies "round to the nearest
+ IEEE 1003.1 round function. IEEE specifies "round to the nearest
integer value, rounding halfway cases away from zero, regardless of
the current rounding mode." However PowerPC Architecture defines
- "Round to Nearest" as "Choose the best approximation. In case of a
- tie, choose the one that is even (least significant bit o).".
+ "Round to Nearest" as "Choose the best approximation. In case of a
+ tie, choose the one that is even (least significant bit o).".
So we can't use the PowerPC "Round to Nearest" mode. Instead we set
"Round toward Zero" mode and round by adding +-0.5 before rounding
to the integer value. */
@@ -62,7 +64,7 @@ EALIGN (__roundf, 4, 0)
fnabs fp1,fp1 /* if (x == 0.0) */
/* x = -0.0; */
.L9:
- mtfsf 0x01,fp11 /* restore previous rounding mode. */
+ mtfsf 0x01,fp11 /* restore previous rounding mode. */
blr
END (__roundf)