From 104d2005d5b7fb13a970905ca3f4a7e7e783cf1a Mon Sep 17 00:00:00 2001 From: Adhemerval Zanella Date: Tue, 6 Apr 2021 14:33:14 -0300 Subject: 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. --- sysdeps/i386/fpu/e_hypot.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'sysdeps/i386/fpu') 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 -- cgit v1.2.3