Received: by 10.223.176.5 with SMTP id f5csp1283992wra; Wed, 31 Jan 2018 04:13:09 -0800 (PST) X-Google-Smtp-Source: AH8x2268LmQ1VgD7hgN9Cit2Fc1Z+0m17So+DEfwzq8pu/sXzPV3VqAuWPVsSKo1zGPTpEwOVAia X-Received: by 10.98.61.208 with SMTP id x77mr34166051pfj.2.1517400789638; Wed, 31 Jan 2018 04:13:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517400789; cv=none; d=google.com; s=arc-20160816; b=CnzlN1fd9C5I1c7g0hpDvK0IVpNXCAZb8fmdBAKYXG1r5ceIw0aEAG2iS8WEz7m+SE k5HwlSuGYavn8SxTwnGlj4uip/+3TTY/e+nvkSBwtkkIrb6lZAXbkvv0loKPp/W4s3FL 1P11OCoYJb9ct3DGWgnrT6nt45xewMvUAniWkXfUQslDx7jVRQhk1K0ihSVYKatUkq5D QO+Tn1BESMEf7iF7mL2IPLFlqrHEIzShOkDizPZjQ7QVMmlPGXXDgHQX18ylSnMTKL1B +21YE/GQYh+/D8nDeewpWzH1CknA5ZJgX1NieYjJE/+ydZ6b0KuBbN6IbusDn4nLVoeH EcCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=GVjw4Jev14N+Syj0qDUUMiZ3de1QvakV45tiwCp6Ero=; b=fTH4q11hhs/if27yERsmvVOjikD3Mc4TN97uzWN3T4n/ag45aNEzRoAI50hgStoZm0 0nVzorASa4E+BbmR9+AfTthxiCouGKZqna5Ge7v5xmRZQyuo1fEqviVFWR9JewJ/O901 8MqGikr73MmINz849G+Fn6cq/cEKx995vlLJA26jlYi0NaZOt/EdSlrHurPZO6ztMCvK FZglheSfByVdA0+e7awPAYwarnxmgrJNrVrDFVm5dHhapz3333tGFcrpbQEatEDz1v+g TPRn2BON6q7IrX75IhS/IPZvUyjdV7l3wh1KavYCgykr9q8/OHsCW174fFZ0Kv5MJ0Gt kSvg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a1-v6si6143724plt.588.2018.01.31.04.12.54; Wed, 31 Jan 2018 04:13:09 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753553AbeAaMAZ (ORCPT + 99 others); Wed, 31 Jan 2018 07:00:25 -0500 Received: from 9pmail.ess.barracuda.com ([64.235.150.224]:40323 "EHLO 9pmail.ess.barracuda.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752638AbeAaMAY (ORCPT ); Wed, 31 Jan 2018 07:00:24 -0500 Received: from MIPSMAIL01.mipstec.com (mailrelay.mips.com [12.201.5.28]) by mx30.ess.sfj.cudaops.com (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NO); Wed, 31 Jan 2018 12:00:18 +0000 Received: from [10.150.130.83] (10.150.130.83) by MIPSMAIL01.mipstec.com (10.20.43.31) with Microsoft SMTP Server (TLS) id 14.3.361.1; Wed, 31 Jan 2018 03:55:35 -0800 Subject: Re: [PATCH v2 2/2] MIPS: use generic GCC library routines from lib/ To: Antony Pavlov , CC: James Hogan , Ralf Baechle , , Palmer Dabbelt References: <20180130224202.7682-1-antonynpavlov@gmail.com> <20180130224202.7682-3-antonynpavlov@gmail.com> From: Matt Redfearn Message-ID: <89def93a-c9a4-1c79-271a-a53fe2cd02b6@mips.com> Date: Wed, 31 Jan 2018 11:55:33 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <20180130224202.7682-3-antonynpavlov@gmail.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.150.130.83] X-BESS-ID: 1517400016-637140-31742-118466-9 X-BESS-VER: 2018.1-r1801290438 X-BESS-Apparent-Source-IP: 12.201.5.28 X-BESS-Outbound-Spam-Score: 0.60 X-BESS-Outbound-Spam-Report: Code version 3.2, rules version 3.2.2.189548 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------- 0.00 BSF_BESS_OUTBOUND META: BESS Outbound 0.60 MARKETING_SUBJECT HEADER: Subject contains popular marketing words X-BESS-Outbound-Spam-Status: SCORE=0.60 using account:ESS59374 scores of KILL_LEVEL=7.0 tests=BSF_BESS_OUTBOUND, MARKETING_SUBJECT X-BESS-BRTS-Status: 1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On 30/01/18 22:42, Antony Pavlov wrote: > The commit b35cd9884fa5 ("lib: Add shared copies of > some GCC library routines") makes it possible > to share generic GCC library routines by several > architectures. > > This commit removes several generic GCC library > routines from arch/mips/lib/ in favour of similar > routines from lib/. > > Signed-off-by: Antony Pavlov > Cc: Palmer Dabbelt > Cc: Matt Redfearn > Cc: James Hogan > Cc: Ralf Baechle > Cc: linux-mips@linux-mips.org > Cc: linux-kernel@vger.kernel.org > --- > arch/mips/Kconfig | 5 +++++ > arch/mips/lib/Makefile | 2 +- > arch/mips/lib/ashldi3.c | 30 ------------------------------ > arch/mips/lib/ashrdi3.c | 32 -------------------------------- > arch/mips/lib/cmpdi2.c | 28 ---------------------------- > arch/mips/lib/lshrdi3.c | 30 ------------------------------ > arch/mips/lib/ucmpdi2.c | 22 ---------------------- > 7 files changed, 6 insertions(+), 143 deletions(-) > > diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig > index 350a990fc719..6f786d576dd2 100644 > --- a/arch/mips/Kconfig > +++ b/arch/mips/Kconfig > @@ -73,6 +73,11 @@ config MIPS > select RTC_LIB if !MACH_LOONGSON64 > select SYSCTL_EXCEPTION_TRACE > select VIRT_TO_BUS > + select GENERIC_ASHLDI3 > + select GENERIC_ASHRDI3 > + select GENERIC_CMPDI2 > + select GENERIC_LSHRDI3 > + select GENERIC_UCMPDI2 Please keep the alphabetical order. With that fixed, Reviewed-by: Matt Redfearn Thanks, Matt > > menu "Machine selection" > > diff --git a/arch/mips/lib/Makefile b/arch/mips/lib/Makefile > index 78c2affeabf8..195ab4cb0840 100644 > --- a/arch/mips/lib/Makefile > +++ b/arch/mips/lib/Makefile > @@ -16,4 +16,4 @@ obj-$(CONFIG_CPU_R3000) += r3k_dump_tlb.o > obj-$(CONFIG_CPU_TX39XX) += r3k_dump_tlb.o > > # libgcc-style stuff needed in the kernel > -obj-y += ashldi3.o ashrdi3.o bswapsi.o bswapdi.o cmpdi2.o lshrdi3.o ucmpdi2.o > +obj-y += bswapsi.o bswapdi.o > diff --git a/arch/mips/lib/ashldi3.c b/arch/mips/lib/ashldi3.c > deleted file mode 100644 > index 24cd6903e797..000000000000 > --- a/arch/mips/lib/ashldi3.c > +++ /dev/null > @@ -1,30 +0,0 @@ > -// SPDX-License-Identifier: GPL-2.0 > -#include > - > -#include "libgcc.h" > - > -long long notrace __ashldi3(long long u, word_type b) > -{ > - DWunion uu, w; > - word_type bm; > - > - if (b == 0) > - return u; > - > - uu.ll = u; > - bm = 32 - b; > - > - if (bm <= 0) { > - w.s.low = 0; > - w.s.high = (unsigned int) uu.s.low << -bm; > - } else { > - const unsigned int carries = (unsigned int) uu.s.low >> bm; > - > - w.s.low = (unsigned int) uu.s.low << b; > - w.s.high = ((unsigned int) uu.s.high << b) | carries; > - } > - > - return w.ll; > -} > - > -EXPORT_SYMBOL(__ashldi3); > diff --git a/arch/mips/lib/ashrdi3.c b/arch/mips/lib/ashrdi3.c > deleted file mode 100644 > index 23f5295af51e..000000000000 > --- a/arch/mips/lib/ashrdi3.c > +++ /dev/null > @@ -1,32 +0,0 @@ > -// SPDX-License-Identifier: GPL-2.0 > -#include > - > -#include "libgcc.h" > - > -long long notrace __ashrdi3(long long u, word_type b) > -{ > - DWunion uu, w; > - word_type bm; > - > - if (b == 0) > - return u; > - > - uu.ll = u; > - bm = 32 - b; > - > - if (bm <= 0) { > - /* w.s.high = 1..1 or 0..0 */ > - w.s.high = > - uu.s.high >> 31; > - w.s.low = uu.s.high >> -bm; > - } else { > - const unsigned int carries = (unsigned int) uu.s.high << bm; > - > - w.s.high = uu.s.high >> b; > - w.s.low = ((unsigned int) uu.s.low >> b) | carries; > - } > - > - return w.ll; > -} > - > -EXPORT_SYMBOL(__ashrdi3); > diff --git a/arch/mips/lib/cmpdi2.c b/arch/mips/lib/cmpdi2.c > deleted file mode 100644 > index 93cfc785927d..000000000000 > --- a/arch/mips/lib/cmpdi2.c > +++ /dev/null > @@ -1,28 +0,0 @@ > -// SPDX-License-Identifier: GPL-2.0 > -#include > - > -#include "libgcc.h" > - > -word_type notrace __cmpdi2(long long a, long long b) > -{ > - const DWunion au = { > - .ll = a > - }; > - const DWunion bu = { > - .ll = b > - }; > - > - if (au.s.high < bu.s.high) > - return 0; > - else if (au.s.high > bu.s.high) > - return 2; > - > - if ((unsigned int) au.s.low < (unsigned int) bu.s.low) > - return 0; > - else if ((unsigned int) au.s.low > (unsigned int) bu.s.low) > - return 2; > - > - return 1; > -} > - > -EXPORT_SYMBOL(__cmpdi2); > diff --git a/arch/mips/lib/lshrdi3.c b/arch/mips/lib/lshrdi3.c > deleted file mode 100644 > index 914b971aca3b..000000000000 > --- a/arch/mips/lib/lshrdi3.c > +++ /dev/null > @@ -1,30 +0,0 @@ > -// SPDX-License-Identifier: GPL-2.0 > -#include > - > -#include "libgcc.h" > - > -long long notrace __lshrdi3(long long u, word_type b) > -{ > - DWunion uu, w; > - word_type bm; > - > - if (b == 0) > - return u; > - > - uu.ll = u; > - bm = 32 - b; > - > - if (bm <= 0) { > - w.s.high = 0; > - w.s.low = (unsigned int) uu.s.high >> -bm; > - } else { > - const unsigned int carries = (unsigned int) uu.s.high << bm; > - > - w.s.high = (unsigned int) uu.s.high >> b; > - w.s.low = ((unsigned int) uu.s.low >> b) | carries; > - } > - > - return w.ll; > -} > - > -EXPORT_SYMBOL(__lshrdi3); > diff --git a/arch/mips/lib/ucmpdi2.c b/arch/mips/lib/ucmpdi2.c > deleted file mode 100644 > index c31c78ca4175..000000000000 > --- a/arch/mips/lib/ucmpdi2.c > +++ /dev/null > @@ -1,22 +0,0 @@ > -// SPDX-License-Identifier: GPL-2.0 > -#include > - > -#include "libgcc.h" > - > -word_type notrace __ucmpdi2(unsigned long long a, unsigned long long b) > -{ > - const DWunion au = {.ll = a}; > - const DWunion bu = {.ll = b}; > - > - if ((unsigned int) au.s.high < (unsigned int) bu.s.high) > - return 0; > - else if ((unsigned int) au.s.high > (unsigned int) bu.s.high) > - return 2; > - if ((unsigned int) au.s.low < (unsigned int) bu.s.low) > - return 0; > - else if ((unsigned int) au.s.low > (unsigned int) bu.s.low) > - return 2; > - return 1; > -} > - > -EXPORT_SYMBOL(__ucmpdi2); >