From patchwork Tue Jan 30 16:54:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 85035 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 4E495386D601 for ; Tue, 30 Jan 2024 16:54:57 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-pf1-x42f.google.com (mail-pf1-x42f.google.com [IPv6:2607:f8b0:4864:20::42f]) by sourceware.org (Postfix) with ESMTPS id 6A31C38618B1 for ; Tue, 30 Jan 2024 16:54:33 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 6A31C38618B1 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linaro.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 6A31C38618B1 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::42f ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1706633676; cv=none; b=EvWNDVeBPYC5z+a5q1w07Nt3nJmAO30rzDExD0z2CHe6lI0EkdQeottYyuigtpLHC/LAHz4jV1d24Z3zx2OqFugrEvfpAiL7ZTaosrfLRMxC+FkLVo0arGnPxjNlBO4mVsUkp5cXQyHip0+bXCrPoUy2IRKP4enHjq/HRQlz9E0= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1706633676; c=relaxed/simple; bh=fOHKwnMAYzSbpyLX7BzAHoiEOSb853mKuVGg52zphKY=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=LqEZa/0p+G9N7jBjDZOZKfFmlK1yzMBEjjffeWkCYD6uWx9zyHRmLuyr88Vogs7oII7OWOstIo2XsJX8zVzPAtB8CxOTmiTu75b9O0xjCSt0MqJW6u3C+Aoj8Ojva7yorwCGMiHH8HvvZL0rq73ydxPoXQDn3BNoF7Jg/uuFmMc= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pf1-x42f.google.com with SMTP id d2e1a72fcca58-6ddc2a78829so1810155b3a.3 for ; Tue, 30 Jan 2024 08:54:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706633672; x=1707238472; darn=sourceware.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=ZEcd52UnyRSoLdY9YxF3ruNq1n5T8WPZnLWmBDdoXME=; b=eHH/2ZHuNQc6+tfkaZVgHPbup6kghBEk6AyeKZKbSAJyTtxR24irUIM04baOOa7CUN qjNf7WlylneXi8QfoPpc+YxHhpRvia0RqsJ4Wk7CxKC4pTmF5dlfgadUcuxo2uggQgpI q5Uco82403QfIovbgcCFzn8PM5/yjPvQjVeCQWZCvY7QXrxKTznWaCIVJttyn8ucEN94 aJZ1MeeZACaK5+3iFk55U6hkr35dNkfqLvwuXw+w6WltiU8ENyUM9ltRl/rzQQDWS9L5 aHwQ8PE86R2NxWI+aBUD7pyaqwqqhMI+1oujQQLv45ZHR0vBgp+atgxAi7CZvLlnsqto NGlQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706633672; x=1707238472; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=ZEcd52UnyRSoLdY9YxF3ruNq1n5T8WPZnLWmBDdoXME=; b=pNdI7iNOX2xK293noiP6/3L4HxRp8pXwRLu3FHy+4NatQI6DNVGhgoTPZu1rVFOzAY jIyTsUV5PPt2dtJzqoZTjrt7BfrDPTHHDZUglrswi5rQnHmb3syR7KyKOcoEOX+TqAmn 4LfvMeuuKfgZEkKbk1JfQpxBhgfenVvP2Q9i6VyOq6atWeWUP6c23Mf7wSSJXhdLnZIJ 6CsKBlWt4EqlEsG+xqniqgkr8MQwgIObGM3ZYjKrFytaokMnO25MZHW6Gu30QseHo91A njbbgtPwGXKjt0/cvNhkG0sXan9n56SchPQ0M9ETQzw53cdMPGKYQj6Te7mZjQKZlRSs 7jeQ== X-Gm-Message-State: AOJu0YyToZ8oDqbpCjhL53thhQGf5diK4Nyijo5NWcaWlN0yZCqNNacs OnV/Rjcg8x4U6QyT2lLdttucX5topR1exdgMdoRpH4z/dvau+ZAF7ZZMYZKWqa6pI3s0RUi1cUx H X-Google-Smtp-Source: AGHT+IEYpMUPjRN6ZOFE/JG0DmhGo/luxY119MS1oJvFOqMPN6J4NBs3KT8V5hxnI7DTzeGE0A6xoA== X-Received: by 2002:a05:6a00:1e0e:b0:6dd:be87:df2c with SMTP id gx14-20020a056a001e0e00b006ddbe87df2cmr5284287pfb.26.1706633671588; Tue, 30 Jan 2024 08:54:31 -0800 (PST) Received: from mandiga.. ([2804:1b3:a7c3:574b:1f51:212a:dcbc:b44e]) by smtp.gmail.com with ESMTPSA id gu2-20020a056a004e4200b006dde1781800sm8291731pfb.94.2024.01.30.08.54.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jan 2024 08:54:31 -0800 (PST) From: Adhemerval Zanella To: libc-alpha@sourceware.org Cc: Joseph Myers Subject: [PATCH] math: Remove bogus math implementations Date: Tue, 30 Jan 2024 13:54:27 -0300 Message-Id: <20240130165427.223189-1-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Spam-Status: No, score=-12.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_ASCII_DIVIDERS, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org 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. --- 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(-) delete mode 100644 math/e_exp10.c delete mode 100644 math/e_exp10l.c delete mode 100644 math/s_fma.c delete mode 100644 math/s_fmaf.c delete mode 100644 math/s_fmal.c 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)