From patchwork Fri Mar 29 13:35:03 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 161424 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp2048875jan; Fri, 29 Mar 2019 06:36:08 -0700 (PDT) X-Google-Smtp-Source: APXvYqxkj2juOCD75YYj62Rb9jqwJdyc/BZEaX31EEGMAz4izNp3FYZyjUo89XmWsuFC+1GNEaQz X-Received: by 2002:a62:75d7:: with SMTP id q206mr23638581pfc.213.1553866568913; Fri, 29 Mar 2019 06:36:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553866568; cv=none; d=google.com; s=arc-20160816; b=BKpZW/k9pAxlGlYz7RkdsVAMyadEpNcVy1tYVqSSbYhqNfjnv3mFL/uhtAPAy14/p1 HJYLgPcey2uv++f+OBetd4ehYFuRpGVZdTCwt4aZ5yMutQjhOBdRMVEf0G5EgWZOVEsa eUqAKIXCPHn9dtIjZba39VdnLUZ51q4+oQzC8hhBzKzixxjoBf5ilEVW4zvaf04+Qkys koJXCRkG1fvt3XujDP3EDRo9x3qmenyaxsSC0gTs8paAAVB+E7E4tyOrtAeuStat53V/ zrLPawAvYDpqWIbywyBYYpa9+PgZF/63oy7qEDRVfIJhRjoj15KEEeWGb1HJtl5f0ynz uCLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:to:from :dkim-signature:delivered-to:sender:list-help:list-post:list-archive :list-subscribe:list-unsubscribe:list-id:precedence:mailing-list :dkim-signature:domainkey-signature; bh=Z/sHlL5wy7TiyYQfadp1i9xEkRP/M/305UolO73VwP4=; b=aUIPkH/rp2r1942hubX8DE3BBc/qDhIpl1/3B+Pms8v9gAoJVmYgPxmE9JN7Os3mNs I+mudmE7Y59piX+ijKlsrOoOW/hxF85TgRBr0PLLnXOkV48Ip9XtntD5XknLiKLDLhh3 +l1L3F3RerF8T5dazCn6KtpgaE4PGpnwhB4v2saVpKTRMJwzGQPH/uV8R7SGdwmksAwL pBirBLyD1pdTDQaabqQS4XCe/CYdsz+kXAz7PK82IrJ+dnMm5ZWu21p2gN7SQiCU+//+ JpBDDW0grliZpMRdtMAVrALZIDltkO80R687lKP1iq85FLMmaSAzgugCODaA9xnBJch1 vvqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=TuCtL6LZ; dkim=pass header.i=@linaro.org header.s=google header.b=EKArZg5r; spf=pass (google.com: domain of libc-alpha-return-100993-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-100993-patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id g126si1889571pgc.75.2019.03.29.06.36.08 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 29 Mar 2019 06:36:08 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-return-100993-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=TuCtL6LZ; dkim=pass header.i=@linaro.org header.s=google header.b=EKArZg5r; spf=pass (google.com: domain of libc-alpha-return-100993-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-100993-patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id:in-reply-to :references; q=dns; s=default; b=nrHZabBxwk2orVNzM2AQwN8NnU4skyd OjbOzsgyCafzRwh1JUnWwauR8OR1wJ4v3XmIeaCofBKHxZtriD3AfXpqgxqJ7Ejs n0sfTF4AeZKstxru1nlTnZZzWFc30gk3vOgSR/C981PbfEcQIfp0uEejx1yWJ4RA M4nXTWp5+OL0= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id:in-reply-to :references; s=default; bh=4RrTUdmjgGshyMovIra2ZKaQ8eA=; b=TuCtL 6LZhy05uEKqTU4XmaG9PoTVC+HLl6LIsL6v+id320wFch859qoK5QlsbmtZQncT/ ZNOzD0EZm2r026sTerlzih8TTL1ZFPMNBLil765hYUrPaBj9/t+OIF/jSvnMezsA rVsGa/KopQXYJRONsrqNm5fFuSboHvQ/BdvWGs= Received: (qmail 117857 invoked by alias); 29 Mar 2019 13:35:39 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 117831 invoked by uid 89); 29 Mar 2019 13:35:39 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-22.2 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy=UD:S X-HELO: mail-vs1-f52.google.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references; bh=Z/sHlL5wy7TiyYQfadp1i9xEkRP/M/305UolO73VwP4=; b=EKArZg5ryAw9nnt31RDClO+kHgB5LHXX77F0A0LdXo28FqOFG3llpAY5Jg/7bsdlft Z+tTiYDwQygXqOfGqFXB95Y/9vtQW4JChS4N7XdcHzy529miiAsq98o2jo496nfKx3oA rfOedgFhSpiB1KMoI74FiZy7XNveCV/HBfUn5rMAoK2Bawld7ClaqBvIW/Yka22QDDlE GqIpu1M0Hn4rge5tT2oubIcOb46iQG+eR3JxMsZ5SvUk7S4TBJoBWVCsz9ER2+PfmVjo TdFm3NdiUx62tXhv7jG1VozNXhgau0V47d6mh7WngIzI7MyNx4PMXuVr2dydR+Yb0aoZ shww== Return-Path: From: Adhemerval Zanella To: libc-alpha@sourceware.org Subject: [PATCH 02/28] powerpc: fma using builtins Date: Fri, 29 Mar 2019 10:35:03 -0300 Message-Id: <20190329133529.22523-3-adhemerval.zanella@linaro.org> In-Reply-To: <20190329133529.22523-1-adhemerval.zanella@linaro.org> References: <20190329133529.22523-1-adhemerval.zanella@linaro.org> This patch just refactor the assembly implementation to use compiler builtins instead. Checked on powerpc-linux-gnu (built without --with-cpu, with --with-cpu=power4 and with --with-cpu=power5+ and --disable-multi-arch), powerpc64-linux-gnu (built without --with-cp and with --with-cpu=power5+ and --disable-multi-arch). * sysdeps/powerpc/fpu/s_fma.S: Remove file. * sysdeps/powerpc/fpu/s_fmaf.S: Likewise. * sysdeps/powerpc/fpu/s_fma.c: New file. * sysdeps/powerpc/fpu/s_fmaf.c: Likewise. --- sysdeps/powerpc/fpu/{s_fma.S => s_fma.c} | 12 +++++------- sysdeps/powerpc/fpu/{s_fmaf.S => s_fmaf.c} | 12 +++++------- 2 files changed, 10 insertions(+), 14 deletions(-) rename sysdeps/powerpc/fpu/{s_fma.S => s_fma.c} (82%) rename sysdeps/powerpc/fpu/{s_fmaf.S => s_fmaf.c} (82%) -- 2.17.1 diff --git a/sysdeps/powerpc/fpu/s_fma.S b/sysdeps/powerpc/fpu/s_fma.c similarity index 82% rename from sysdeps/powerpc/fpu/s_fma.S rename to sysdeps/powerpc/fpu/s_fma.c index 92e08eb583..688f9badf5 100644 --- a/sysdeps/powerpc/fpu/s_fma.S +++ b/sysdeps/powerpc/fpu/s_fma.c @@ -1,5 +1,5 @@ /* Compute x * y + z as ternary operation. PowerPC version. - Copyright (C) 2010-2019 Free Software Foundation, Inc. + Copyright (C) 2019 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 @@ -19,10 +19,8 @@ #include #include -ENTRY_TOCLESS(__fma) -/* double [f1] fma (double [f1] x, double [f2] y, double [f3] z); */ - fmadd fp1,fp1,fp2,fp3 - blr -END(__fma) - +double __fma (double x, double y, double z) +{ + return __builtin_fma (x, y, z); +} libm_alias_double (__fma, fma) diff --git a/sysdeps/powerpc/fpu/s_fmaf.S b/sysdeps/powerpc/fpu/s_fmaf.c similarity index 82% rename from sysdeps/powerpc/fpu/s_fmaf.S rename to sysdeps/powerpc/fpu/s_fmaf.c index 9579e9492e..38b59e1f2f 100644 --- a/sysdeps/powerpc/fpu/s_fmaf.S +++ b/sysdeps/powerpc/fpu/s_fmaf.c @@ -1,5 +1,5 @@ /* Compute x * y + z as ternary operation. PowerPC version. - Copyright (C) 2010-2019 Free Software Foundation, Inc. + Copyright (C) 2019 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 @@ -19,10 +19,8 @@ #include #include -ENTRY_TOCLESS(__fmaf) -/* float [f1] fmaf (float [f1] x, float [f2] y, float [f3] z); */ - fmadds fp1,fp1,fp2,fp3 - blr -END(__fmaf) - +float __fmaf (float x, float y, float z) +{ + return __builtin_fmaf (x, y, z); +} libm_alias_float (__fma, fma)