From e419ddeabe7edd89650a19f411f928eea12b35b1 Mon Sep 17 00:00:00 2001 From: Greg Ungerer Date: Mon, 13 Nov 2023 23:32:09 +1000 Subject: m68k: Use kernel's generic muldi3 libgcc function Use the kernels own generic lib/muldi3.c implementation of muldi3 for 68K machines. Some 68K CPUs support 64bit multiplies so move the arch specific umul_ppmm() macro into a header file that is included by lib/muldi3.c. That way it can take advantage of the single instruction when available. There does not appear to be any existing mechanism for the generic lib/muldi3.c code to pick up an external arch definition of umul_ppmm(). Create an arch specific libgcc.h that can optionally be included by the system include/linux/libgcc.h to allow for this. Somewhat oddly there is also a similar definition of umul_ppmm() in the non-architecture code in lib/crypto/mpi/longlong.h for a wide range or machines. Its presence ends up complicating the include setup and means not being able to use something like compiler.h instead. Actually there is a few other defines of umul_ppmm() macros spread around in various architectures, but not directly usable for the m68k case. Signed-off-by: Greg Ungerer Link: https://lore.kernel.org/20231113133209.1367286-1-gerg@linux-m68k.org Reviewed-by: Geert Uytterhoeven Reviewed-by: Arnd Bergmann Signed-off-by: Geert Uytterhoeven --- arch/m68k/Kconfig | 2 ++ 1 file changed, 2 insertions(+) (limited to 'arch/m68k/Kconfig') diff --git a/arch/m68k/Kconfig b/arch/m68k/Kconfig index 7c4f7bcc89d7..b2ed0308c0ea 100644 --- a/arch/m68k/Kconfig +++ b/arch/m68k/Kconfig @@ -23,7 +23,9 @@ config M68K select GENERIC_LIB_ASHLDI3 select GENERIC_LIB_ASHRDI3 select GENERIC_LIB_LSHRDI3 + select GENERIC_LIB_MULDI3 select HAS_IOPORT if PCI || ISA || ATARI_ROM_ISA + select HAVE_ARCH_LIBGCC_H select HAVE_ARCH_SECCOMP select HAVE_ARCH_SECCOMP_FILTER select HAVE_ASM_MODVERSIONS -- cgit