From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1791) id 657DE3858020; Thu, 1 Feb 2024 12:45:24 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 657DE3858020 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1706791524; bh=FlNY29h2DOKdiB2PnGkRUWbeXVpivQ+eucDQnd7lI6Y=; h=From:To:Subject:Date:From; b=B8zwPmh35qxmYHTZxalzgEX3WJOQl59QzCR+3aqtoP1w4d1rTBUPANvzVdTXJ1Rzj Z76fTUZq1tY9IMiN8uhCV+NxTQRfxdGJI0IHNOOAkjfbQ3lZNBOJEjJSNEEB2L3hnh +0sPWi3285K4iZZy110DIcvDlazlFwHj5p3nGxmQ= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Adhemerval Zanella To: glibc-cvs@sourceware.org Subject: [glibc] math: Remove bogus math implementations X-Act-Checkin: glibc X-Git-Author: Adhemerval Zanella X-Git-Refname: refs/heads/master X-Git-Oldrev: 42cc619dfbc44e263239c2de870bae11ad65810a X-Git-Newrev: 9c61303ebbdc6e727c89591bff3229c9fbfa438b Message-Id: <20240201124524.657DE3858020@sourceware.org> Date: Thu, 1 Feb 2024 12:45:24 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=9c61303ebbdc6e727c89591bff3229c9fbfa438b commit 9c61303ebbdc6e727c89591bff3229c9fbfa438b Author: Adhemerval Zanella Date: Tue Jan 30 13:54:27 2024 -0300 math: Remove bogus math implementations The exp10, exp10l, fma, fmaf, and fmal default implementation do not implement the appropriate semantics nor with an reasonable accuracy. They are also not used by any supported port. Diff: --- math/e_exp10.c | 33 --------------------------------- math/e_exp10l.c | 33 --------------------------------- math/s_fma.c | 36 ------------------------------------ math/s_fmaf.c | 30 ------------------------------ math/s_fmal.c | 32 -------------------------------- 5 files changed, 164 deletions(-) diff --git a/math/e_exp10.c b/math/e_exp10.c deleted file mode 100644 index 82fbde520d..0000000000 --- a/math/e_exp10.c +++ /dev/null @@ -1,33 +0,0 @@ -/* Copyright (C) 1998-2024 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#include -#include -#include -#include - -double -__ieee754_exp10 (double arg) -{ - if (isfinite (arg) && arg < DBL_MIN_10_EXP - DBL_DIG - 10) - return DBL_MIN * DBL_MIN; - else - /* This is a very stupid and inprecise implementation. It'll get - replaced sometime (soon?). */ - return __ieee754_exp (M_LN10 * arg); -} -libm_alias_finite (__ieee754_exp10, __exp10) diff --git a/math/e_exp10l.c b/math/e_exp10l.c deleted file mode 100644 index 2786ca34b4..0000000000 --- a/math/e_exp10l.c +++ /dev/null @@ -1,33 +0,0 @@ -/* Copyright (C) 1998-2024 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#include -#include -#include -#include - -long double -__ieee754_exp10l (long double arg) -{ - if (isfinite (arg) && arg < LDBL_MIN_10_EXP - LDBL_DIG - 10) - return LDBL_MIN * LDBL_MIN; - else - /* This is a very stupid and inprecise implementation. It'll get - replaced sometime (soon?). */ - return __ieee754_expl (M_LN10l * arg); -} -libm_alias_finite (__ieee754_exp10, __exp10) diff --git a/math/s_fma.c b/math/s_fma.c deleted file mode 100644 index e036a1c809..0000000000 --- a/math/s_fma.c +++ /dev/null @@ -1,36 +0,0 @@ -/* Compute x * y + z as ternary operation. - Copyright (C) 1997-2024 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#define NO_MATH_REDIRECT -#define dfmal __hide_dfmal -#define f32xfmaf64 __hide_f32xfmaf64 -#include -#undef dfmal -#undef f32xfmaf64 -#include -#include - -double -__fma (double x, double y, double z) -{ - return (x * y) + z; -} -#ifndef __fma -libm_alias_double (__fma, fma) -libm_alias_double_narrow (__fma, fma) -#endif diff --git a/math/s_fmaf.c b/math/s_fmaf.c deleted file mode 100644 index 407531a40c..0000000000 --- a/math/s_fmaf.c +++ /dev/null @@ -1,30 +0,0 @@ -/* Compute x * y + z as ternary operation. - Copyright (C) 1997-2024 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#define NO_MATH_REDIRECT -#include -#include - -float -__fmaf (float x, float y, float z) -{ - return (x * y) + z; -} -#ifndef __fmaf -libm_alias_float (__fma, fma) -#endif diff --git a/math/s_fmal.c b/math/s_fmal.c deleted file mode 100644 index 05fd756b32..0000000000 --- a/math/s_fmal.c +++ /dev/null @@ -1,32 +0,0 @@ -/* Compute x * y + z as ternary operation. - Copyright (C) 1997-2024 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#define NO_MATH_REDIRECT -#define f64xfmaf128 __hide_f64xfmaf128 -#include -#undef f64xfmaf128 -#include -#include - -long double -__fmal (long double x, long double y, long double z) -{ - return (x * y) + z; -} -libm_alias_ldouble (__fma, fma) -libm_alias_ldouble_narrow (__fma, fma)