Skip to content

Commit 8bc6666

Browse files
geertuglaubitz
authored andcommitted
sh: Use generic GCC library routines
The C implementations of __ashldi3(), __ashrdi3__(), and __lshrdi3() in arch/sh/lib/ are identical to the generic C implementations in lib/. Reduce duplication by switching SH to the generic versions. Update the include path in arch/sh/boot/compressed accordingly. Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Acked-by: Palmer Dabbelt <palmer@rivosinc.com> Reviewed-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de> Link: https://lore.kernel.org/r/74dbe68dc8e2ffb6180092f73723fe21ab692c7a.1679566500.git.geert+renesas@glider.be Signed-off-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
1 parent 2d60eca commit 8bc6666

6 files changed

Lines changed: 6 additions & 97 deletions

File tree

arch/sh/Kconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ config SUPERH
2121
select GENERIC_CMOS_UPDATE if SH_SH03 || SH_DREAMCAST
2222
select GENERIC_IDLE_POLL_SETUP
2323
select GENERIC_IRQ_SHOW
24+
select GENERIC_LIB_ASHLDI3
25+
select GENERIC_LIB_ASHRDI3
26+
select GENERIC_LIB_LSHRDI3
2427
select GENERIC_PCI_IOMAP if PCI
2528
select GENERIC_SCHED_CLOCK
2629
select GENERIC_SMP_IDLE_THREAD

arch/sh/boot/compressed/ashldi3.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
// SPDX-License-Identifier: GPL-2.0-only
2-
#include "../../lib/ashldi3.c"
1+
// SPDX-License-Identifier: GPL-2.0-or-later
2+
#include "../../../../lib/ashldi3.c"

arch/sh/lib/Makefile

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@ lib-y = delay.o memmove.o memchr.o \
77
checksum.o strlen.o div64.o div64-generic.o
88

99
# Extracted from libgcc
10-
obj-y += movmem.o ashldi3.o ashrdi3.o lshrdi3.o \
11-
ashlsi3.o ashrsi3.o ashiftrt.o lshrsi3.o \
12-
udiv_qrnnd.o
10+
obj-y += movmem.o ashlsi3.o ashrsi3.o ashiftrt.o lshrsi3.o udiv_qrnnd.o
1311

1412
udivsi3-y := udivsi3_i4i-Os.o
1513

arch/sh/lib/ashldi3.c

Lines changed: 0 additions & 30 deletions
This file was deleted.

arch/sh/lib/ashrdi3.c

Lines changed: 0 additions & 32 deletions
This file was deleted.

arch/sh/lib/lshrdi3.c

Lines changed: 0 additions & 30 deletions
This file was deleted.

0 commit comments

Comments
 (0)