2018-01-31 15:34:54

by Antony Pavlov

[permalink] [raw]
Subject: [PATCH v3 0/2] MIPS: use generic GCC library routines from lib/

Changes since v2 patch series (https://www.linux-mips.org/archives/linux-mips/2018-01/msg00567.html):

* sort the CONFIG_GENERIC_* options in arch/mips/Kconfig alphabetically (v2).

Changes since v1 patch series (https://www.linux-mips.org/archives/linux-mips/2018-01/msg00394.html):

* sort the CONFIG_* options in arch/mips/Kconfig alphabetically;
* add notrace to lib/ucmpdi2.c.

Antony Pavlov (1):
MIPS: use generic GCC library routines from lib/

Palmer Dabbelt (1):
Add notrace to lib/ucmpdi2.c

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 ----------------------
lib/ucmpdi2.c | 2 +-
8 files changed, 7 insertions(+), 144 deletions(-)
delete mode 100644 arch/mips/lib/ashldi3.c
delete mode 100644 arch/mips/lib/ashrdi3.c
delete mode 100644 arch/mips/lib/cmpdi2.c
delete mode 100644 arch/mips/lib/lshrdi3.c
delete mode 100644 arch/mips/lib/ucmpdi2.c

--
2.15.1



2018-01-31 15:35:23

by Antony Pavlov

[permalink] [raw]
Subject: [PATCH v3 1/2] Add notrace to lib/ucmpdi2.c

From: Palmer Dabbelt <[email protected]>

As part of the MIPS conversion to use the generic GCC library routines,
Matt Redfearn discovered that I'd missed a notrace on __ucmpdi2(). This
patch rectifies the problem.

CC: Matt Redfearn <[email protected]>
CC: Antony Pavlov <[email protected]>
Signed-off-by: Palmer Dabbelt <[email protected]>
Reviewed-by: Matt Redfearn <[email protected]>
---
lib/ucmpdi2.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/ucmpdi2.c b/lib/ucmpdi2.c
index 25ca2d4c1e19..597998169a96 100644
--- a/lib/ucmpdi2.c
+++ b/lib/ucmpdi2.c
@@ -17,7 +17,7 @@
#include <linux/module.h>
#include <linux/libgcc.h>

-word_type __ucmpdi2(unsigned long long a, unsigned long long b)
+word_type notrace __ucmpdi2(unsigned long long a, unsigned long long b)
{
const DWunion au = {.ll = a};
const DWunion bu = {.ll = b};
--
2.15.1


2018-01-31 15:36:17

by Antony Pavlov

[permalink] [raw]
Subject: [PATCH v3 2/2] MIPS: use generic GCC library routines from lib/

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 <[email protected]>
Cc: Palmer Dabbelt <[email protected]>
Cc: Matt Redfearn <[email protected]>
Cc: James Hogan <[email protected]>
Cc: Ralf Baechle <[email protected]>
Cc: [email protected]
Cc: [email protected]
---
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..b63a5422d485 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -18,16 +18,21 @@ config MIPS
select BUILDTIME_EXTABLE_SORT
select CLONE_BACKWARDS
select CPU_PM if CPU_IDLE
+ select GENERIC_ASHLDI3
+ select GENERIC_ASHRDI3
select GENERIC_ATOMIC64 if !64BIT
select GENERIC_CLOCKEVENTS
select GENERIC_CMOS_UPDATE
+ select GENERIC_CMPDI2
select GENERIC_CPU_AUTOPROBE
select GENERIC_IRQ_PROBE
select GENERIC_IRQ_SHOW
+ select GENERIC_LSHRDI3
select GENERIC_PCI_IOMAP
select GENERIC_SCHED_CLOCK if !CAVIUM_OCTEON_SOC
select GENERIC_SMP_IDLE_THREAD
select GENERIC_TIME_VSYSCALL
+ select GENERIC_UCMPDI2
select HANDLE_DOMAIN_IRQ
select HAVE_ARCH_JUMP_LABEL
select HAVE_ARCH_KGDB
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 <linux/export.h>
-
-#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 <linux/export.h>
-
-#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 <linux/export.h>
-
-#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 <linux/export.h>
-
-#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 <linux/export.h>
-
-#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);
--
2.15.1


2018-01-31 16:47:47

by Matt Redfearn

[permalink] [raw]
Subject: Re: [PATCH v3 2/2] MIPS: use generic GCC library routines from lib/

Hi,

On 31/01/18 15:33, 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 <[email protected]>
> Cc: Palmer Dabbelt <[email protected]>
> Cc: Matt Redfearn <[email protected]>
> Cc: James Hogan <[email protected]>
> Cc: Ralf Baechle <[email protected]>
> Cc: [email protected]
> Cc: [email protected]
> ---
> 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..b63a5422d485 100644
> --- a/arch/mips/Kconfig
> +++ b/arch/mips/Kconfig
> @@ -18,16 +18,21 @@ config MIPS
> select BUILDTIME_EXTABLE_SORT
> select CLONE_BACKWARDS
> select CPU_PM if CPU_IDLE
> + select GENERIC_ASHLDI3
> + select GENERIC_ASHRDI3
> select GENERIC_ATOMIC64 if !64BIT
> select GENERIC_CLOCKEVENTS
> select GENERIC_CMOS_UPDATE
> + select GENERIC_CMPDI2
> select GENERIC_CPU_AUTOPROBE
> select GENERIC_IRQ_PROBE
> select GENERIC_IRQ_SHOW
> + select GENERIC_LSHRDI3
> select GENERIC_PCI_IOMAP
> select GENERIC_SCHED_CLOCK if !CAVIUM_OCTEON_SOC
> select GENERIC_SMP_IDLE_THREAD
> select GENERIC_TIME_VSYSCALL
> + select GENERIC_UCMPDI2
> select HANDLE_DOMAIN_IRQ
> select HAVE_ARCH_JUMP_LABEL
> select HAVE_ARCH_KGDB

OK, thanks for changing this. But to be honest, it does look pretty
messy like this. I feel like the CONFIG names should be something a
little more descriptive, such as CONFIG_GENERIC_LIB_*, putting them in a
namespace that would at least group them all together. Right now, AFAIK
there's only RISC-V using these so it shouldn't be too painful to change
them. What do you think Antony / Palmer?

Thanks,
Matt


> 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 <linux/export.h>
> -
> -#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 <linux/export.h>
> -
> -#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 <linux/export.h>
> -
> -#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 <linux/export.h>
> -
> -#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 <linux/export.h>
> -
> -#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);
>

2018-02-08 17:36:24

by Palmer Dabbelt

[permalink] [raw]
Subject: Re: [PATCH v3 2/2] MIPS: use generic GCC library routines from lib/

On Wed, 31 Jan 2018 08:07:51 PST (-0800), [email protected] wrote:
> Hi,
>
> On 31/01/18 15:33, 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 <[email protected]>
>> Cc: Palmer Dabbelt <[email protected]>
>> Cc: Matt Redfearn <[email protected]>
>> Cc: James Hogan <[email protected]>
>> Cc: Ralf Baechle <[email protected]>
>> Cc: [email protected]
>> Cc: [email protected]
>> ---
>> 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..b63a5422d485 100644
>> --- a/arch/mips/Kconfig
>> +++ b/arch/mips/Kconfig
>> @@ -18,16 +18,21 @@ config MIPS
>> select BUILDTIME_EXTABLE_SORT
>> select CLONE_BACKWARDS
>> select CPU_PM if CPU_IDLE
>> + select GENERIC_ASHLDI3
>> + select GENERIC_ASHRDI3
>> select GENERIC_ATOMIC64 if !64BIT
>> select GENERIC_CLOCKEVENTS
>> select GENERIC_CMOS_UPDATE
>> + select GENERIC_CMPDI2
>> select GENERIC_CPU_AUTOPROBE
>> select GENERIC_IRQ_PROBE
>> select GENERIC_IRQ_SHOW
>> + select GENERIC_LSHRDI3
>> select GENERIC_PCI_IOMAP
>> select GENERIC_SCHED_CLOCK if !CAVIUM_OCTEON_SOC
>> select GENERIC_SMP_IDLE_THREAD
>> select GENERIC_TIME_VSYSCALL
>> + select GENERIC_UCMPDI2
>> select HANDLE_DOMAIN_IRQ
>> select HAVE_ARCH_JUMP_LABEL
>> select HAVE_ARCH_KGDB
>
> OK, thanks for changing this. But to be honest, it does look pretty
> messy like this. I feel like the CONFIG names should be something a
> little more descriptive, such as CONFIG_GENERIC_LIB_*, putting them in a
> namespace that would at least group them all together. Right now, AFAIK
> there's only RISC-V using these so it shouldn't be too painful to change
> them. What do you think Antony / Palmer?

That looks good to me. It's a bit odd that they aren't all together.

>
> Thanks,
> Matt
>
>
>> 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 <linux/export.h>
>> -
>> -#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 <linux/export.h>
>> -
>> -#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 <linux/export.h>
>> -
>> -#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 <linux/export.h>
>> -
>> -#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 <linux/export.h>
>> -
>> -#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);
>>

2018-02-09 13:30:15

by Matt Redfearn

[permalink] [raw]
Subject: [PATCH] lib: Rename compiler intrinsic selects to GENERIC_LIB_*

When these are included into arch Kconfig files, maintaining
alphabetical ordering of the selects means these get split up. To allow
for keeping things tidier and alphabetical, rename the selects to
GENERIC_LIB_*

Signed-off-by: Matt Redfearn <[email protected]>
---
arch/riscv/Kconfig | 6 +++---
lib/Kconfig | 12 ++++++------
lib/Makefile | 12 ++++++------
3 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig
index 2c6adf12713a..5f1e2188d029 100644
--- a/arch/riscv/Kconfig
+++ b/arch/riscv/Kconfig
@@ -99,9 +99,9 @@ config ARCH_RV32I
bool "RV32I"
select CPU_SUPPORTS_32BIT_KERNEL
select 32BIT
- select GENERIC_ASHLDI3
- select GENERIC_ASHRDI3
- select GENERIC_LSHRDI3
+ select GENERIC_LIB_ASHLDI3
+ select GENERIC_LIB_ASHRDI3
+ select GENERIC_LIB_LSHRDI3

config ARCH_RV64I
bool "RV64I"
diff --git a/lib/Kconfig b/lib/Kconfig
index c5e84fbcb30b..946d0890aad6 100644
--- a/lib/Kconfig
+++ b/lib/Kconfig
@@ -584,20 +584,20 @@ config STRING_SELFTEST

endmenu

-config GENERIC_ASHLDI3
+config GENERIC_LIB_ASHLDI3
bool

-config GENERIC_ASHRDI3
+config GENERIC_LIB_ASHRDI3
bool

-config GENERIC_LSHRDI3
+config GENERIC_LIB_LSHRDI3
bool

-config GENERIC_MULDI3
+config GENERIC_LIB_MULDI3
bool

-config GENERIC_CMPDI2
+config GENERIC_LIB_CMPDI2
bool

-config GENERIC_UCMPDI2
+config GENERIC_LIB_UCMPDI2
bool
diff --git a/lib/Makefile b/lib/Makefile
index d11c48ec8ffd..7e1ef77e86a3 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -252,9 +252,9 @@ obj-$(CONFIG_SBITMAP) += sbitmap.o
obj-$(CONFIG_PARMAN) += parman.o

# GCC library routines
-obj-$(CONFIG_GENERIC_ASHLDI3) += ashldi3.o
-obj-$(CONFIG_GENERIC_ASHRDI3) += ashrdi3.o
-obj-$(CONFIG_GENERIC_LSHRDI3) += lshrdi3.o
-obj-$(CONFIG_GENERIC_MULDI3) += muldi3.o
-obj-$(CONFIG_GENERIC_CMPDI2) += cmpdi2.o
-obj-$(CONFIG_GENERIC_UCMPDI2) += ucmpdi2.o
+obj-$(CONFIG_GENERIC_LIB_ASHLDI3) += ashldi3.o
+obj-$(CONFIG_GENERIC_LIB_ASHRDI3) += ashrdi3.o
+obj-$(CONFIG_GENERIC_LIB_LSHRDI3) += lshrdi3.o
+obj-$(CONFIG_GENERIC_LIB_MULDI3) += muldi3.o
+obj-$(CONFIG_GENERIC_LIB_CMPDI2) += cmpdi2.o
+obj-$(CONFIG_GENERIC_LIB_UCMPDI2) += ucmpdi2.o
--
2.7.4


2018-02-09 13:55:14

by Andy Shevchenko

[permalink] [raw]
Subject: Re: [PATCH] lib: Rename compiler intrinsic selects to GENERIC_LIB_*

On Fri, Feb 9, 2018 at 3:22 PM, Matt Redfearn <[email protected]> wrote:
> When these are included into arch Kconfig files, maintaining
> alphabetical ordering of the selects means these get split up. To allow
> for keeping things tidier and alphabetical, rename the selects to
> GENERIC_LIB_*
>

I don't remember who suggested that, if it wasn't you, please add
Suggested-by tag with appropriate name.

> Signed-off-by: Matt Redfearn <[email protected]>
> ---
> arch/riscv/Kconfig | 6 +++---
> lib/Kconfig | 12 ++++++------
> lib/Makefile | 12 ++++++------
> 3 files changed, 15 insertions(+), 15 deletions(-)
>
> diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig
> index 2c6adf12713a..5f1e2188d029 100644
> --- a/arch/riscv/Kconfig
> +++ b/arch/riscv/Kconfig
> @@ -99,9 +99,9 @@ config ARCH_RV32I
> bool "RV32I"
> select CPU_SUPPORTS_32BIT_KERNEL
> select 32BIT
> - select GENERIC_ASHLDI3
> - select GENERIC_ASHRDI3
> - select GENERIC_LSHRDI3
> + select GENERIC_LIB_ASHLDI3
> + select GENERIC_LIB_ASHRDI3
> + select GENERIC_LIB_LSHRDI3
>
> config ARCH_RV64I
> bool "RV64I"
> diff --git a/lib/Kconfig b/lib/Kconfig
> index c5e84fbcb30b..946d0890aad6 100644
> --- a/lib/Kconfig
> +++ b/lib/Kconfig
> @@ -584,20 +584,20 @@ config STRING_SELFTEST
>
> endmenu
>
> -config GENERIC_ASHLDI3
> +config GENERIC_LIB_ASHLDI3
> bool
>
> -config GENERIC_ASHRDI3
> +config GENERIC_LIB_ASHRDI3
> bool
>
> -config GENERIC_LSHRDI3
> +config GENERIC_LIB_LSHRDI3
> bool
>
> -config GENERIC_MULDI3
> +config GENERIC_LIB_MULDI3
> bool
>
> -config GENERIC_CMPDI2
> +config GENERIC_LIB_CMPDI2
> bool
>
> -config GENERIC_UCMPDI2
> +config GENERIC_LIB_UCMPDI2
> bool
> diff --git a/lib/Makefile b/lib/Makefile
> index d11c48ec8ffd..7e1ef77e86a3 100644
> --- a/lib/Makefile
> +++ b/lib/Makefile
> @@ -252,9 +252,9 @@ obj-$(CONFIG_SBITMAP) += sbitmap.o
> obj-$(CONFIG_PARMAN) += parman.o
>
> # GCC library routines
> -obj-$(CONFIG_GENERIC_ASHLDI3) += ashldi3.o
> -obj-$(CONFIG_GENERIC_ASHRDI3) += ashrdi3.o
> -obj-$(CONFIG_GENERIC_LSHRDI3) += lshrdi3.o
> -obj-$(CONFIG_GENERIC_MULDI3) += muldi3.o
> -obj-$(CONFIG_GENERIC_CMPDI2) += cmpdi2.o
> -obj-$(CONFIG_GENERIC_UCMPDI2) += ucmpdi2.o
> +obj-$(CONFIG_GENERIC_LIB_ASHLDI3) += ashldi3.o
> +obj-$(CONFIG_GENERIC_LIB_ASHRDI3) += ashrdi3.o
> +obj-$(CONFIG_GENERIC_LIB_LSHRDI3) += lshrdi3.o
> +obj-$(CONFIG_GENERIC_LIB_MULDI3) += muldi3.o
> +obj-$(CONFIG_GENERIC_LIB_CMPDI2) += cmpdi2.o
> +obj-$(CONFIG_GENERIC_LIB_UCMPDI2) += ucmpdi2.o
> --
> 2.7.4
>



--
With Best Regards,
Andy Shevchenko

2018-02-09 14:54:56

by Matt Redfearn

[permalink] [raw]
Subject: Re: [PATCH] lib: Rename compiler intrinsic selects to GENERIC_LIB_*

Hi Andy,

On 09/02/18 13:45, Andy Shevchenko wrote:
> On Fri, Feb 9, 2018 at 3:22 PM, Matt Redfearn <[email protected]> wrote:
>> When these are included into arch Kconfig files, maintaining
>> alphabetical ordering of the selects means these get split up. To allow
>> for keeping things tidier and alphabetical, rename the selects to
>> GENERIC_LIB_*
>>
>
> I don't remember who suggested that, if it wasn't you, please add
> Suggested-by tag with appropriate name.

It was me that suggested the rename, before we ack replacing MIPS'
compiler intrinsics with these generic ones.

Thanks,
Matt


>
>> Signed-off-by: Matt Redfearn <[email protected]>
>> ---
>> arch/riscv/Kconfig | 6 +++---
>> lib/Kconfig | 12 ++++++------
>> lib/Makefile | 12 ++++++------
>> 3 files changed, 15 insertions(+), 15 deletions(-)
>>
>> diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig
>> index 2c6adf12713a..5f1e2188d029 100644
>> --- a/arch/riscv/Kconfig
>> +++ b/arch/riscv/Kconfig
>> @@ -99,9 +99,9 @@ config ARCH_RV32I
>> bool "RV32I"
>> select CPU_SUPPORTS_32BIT_KERNEL
>> select 32BIT
>> - select GENERIC_ASHLDI3
>> - select GENERIC_ASHRDI3
>> - select GENERIC_LSHRDI3
>> + select GENERIC_LIB_ASHLDI3
>> + select GENERIC_LIB_ASHRDI3
>> + select GENERIC_LIB_LSHRDI3
>>
>> config ARCH_RV64I
>> bool "RV64I"
>> diff --git a/lib/Kconfig b/lib/Kconfig
>> index c5e84fbcb30b..946d0890aad6 100644
>> --- a/lib/Kconfig
>> +++ b/lib/Kconfig
>> @@ -584,20 +584,20 @@ config STRING_SELFTEST
>>
>> endmenu
>>
>> -config GENERIC_ASHLDI3
>> +config GENERIC_LIB_ASHLDI3
>> bool
>>
>> -config GENERIC_ASHRDI3
>> +config GENERIC_LIB_ASHRDI3
>> bool
>>
>> -config GENERIC_LSHRDI3
>> +config GENERIC_LIB_LSHRDI3
>> bool
>>
>> -config GENERIC_MULDI3
>> +config GENERIC_LIB_MULDI3
>> bool
>>
>> -config GENERIC_CMPDI2
>> +config GENERIC_LIB_CMPDI2
>> bool
>>
>> -config GENERIC_UCMPDI2
>> +config GENERIC_LIB_UCMPDI2
>> bool
>> diff --git a/lib/Makefile b/lib/Makefile
>> index d11c48ec8ffd..7e1ef77e86a3 100644
>> --- a/lib/Makefile
>> +++ b/lib/Makefile
>> @@ -252,9 +252,9 @@ obj-$(CONFIG_SBITMAP) += sbitmap.o
>> obj-$(CONFIG_PARMAN) += parman.o
>>
>> # GCC library routines
>> -obj-$(CONFIG_GENERIC_ASHLDI3) += ashldi3.o
>> -obj-$(CONFIG_GENERIC_ASHRDI3) += ashrdi3.o
>> -obj-$(CONFIG_GENERIC_LSHRDI3) += lshrdi3.o
>> -obj-$(CONFIG_GENERIC_MULDI3) += muldi3.o
>> -obj-$(CONFIG_GENERIC_CMPDI2) += cmpdi2.o
>> -obj-$(CONFIG_GENERIC_UCMPDI2) += ucmpdi2.o
>> +obj-$(CONFIG_GENERIC_LIB_ASHLDI3) += ashldi3.o
>> +obj-$(CONFIG_GENERIC_LIB_ASHRDI3) += ashrdi3.o
>> +obj-$(CONFIG_GENERIC_LIB_LSHRDI3) += lshrdi3.o
>> +obj-$(CONFIG_GENERIC_LIB_MULDI3) += muldi3.o
>> +obj-$(CONFIG_GENERIC_LIB_CMPDI2) += cmpdi2.o
>> +obj-$(CONFIG_GENERIC_LIB_UCMPDI2) += ucmpdi2.o
>> --
>> 2.7.4
>>
>
>
>

2018-02-13 21:49:38

by Palmer Dabbelt

[permalink] [raw]
Subject: Re: [PATCH] lib: Rename compiler intrinsic selects to GENERIC_LIB_*

On Fri, 09 Feb 2018 05:22:52 PST (-0800), [email protected] wrote:
> When these are included into arch Kconfig files, maintaining
> alphabetical ordering of the selects means these get split up. To allow
> for keeping things tidier and alphabetical, rename the selects to
> GENERIC_LIB_*
>
> Signed-off-by: Matt Redfearn <[email protected]>

Thanks! Do you want me to take this in my tree?

Reviewed-by: Palmer Dabbelt <[email protected]>

> ---
> arch/riscv/Kconfig | 6 +++---
> lib/Kconfig | 12 ++++++------
> lib/Makefile | 12 ++++++------
> 3 files changed, 15 insertions(+), 15 deletions(-)
>
> diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig
> index 2c6adf12713a..5f1e2188d029 100644
> --- a/arch/riscv/Kconfig
> +++ b/arch/riscv/Kconfig
> @@ -99,9 +99,9 @@ config ARCH_RV32I
> bool "RV32I"
> select CPU_SUPPORTS_32BIT_KERNEL
> select 32BIT
> - select GENERIC_ASHLDI3
> - select GENERIC_ASHRDI3
> - select GENERIC_LSHRDI3
> + select GENERIC_LIB_ASHLDI3
> + select GENERIC_LIB_ASHRDI3
> + select GENERIC_LIB_LSHRDI3
>
> config ARCH_RV64I
> bool "RV64I"
> diff --git a/lib/Kconfig b/lib/Kconfig
> index c5e84fbcb30b..946d0890aad6 100644
> --- a/lib/Kconfig
> +++ b/lib/Kconfig
> @@ -584,20 +584,20 @@ config STRING_SELFTEST
>
> endmenu
>
> -config GENERIC_ASHLDI3
> +config GENERIC_LIB_ASHLDI3
> bool
>
> -config GENERIC_ASHRDI3
> +config GENERIC_LIB_ASHRDI3
> bool
>
> -config GENERIC_LSHRDI3
> +config GENERIC_LIB_LSHRDI3
> bool
>
> -config GENERIC_MULDI3
> +config GENERIC_LIB_MULDI3
> bool
>
> -config GENERIC_CMPDI2
> +config GENERIC_LIB_CMPDI2
> bool
>
> -config GENERIC_UCMPDI2
> +config GENERIC_LIB_UCMPDI2
> bool
> diff --git a/lib/Makefile b/lib/Makefile
> index d11c48ec8ffd..7e1ef77e86a3 100644
> --- a/lib/Makefile
> +++ b/lib/Makefile
> @@ -252,9 +252,9 @@ obj-$(CONFIG_SBITMAP) += sbitmap.o
> obj-$(CONFIG_PARMAN) += parman.o
>
> # GCC library routines
> -obj-$(CONFIG_GENERIC_ASHLDI3) += ashldi3.o
> -obj-$(CONFIG_GENERIC_ASHRDI3) += ashrdi3.o
> -obj-$(CONFIG_GENERIC_LSHRDI3) += lshrdi3.o
> -obj-$(CONFIG_GENERIC_MULDI3) += muldi3.o
> -obj-$(CONFIG_GENERIC_CMPDI2) += cmpdi2.o
> -obj-$(CONFIG_GENERIC_UCMPDI2) += ucmpdi2.o
> +obj-$(CONFIG_GENERIC_LIB_ASHLDI3) += ashldi3.o
> +obj-$(CONFIG_GENERIC_LIB_ASHRDI3) += ashrdi3.o
> +obj-$(CONFIG_GENERIC_LIB_LSHRDI3) += lshrdi3.o
> +obj-$(CONFIG_GENERIC_LIB_MULDI3) += muldi3.o
> +obj-$(CONFIG_GENERIC_LIB_CMPDI2) += cmpdi2.o
> +obj-$(CONFIG_GENERIC_LIB_UCMPDI2) += ucmpdi2.o

2018-02-13 22:51:17

by James Hogan

[permalink] [raw]
Subject: Re: [PATCH] lib: Rename compiler intrinsic selects to GENERIC_LIB_*

On Tue, Feb 13, 2018 at 01:48:18PM -0800, Palmer Dabbelt wrote:
> On Fri, 09 Feb 2018 05:22:52 PST (-0800), [email protected] wrote:
> > When these are included into arch Kconfig files, maintaining
> > alphabetical ordering of the selects means these get split up. To allow
> > for keeping things tidier and alphabetical, rename the selects to
> > GENERIC_LIB_*
> >
> > Signed-off-by: Matt Redfearn <[email protected]>
>
> Thanks! Do you want me to take this in my tree?
>
> Reviewed-by: Palmer Dabbelt <[email protected]>

Since a new version of the "MIPS: use generic GCC library routines from
lib/" series would depend on it, and it makes sense for that series to
go via the MIPS tree, I think it would be simpler for this patch to also
be taken (with your ack) via the MIPS tree. Is that okay?

Thanks
James

>
> > ---
> > arch/riscv/Kconfig | 6 +++---
> > lib/Kconfig | 12 ++++++------
> > lib/Makefile | 12 ++++++------
> > 3 files changed, 15 insertions(+), 15 deletions(-)
> >
> > diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig
> > index 2c6adf12713a..5f1e2188d029 100644
> > --- a/arch/riscv/Kconfig
> > +++ b/arch/riscv/Kconfig
> > @@ -99,9 +99,9 @@ config ARCH_RV32I
> > bool "RV32I"
> > select CPU_SUPPORTS_32BIT_KERNEL
> > select 32BIT
> > - select GENERIC_ASHLDI3
> > - select GENERIC_ASHRDI3
> > - select GENERIC_LSHRDI3
> > + select GENERIC_LIB_ASHLDI3
> > + select GENERIC_LIB_ASHRDI3
> > + select GENERIC_LIB_LSHRDI3
> >
> > config ARCH_RV64I
> > bool "RV64I"
> > diff --git a/lib/Kconfig b/lib/Kconfig
> > index c5e84fbcb30b..946d0890aad6 100644
> > --- a/lib/Kconfig
> > +++ b/lib/Kconfig
> > @@ -584,20 +584,20 @@ config STRING_SELFTEST
> >
> > endmenu
> >
> > -config GENERIC_ASHLDI3
> > +config GENERIC_LIB_ASHLDI3
> > bool
> >
> > -config GENERIC_ASHRDI3
> > +config GENERIC_LIB_ASHRDI3
> > bool
> >
> > -config GENERIC_LSHRDI3
> > +config GENERIC_LIB_LSHRDI3
> > bool
> >
> > -config GENERIC_MULDI3
> > +config GENERIC_LIB_MULDI3
> > bool
> >
> > -config GENERIC_CMPDI2
> > +config GENERIC_LIB_CMPDI2
> > bool
> >
> > -config GENERIC_UCMPDI2
> > +config GENERIC_LIB_UCMPDI2
> > bool
> > diff --git a/lib/Makefile b/lib/Makefile
> > index d11c48ec8ffd..7e1ef77e86a3 100644
> > --- a/lib/Makefile
> > +++ b/lib/Makefile
> > @@ -252,9 +252,9 @@ obj-$(CONFIG_SBITMAP) += sbitmap.o
> > obj-$(CONFIG_PARMAN) += parman.o
> >
> > # GCC library routines
> > -obj-$(CONFIG_GENERIC_ASHLDI3) += ashldi3.o
> > -obj-$(CONFIG_GENERIC_ASHRDI3) += ashrdi3.o
> > -obj-$(CONFIG_GENERIC_LSHRDI3) += lshrdi3.o
> > -obj-$(CONFIG_GENERIC_MULDI3) += muldi3.o
> > -obj-$(CONFIG_GENERIC_CMPDI2) += cmpdi2.o
> > -obj-$(CONFIG_GENERIC_UCMPDI2) += ucmpdi2.o
> > +obj-$(CONFIG_GENERIC_LIB_ASHLDI3) += ashldi3.o
> > +obj-$(CONFIG_GENERIC_LIB_ASHRDI3) += ashrdi3.o
> > +obj-$(CONFIG_GENERIC_LIB_LSHRDI3) += lshrdi3.o
> > +obj-$(CONFIG_GENERIC_LIB_MULDI3) += muldi3.o
> > +obj-$(CONFIG_GENERIC_LIB_CMPDI2) += cmpdi2.o
> > +obj-$(CONFIG_GENERIC_LIB_UCMPDI2) += ucmpdi2.o


Attachments:
(No filename) (3.05 kB)
signature.asc (849.00 B)
Digital signature
Download all attachments

2018-02-17 00:33:04

by Palmer Dabbelt

[permalink] [raw]
Subject: Re: [PATCH] lib: Rename compiler intrinsic selects to GENERIC_LIB_*

On Tue, 13 Feb 2018 14:49:37 PST (-0800), [email protected] wrote:
> On Tue, Feb 13, 2018 at 01:48:18PM -0800, Palmer Dabbelt wrote:
>> On Fri, 09 Feb 2018 05:22:52 PST (-0800), [email protected] wrote:
>> > When these are included into arch Kconfig files, maintaining
>> > alphabetical ordering of the selects means these get split up. To allow
>> > for keeping things tidier and alphabetical, rename the selects to
>> > GENERIC_LIB_*
>> >
>> > Signed-off-by: Matt Redfearn <[email protected]>
>>
>> Thanks! Do you want me to take this in my tree?
>>
>> Reviewed-by: Palmer Dabbelt <[email protected]>
>
> Since a new version of the "MIPS: use generic GCC library routines from
> lib/" series would depend on it, and it makes sense for that series to
> go via the MIPS tree, I think it would be simpler for this patch to also
> be taken (with your ack) via the MIPS tree. Is that okay?

That's great, thanks!

>
> Thanks
> James
>
>>
>> > ---
>> > arch/riscv/Kconfig | 6 +++---
>> > lib/Kconfig | 12 ++++++------
>> > lib/Makefile | 12 ++++++------
>> > 3 files changed, 15 insertions(+), 15 deletions(-)
>> >
>> > diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig
>> > index 2c6adf12713a..5f1e2188d029 100644
>> > --- a/arch/riscv/Kconfig
>> > +++ b/arch/riscv/Kconfig
>> > @@ -99,9 +99,9 @@ config ARCH_RV32I
>> > bool "RV32I"
>> > select CPU_SUPPORTS_32BIT_KERNEL
>> > select 32BIT
>> > - select GENERIC_ASHLDI3
>> > - select GENERIC_ASHRDI3
>> > - select GENERIC_LSHRDI3
>> > + select GENERIC_LIB_ASHLDI3
>> > + select GENERIC_LIB_ASHRDI3
>> > + select GENERIC_LIB_LSHRDI3
>> >
>> > config ARCH_RV64I
>> > bool "RV64I"
>> > diff --git a/lib/Kconfig b/lib/Kconfig
>> > index c5e84fbcb30b..946d0890aad6 100644
>> > --- a/lib/Kconfig
>> > +++ b/lib/Kconfig
>> > @@ -584,20 +584,20 @@ config STRING_SELFTEST
>> >
>> > endmenu
>> >
>> > -config GENERIC_ASHLDI3
>> > +config GENERIC_LIB_ASHLDI3
>> > bool
>> >
>> > -config GENERIC_ASHRDI3
>> > +config GENERIC_LIB_ASHRDI3
>> > bool
>> >
>> > -config GENERIC_LSHRDI3
>> > +config GENERIC_LIB_LSHRDI3
>> > bool
>> >
>> > -config GENERIC_MULDI3
>> > +config GENERIC_LIB_MULDI3
>> > bool
>> >
>> > -config GENERIC_CMPDI2
>> > +config GENERIC_LIB_CMPDI2
>> > bool
>> >
>> > -config GENERIC_UCMPDI2
>> > +config GENERIC_LIB_UCMPDI2
>> > bool
>> > diff --git a/lib/Makefile b/lib/Makefile
>> > index d11c48ec8ffd..7e1ef77e86a3 100644
>> > --- a/lib/Makefile
>> > +++ b/lib/Makefile
>> > @@ -252,9 +252,9 @@ obj-$(CONFIG_SBITMAP) += sbitmap.o
>> > obj-$(CONFIG_PARMAN) += parman.o
>> >
>> > # GCC library routines
>> > -obj-$(CONFIG_GENERIC_ASHLDI3) += ashldi3.o
>> > -obj-$(CONFIG_GENERIC_ASHRDI3) += ashrdi3.o
>> > -obj-$(CONFIG_GENERIC_LSHRDI3) += lshrdi3.o
>> > -obj-$(CONFIG_GENERIC_MULDI3) += muldi3.o
>> > -obj-$(CONFIG_GENERIC_CMPDI2) += cmpdi2.o
>> > -obj-$(CONFIG_GENERIC_UCMPDI2) += ucmpdi2.o
>> > +obj-$(CONFIG_GENERIC_LIB_ASHLDI3) += ashldi3.o
>> > +obj-$(CONFIG_GENERIC_LIB_ASHRDI3) += ashrdi3.o
>> > +obj-$(CONFIG_GENERIC_LIB_LSHRDI3) += lshrdi3.o
>> > +obj-$(CONFIG_GENERIC_LIB_MULDI3) += muldi3.o
>> > +obj-$(CONFIG_GENERIC_LIB_CMPDI2) += cmpdi2.o
>> > +obj-$(CONFIG_GENERIC_LIB_UCMPDI2) += ucmpdi2.o