From patchwork Fri Jun 22 21:33:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tulio Magno Quites Machado Filho X-Patchwork-Id: 27995 X-Patchwork-Delegate: joseph@codesourcery.com Received: (qmail 106696 invoked by alias); 22 Jun 2018 21:33:47 -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 106562 invoked by uid 89); 22 Jun 2018 21:33:46 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-27.6 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_SHORT, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 spammy=auto-generated, H*Ad:U*joseph, H*r:sendmail, FUNC X-HELO: mx0a-001b2d01.pphosted.com From: Tulio Magno Quites Machado Filho To: libc-alpha@sourceware.org Cc: Joseph Myers Subject: [PATCH] m68k: Reorganize log1p and significand implementations Date: Fri, 22 Jun 2018 18:33:26 -0300 In-Reply-To: References: X-TM-AS-GCONF: 00 x-cbid: 18062221-0004-0000-0000-00001458F45C X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00009242; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000265; SDB=6.01050847; UDB=6.00538573; IPR=6.00829817; MB=3.00021812; MTD=3.00000008; XFM=3.00000015; UTC=2018-06-22 21:33:40 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18062221-0005-0000-0000-000087D5DDE8 Message-Id: <20180622213326.8533-1-tuliom@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2018-06-22_03:, , signatures=0 Commit 5e79e0292bfb03f40e43379fd92581ad8eae9cb8 broke m68k after s_significand.c became available in the build directory. All m68k implementations of log1p and significand were including s_significand.c and stopped working after the inclusion of the the auto-generated file. This patch reorganizes the implementation of log1p and significand for m680x0 in order to avoid hitting this problem. 2018-06-22 Tulio Magno Quites Machado Filho * sysdeps/m68k/m680x0/fpu/s_log1p.c: Set as the generic file for all log1p and significand functions on m680x0. * sysdeps/m68k/m680x0/fpu/s_log1pf.c: Include s_log1p.c instead of s_significand.c.. * sysdeps/m68k/m680x0/fpu/s_log1pl.c: Likewise. * sysdeps/m68k/m680x0/fpu/s_significandf.c: Likewise. * sysdeps/m68k/m680x0/fpu/s_significandl.c: Likewise. * sysdeps/m68k/m680x0/fpu/s_significand.c: Move all the code to s_log1p.c and include it.. Signed-off-by: Tulio Magno Quites Machado Filho --- sysdeps/m68k/m680x0/fpu/s_log1p.c | 38 ++++++++++++++++++++++++++++---- sysdeps/m68k/m680x0/fpu/s_log1pf.c | 5 ++--- sysdeps/m68k/m680x0/fpu/s_log1pl.c | 5 ++--- sysdeps/m68k/m680x0/fpu/s_significand.c | 18 ++------------- sysdeps/m68k/m680x0/fpu/s_significandf.c | 5 ++--- sysdeps/m68k/m680x0/fpu/s_significandl.c | 5 ++--- 6 files changed, 44 insertions(+), 32 deletions(-) diff --git a/sysdeps/m68k/m680x0/fpu/s_log1p.c b/sysdeps/m68k/m680x0/fpu/s_log1p.c index 7eb2529547..5da96c5834 100644 --- a/sysdeps/m68k/m680x0/fpu/s_log1p.c +++ b/sysdeps/m68k/m680x0/fpu/s_log1p.c @@ -1,4 +1,34 @@ -#define FUNC log1p -#undef weak_alias -#define weak_alias(a,b) -#include +/* Implement logp1 for m68k. + Copyright (C) 2018 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 + +#ifndef FUNC +#define FUNC log1p +#endif +#ifndef float_type +#define float_type double +#endif + +#define __CONCATX(a,b) __CONCAT(a,b) + +float_type +__CONCATX(__,FUNC) (float_type x) +{ + return __m81_u(__CONCATX(__,FUNC))(x); +} diff --git a/sysdeps/m68k/m680x0/fpu/s_log1pf.c b/sysdeps/m68k/m680x0/fpu/s_log1pf.c index 40f332ff36..1e408ffffe 100644 --- a/sysdeps/m68k/m680x0/fpu/s_log1pf.c +++ b/sysdeps/m68k/m680x0/fpu/s_log1pf.c @@ -1,4 +1,3 @@ #define FUNC log1pf -#undef weak_alias -#define weak_alias(a,b) -#include +#define float_type float +#include diff --git a/sysdeps/m68k/m680x0/fpu/s_log1pl.c b/sysdeps/m68k/m680x0/fpu/s_log1pl.c index e580bafbc5..ffe1d8893f 100644 --- a/sysdeps/m68k/m680x0/fpu/s_log1pl.c +++ b/sysdeps/m68k/m680x0/fpu/s_log1pl.c @@ -1,4 +1,3 @@ #define FUNC log1pl -#undef weak_alias -#define weak_alias(a,b) -#include +#define float_type long double +#include diff --git a/sysdeps/m68k/m680x0/fpu/s_significand.c b/sysdeps/m68k/m680x0/fpu/s_significand.c index bcc9a8a475..3259d4ee6a 100644 --- a/sysdeps/m68k/m680x0/fpu/s_significand.c +++ b/sysdeps/m68k/m680x0/fpu/s_significand.c @@ -16,20 +16,6 @@ License along with the GNU C Library. If not, see . */ -#include - -#ifndef FUNC #define FUNC significand -#endif -#ifndef float_type -#define float_type double -#endif - -#define __CONCATX(a,b) __CONCAT(a,b) - -float_type -__CONCATX(__,FUNC) (float_type x) -{ - return __m81_u(__CONCATX(__,FUNC))(x); -} -weak_alias (__CONCATX(__,FUNC), FUNC) +#include +weak_alias (__significand, significand) diff --git a/sysdeps/m68k/m680x0/fpu/s_significandf.c b/sysdeps/m68k/m680x0/fpu/s_significandf.c index bbaa64bb13..95da7cf969 100644 --- a/sysdeps/m68k/m680x0/fpu/s_significandf.c +++ b/sysdeps/m68k/m680x0/fpu/s_significandf.c @@ -1,5 +1,4 @@ -#ifndef FUNC #define FUNC significandf -#endif #define float_type float -#include +#include +weak_alias (__significandf, significandf) diff --git a/sysdeps/m68k/m680x0/fpu/s_significandl.c b/sysdeps/m68k/m680x0/fpu/s_significandl.c index f3496ee862..356b48d138 100644 --- a/sysdeps/m68k/m680x0/fpu/s_significandl.c +++ b/sysdeps/m68k/m680x0/fpu/s_significandl.c @@ -1,5 +1,4 @@ -#ifndef FUNC #define FUNC significandl -#endif #define float_type long double -#include +#include +weak_alias (__significandl, significandl)