diff options
Diffstat (limited to 'sysdeps/powerpc/fpu/e_hypotf.c')
-rw-r--r-- | sysdeps/powerpc/fpu/e_hypotf.c | 22 |
1 files changed, 4 insertions, 18 deletions
diff --git a/sysdeps/powerpc/fpu/e_hypotf.c b/sysdeps/powerpc/fpu/e_hypotf.c index e97f0c35e3..5fc91ee4c6 100644 --- a/sysdeps/powerpc/fpu/e_hypotf.c +++ b/sysdeps/powerpc/fpu/e_hypotf.c @@ -19,7 +19,7 @@ #include <math.h> #include <math_private.h> - +#include <stdint.h> static const float two30 = 1.0737418e09; @@ -46,13 +46,13 @@ static const float two30 = 1.0737418e09; ieee_float_shape_type gf_u2; \ gf_u1.value = (f1); \ gf_u2.value = (f2); \ - (i1) = gf_u1.word; \ - (i2) = gf_u2.word; \ + (i1) = gf_u1.word & 0x7fffffff; \ + (i2) = gf_u2.word & 0x7fffffff; \ } while (0) # define TEST_INF_NAN(x, y) \ do { \ - int32_t hx, hy; \ + uint32_t hx, hy; \ GET_TWO_FLOAT_WORD(x, y, hx, hy); \ if (hy > hx) { \ uint32_t ht = hx; hx = hy; hy = ht; \ @@ -69,22 +69,8 @@ static const float two30 = 1.0737418e09; float __ieee754_hypotf (float x, float y) { - x = fabsf (x); - y = fabsf (y); - TEST_INF_NAN (x, y); - if (y > x) - { - float t = y; - y = x; - x = t; - } - if (y == 0.0 || (x / y) > two30) - { - return x + y; - } - return __ieee754_sqrt ((double) x * x + (double) y * y); } strong_alias (__ieee754_hypotf, __hypotf_finite) |