summaryrefslogtreecommitdiffstats
path: root/libm/s_nextafterf.c
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2009-02-08 02:04:26 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2009-02-08 02:04:26 +0000
commit9676f11d513a43b0c1640b62b1978136c117d581 (patch)
tree6c13b57a4a200b5623e15b94e7aa0297eb563f84 /libm/s_nextafterf.c
parent6015bcfbbbb458ff42b2cee520ad965ad000bb73 (diff)
downloaduClibc-alpine-9676f11d513a43b0c1640b62b1978136c117d581.tar.bz2
uClibc-alpine-9676f11d513a43b0c1640b62b1978136c117d581.tar.xz
nextafterf: trying to correct FP exception handling
Diffstat (limited to 'libm/s_nextafterf.c')
-rw-r--r--libm/s_nextafterf.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/libm/s_nextafterf.c b/libm/s_nextafterf.c
index 8dee00ff7..5fc44e31c 100644
--- a/libm/s_nextafterf.c
+++ b/libm/s_nextafterf.c
@@ -16,11 +16,6 @@
#include "math.h"
#include "math_private.h"
-#ifndef math_opt_barrier
-# define math_opt_barrier(x) ({ __typeof (x) __x = x; __asm ("" : "+m" (__x)); __x; })
-# define math_force_eval(x) __asm __volatile ("" : : "m" (x))
-#endif
-
float nextafterf(float x, float y)
{
int32_t hx, hy, ix, iy;
@@ -38,12 +33,12 @@ float nextafterf(float x, float y)
return y;
if (ix == 0) { /* x == 0? */
- float u;
+// glibc 2.4 does not seem to set underflow?
+// float u;
/* return +-minsubnormal */
SET_FLOAT_WORD(x, (hy & 0x80000000) | 1);
- u = math_opt_barrier(x);
- u = u * u;
- math_force_eval(u); /* raise underflow flag */
+// u = x * x; /* raise underflow flag */
+// math_force_eval(u);
return x;
}
@@ -63,8 +58,6 @@ float nextafterf(float x, float y)
hy = hx & 0x7f800000;
if (hy >= 0x7f800000) {
x = x + x; /* overflow */
-//?? if (FLT_EVAL_METHOD != 0)
-// asm ("" : "+m"(x));
return x; /* overflow */
}
if (hy < 0x00800000) {