From patchwork Tue Jun 9 21:33:00 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 39544 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 8B3D8388C02B; Tue, 9 Jun 2020 21:33:26 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8B3D8388C02B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1591738406; bh=FHX8RFI8P+H1E8hsYvX6L5D1ZkWc84UoVXTuPGu8RbA=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=vUB9w5dRH95h+m39WW0JiTDgxTXsYVODqXZZhwDp+hfBPMmo/u/II01txiGbOqrhx jx7RcsVg3DdWGUgb+qpTMTaXu0YDp/OUJaRFmCqIuiXvtrX0o37VPkd6agU4X/NbWF 0wX7OF8z2ZjJOi0uZ/xxrsjXRC4JDtW8bUFr3BDk= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qv1-xf2a.google.com (mail-qv1-xf2a.google.com [IPv6:2607:f8b0:4864:20::f2a]) by sourceware.org (Postfix) with ESMTPS id 9252C388C022 for ; Tue, 9 Jun 2020 21:33:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 9252C388C022 Received: by mail-qv1-xf2a.google.com with SMTP id r16so91539qvm.6 for ; Tue, 09 Jun 2020 14:33:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=FHX8RFI8P+H1E8hsYvX6L5D1ZkWc84UoVXTuPGu8RbA=; b=PQazpQyx7rpjUfwtwd4mNsumngdthA8NevfPuWJ9MJSMibGZqt8xD9Fs2q0pxaApI0 JE32EvQDrbUm7OSzDQqzMNBrFBkedlIf4zsEuhJU465PIjqWYlqKBBm0Oyj0gg4uAtBr zygsRdlWJXbeXGUnzjyDtz+fjYOLYuyVhignTsncbPcCju+Mi5l1kjIHyZYickf2gwao R3qtV4JTPkstdbVrmAKbKA53ZoutuMUNUkj1KbnD6yO63NzE9qHo6GbPXAbb13uO81lR dDIpjzCQmGqy9L0/K6++917dlB0tCBYZV0/xwFERiAnOdfmJ5ObFf7dlDjtzyxZPW2T+ brfA== X-Gm-Message-State: AOAM532v7GRl5TxVc5GKWWF9YPSoxr7i2SxttdJSFPQ/PRKuqR0OwBo7 k6ye42rF6W/a6lR6EK7fn5NwZB7mtY8= X-Google-Smtp-Source: ABdhPJzsqwzyDiqlX4lXh3uarutuZ9WGnet2gmNAdOEAgo492kf7O3avs+m5kpQYI1TkdOAYchxtDQ== X-Received: by 2002:a05:6214:313:: with SMTP id i19mr105546qvu.183.1591738403896; Tue, 09 Jun 2020 14:33:23 -0700 (PDT) Received: from localhost.localdomain ([177.194.48.209]) by smtp.googlemail.com with ESMTPSA id d193sm10746214qke.124.2020.06.09.14.33.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Jun 2020 14:33:23 -0700 (PDT) To: libc-alpha@sourceware.org Subject: [PATCH 12/13] arm: Use sqrt{f} builtin Date: Tue, 9 Jun 2020 18:33:00 -0300 Message-Id: <20200609213301.3591135-12-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200609213301.3591135-1-adhemerval.zanella@linaro.org> References: <20200609213301.3591135-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-14.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Adhemerval Zanella via Libc-alpha From: Adhemerval Zanella Netto Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" Checked on arm-linux-gnueabi and armv7-linux-gnueabihf --- sysdeps/arm/e_sqrt.c | 46 ---------------------------- sysdeps/arm/e_sqrtf.c | 46 ---------------------------- sysdeps/arm/math-use-builtins-sqrt.h | 9 ++++++ 3 files changed, 9 insertions(+), 92 deletions(-) delete mode 100644 sysdeps/arm/e_sqrt.c delete mode 100644 sysdeps/arm/e_sqrtf.c create mode 100644 sysdeps/arm/math-use-builtins-sqrt.h diff --git a/sysdeps/arm/e_sqrt.c b/sysdeps/arm/e_sqrt.c deleted file mode 100644 index d264c4263b..0000000000 --- a/sysdeps/arm/e_sqrt.c +++ /dev/null @@ -1,46 +0,0 @@ -/* Compute square root for double. ARM version. - Copyright (C) 2016-2020 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 - . */ - -#ifdef __SOFTFP__ - -/* Use architecture-indendent sqrt implementation. */ -# include - -#else - -/* Use VFP square root instruction. */ -# include -# include -# include - -double -__ieee754_sqrt (double x) -{ - double ret; -# if __ARM_ARCH >= 6 - asm ("vsqrt.f64 %P0, %P1" : "=w" (ret) : "w" (x)); -# else - /* As in GCC, for VFP9 Erratum 760019 avoid overwriting the - input. */ - asm ("vsqrt.f64 %P0, %P1" : "=&w" (ret) : "w" (x)); -# endif - return ret; -} -libm_alias_finite (__ieee754_sqrt, __sqrt) - -#endif diff --git a/sysdeps/arm/e_sqrtf.c b/sysdeps/arm/e_sqrtf.c deleted file mode 100644 index c3f31119a3..0000000000 --- a/sysdeps/arm/e_sqrtf.c +++ /dev/null @@ -1,46 +0,0 @@ -/* Compute square root for float. ARM version. - Copyright (C) 2016-2020 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 - . */ - -#ifdef __SOFTFP__ - -/* Use architecture-indendent sqrtf implementation. */ -# include - -#else - -/* Use VFP square root instruction. */ -# include -# include -# include - -float -__ieee754_sqrtf (float x) -{ - float ret; -# if __ARM_ARCH >= 6 - asm ("vsqrt.f32 %0, %1" : "=t" (ret) : "t" (x)); -# else - /* As in GCC, for VFP9 Erratum 760019 avoid overwriting the - input. */ - asm ("vsqrt.f32 %0, %1" : "=&t" (ret) : "t" (x)); -# endif - return ret; -} -libm_alias_finite (__ieee754_sqrtf, __sqrtf) - -#endif diff --git a/sysdeps/arm/math-use-builtins-sqrt.h b/sysdeps/arm/math-use-builtins-sqrt.h new file mode 100644 index 0000000000..e765e7c49d --- /dev/null +++ b/sysdeps/arm/math-use-builtins-sqrt.h @@ -0,0 +1,9 @@ +#ifdef __SOFTFP__ +# define USE_SQRT_BUILTIN 0 +# define USE_SQRTF_BUILTIN 0 +#else +# define USE_SQRT_BUILTIN 1 +# define USE_SQRTF_BUILTIN 1 +#endif +#define USE_SQRTL_BUILTIN 0 +#define USE_SQRTF128_BUILTIN 0