MIPS: use generic GCC library routines from lib/
Subsystems (2)
v2 cover MIPS: use generic GCC library routines from lib/
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
Signature · 1 line
2.11.0
PATCH v2 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.
--- lib/ucmpdi2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
lib/ucmpdi2.c +1 -1
@@ -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};
Signature · 1 line
2.11.0
Re: [PATCH v2 1/2] Add notrace to lib/ucmpdi2.c
Hi
Quoted 9 lines · Antony Pavlov
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]>
Looks good to me :-)
Quoted 18 lines
--- lib/ucmpdi2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)lib/ucmpdi2.c +1
-1@@ -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};
Re: [PATCH v2 1/2] Add notrace to lib/ucmpdi2.c
In reply to Antony PavlovQuoted 18 lines · On Tue, 30 Jan 2018 14:42:01 PST (-0800), [email protected] wrote:
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]>--- lib/ucmpdi2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)lib/ucmpdi2.c +0
-0
lib/ucmpdi2.c line 23
Quoted 8 lines
lib/ucmpdi2.c +1
-1@@ -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};
Thanks for submitting this, I've gotten quite a bit behind due to FOSDEM.
PATCH v2 2/2 MIPS: use generic GCC library routines from lib/
In reply to Antony PavlovThe 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/.
--- 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(-)
arch/mips/Kconfig +5 -0
@@ -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 menu "Machine selection"
arch/mips/lib/Makefile +1 -1
@@ -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
arch/mips/lib/ashldi3.c deleted +0 -30
@@ -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);
arch/mips/lib/ashrdi3.c deleted +0 -32
@@ -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);
arch/mips/lib/cmpdi2.c deleted +0 -28
@@ -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);
arch/mips/lib/lshrdi3.c deleted +0 -30
@@ -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);
arch/mips/lib/ucmpdi2.c deleted +0 -22
@@ -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);
Signature · 1 line
2.11.0
Hi,
Quoted 31 lines · Antony Pavlov
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 fromarch/mips/lib/in favour of similar
routines fromlib/.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]>--- 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(-)arch/mips/Kconfig +0
-0
arch/mips/Kconfig config MIPS · line 80
Quoted 8 lines
arch/mips/Kconfig +5
-0@@ -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,
Thanks,
Matt
Quoted 186 lines
arch/mips/Kconfig +0
-0menu "Machine selection"arch/mips/lib/Makefile +1
-1@@ -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.oarch/mips/lib/ashldi3.c deleted +0
-30@@ -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);arch/mips/lib/ashrdi3.c deleted +0
-32@@ -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);arch/mips/lib/cmpdi2.c deleted +0
-28@@ -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);arch/mips/lib/lshrdi3.c deleted +0
-30@@ -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);arch/mips/lib/ucmpdi2.c deleted +0
-22@@ -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);