summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--sysdeps/alpha/fpu/s_trunc.c7
-rw-r--r--sysdeps/alpha/fpu/s_truncf.c7
3 files changed, 12 insertions, 8 deletions
diff --git a/ChangeLog b/ChangeLog
index fa362a590e..1df6ca8fc4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -11,6 +11,12 @@
* sysdeps/alpha/fpu/s_rint.c (__rint): Add argument with itself
when it is a NaN.
* sysdeps/alpha/fpu/s_rintf.c (__rintf): Likewise.
+ * sysdeps/alpha/fpu/s_trunc.c (__trunc): Return the input value
+ when its absolute value is greater than 0x1.0p52.
+ [_IEEE_FP_INEXACT] Remove.
+ * sysdeps/alpha/fpu/s_truncf.c (__truncf): Return the input value
+ when its absolute value is greater than 0x1.0p23.
+ [_IEEE_FP_INEXACT] Remove.
2016-08-01 Carlos O'Donell <carlos@redhat.com>
diff --git a/sysdeps/alpha/fpu/s_trunc.c b/sysdeps/alpha/fpu/s_trunc.c
index 16cb114a72..4b986a6926 100644
--- a/sysdeps/alpha/fpu/s_trunc.c
+++ b/sysdeps/alpha/fpu/s_trunc.c
@@ -28,12 +28,11 @@ __trunc (double x)
double two52 = copysign (0x1.0p52, x);
double r, tmp;
+ if (isgreaterequal (fabs (x), 0x1.0p52))
+ return x;
+
__asm (
-#ifdef _IEEE_FP_INEXACT
- "addt/suic %2, %3, %1\n\tsubt/suic %1, %3, %0"
-#else
"addt/suc %2, %3, %1\n\tsubt/suc %1, %3, %0"
-#endif
: "=&f"(r), "=&f"(tmp)
: "f"(x), "f"(two52));
diff --git a/sysdeps/alpha/fpu/s_truncf.c b/sysdeps/alpha/fpu/s_truncf.c
index 2290f28295..3e93356166 100644
--- a/sysdeps/alpha/fpu/s_truncf.c
+++ b/sysdeps/alpha/fpu/s_truncf.c
@@ -27,12 +27,11 @@ __truncf (float x)
float two23 = copysignf (0x1.0p23, x);
float r, tmp;
+ if (isgreaterequal (fabsf (x), 0x1.0p23))
+ return x;
+
__asm (
-#ifdef _IEEE_FP_INEXACT
- "adds/suic %2, %3, %1\n\tsubs/suic %1, %3, %0"
-#else
"adds/suc %2, %3, %1\n\tsubs/suc %1, %3, %0"
-#endif
: "=&f"(r), "=&f"(tmp)
: "f"(x), "f"(two23));