about summary refs log tree commit diff
path: root/sysdeps/i386
diff options
context:
space:
mode:
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>2021-04-06 14:33:14 -0300
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>2021-12-13 10:08:46 -0300
commit104d2005d5b7fb13a970905ca3f4a7e7e783cf1a (patch)
tree7af83f8b5fe473d72e1d0ec72c5ac45b4d0351b6 /sysdeps/i386
parent2f44eef584a4c9650ce772258dedde902c00dae2 (diff)
downloadglibc-104d2005d5b7fb13a970905ca3f4a7e7e783cf1a.tar.gz
glibc-104d2005d5b7fb13a970905ca3f4a7e7e783cf1a.tar.xz
glibc-104d2005d5b7fb13a970905ca3f4a7e7e783cf1a.zip
math: Remove the error handling wrapper from hypot and hypotf
The error handling is moved to sysdeps/ieee754 version with no SVID
support.  The compatibility symbol versions still use the wrapper with
SVID error handling around the new code.  There is no new symbol version
nor compatibility code on !LIBM_SVID_COMPAT targets (e.g. riscv).

Only ia64 is unchanged, since it still uses the arch specific
__libm_error_region on its implementation.

Checked on x86_64-linux-gnu, i686-linux-gnu, and aarch64-linux-gnu.
Diffstat (limited to 'sysdeps/i386')
-rw-r--r--sysdeps/i386/fpu/e_hypot.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/sysdeps/i386/fpu/e_hypot.c b/sysdeps/i386/fpu/e_hypot.c
index aa49d42881..90a245e01f 100644
--- a/sysdeps/i386/fpu/e_hypot.c
+++ b/sysdeps/i386/fpu/e_hypot.c
@@ -29,7 +29,7 @@
    hypot implementation, since internal multiplication and sqrt is carried
    with 80-bit FP type.  */
 double
-__ieee754_hypot (double x, double y)
+__hypot (double x, double y)
 {
   if (!isfinite (x) || !isfinite (y))
     {
@@ -43,6 +43,15 @@ __ieee754_hypot (double x, double y)
   long double ly = y;
   double r = math_narrow_eval ((double) sqrtl (lx * lx + ly * ly));
   math_check_force_underflow_nonneg (r);
+  if (isinf (r))
+    __set_errno (ERANGE);
   return r;
 }
+strong_alias (__hypot, __ieee754_hypot)
+#if LIBM_SVID_COMPAT
+versioned_symbol (libm, __hypot, hypot, GLIBC_2_35);
 libm_alias_finite (__ieee754_hypot, __hypot)
+libm_alias_double_other (__hypot, hypot)
+#else
+libm_alias_double (__hypot, hypot)
+#endif