aboutsummaryrefslogtreecommitdiff
path: root/sysdeps
diff options
context:
space:
mode:
authorStan Shebs <stanshebs@google.com>2018-09-26 14:44:39 -0700
committerFangrui Song <i@maskray.me>2021-08-27 17:23:14 -0700
commit960ba7975cf05b2466ed793f6a1ee4bffb205b9d (patch)
tree4696757412e8ce8d87deb8f2dc8d34dcac1c68a2 /sysdeps
parente04e10b43100973eda7d76164cc7c0dc625f035d (diff)
downloadglibc-960ba7975cf05b2466ed793f6a1ee4bffb205b9d.zip
glibc-960ba7975cf05b2466ed793f6a1ee4bffb205b9d.tar.gz
glibc-960ba7975cf05b2466ed793f6a1ee4bffb205b9d.tar.bz2
Work around mtfsb0 syntax limitation with clang
Diffstat (limited to 'sysdeps')
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/s_nearbyint.S8
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/s_nearbyintf.S8
2 files changed, 16 insertions, 0 deletions
diff --git a/sysdeps/powerpc/powerpc64/fpu/s_nearbyint.S b/sysdeps/powerpc/powerpc64/fpu/s_nearbyint.S
index 7d89e78..27020c9 100644
--- a/sysdeps/powerpc/powerpc64/fpu/s_nearbyint.S
+++ b/sysdeps/powerpc/powerpc64/fpu/s_nearbyint.S
@@ -42,7 +42,11 @@ ENTRY (__nearbyint, 4)
fcmpu cr7,fp1,fp12 /* if (x > 0.0) */
ble cr7, L(lessthanzero)
mffs fp11
+#if defined __clang__
+ mtfsb0 31 /* Disable FE_INEXACT exception */
+#else
mtfsb0 4*cr7+lt /* Disable FE_INEXACT exception */
+#endif
fadd fp1,fp1,fp13 /* x+= TWO52 */
fsub fp1,fp1,fp13 /* x-= TWO52 */
fabs fp1,fp1 /* if (x == 0.0) */
@@ -51,7 +55,11 @@ ENTRY (__nearbyint, 4)
L(lessthanzero):
bgelr cr7 /* if (x < 0.0) */
mffs fp11
+#if defined __clang__
+ mtfsb0 31
+#else
mtfsb0 4*cr7+lt
+#endif
fsub fp1,fp1,fp13 /* x -= TWO52 */
fadd fp1,fp1,fp13 /* x += TWO52 */
fnabs fp1,fp1 /* if (x == 0.0) */
diff --git a/sysdeps/powerpc/powerpc64/fpu/s_nearbyintf.S b/sysdeps/powerpc/powerpc64/fpu/s_nearbyintf.S
index 4b62ba1..0522b10 100644
--- a/sysdeps/powerpc/powerpc64/fpu/s_nearbyintf.S
+++ b/sysdeps/powerpc/powerpc64/fpu/s_nearbyintf.S
@@ -43,7 +43,11 @@ ENTRY (__nearbyintf, 4)
fcmpu cr7,fp1,fp12 /* if (x > 0.0) */
ble cr7, L(lessthanzero)
mffs fp11
+#if defined __clang__
+ mtfsb0 31 /* Disable FE_INEXACT exception */
+#else
mtfsb0 4*cr7+lt /* Disable FE_INEXACT exception */
+#endif
fadds fp1,fp1,fp13 /* x += TWO23 */
fsubs fp1,fp1,fp13 /* x -= TWO23 */
fabs fp1,fp1 /* if (x == 0.0) */
@@ -52,7 +56,11 @@ ENTRY (__nearbyintf, 4)
L(lessthanzero):
bgelr cr7 /* if (x < 0.0) */
mffs fp11
+#if defined __clang__
+ mtfsb0 31 /* Disable FE_INEXACT exception */
+#else
mtfsb0 4*cr7+lt /* Disable FE_INEXACT exception */
+#endif
fsubs fp1,fp1,fp13 /* x -= TWO23 */
fadds fp1,fp1,fp13 /* x += TWO23 */
fnabs fp1,fp1 /* if (x == 0.0) */