xref: /linux/arch/m68k/include/asm/libgcc.h (revision e419ddeabe7edd89650a19f411f928eea12b35b1)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef __ASM_M68K_LIBGCC_H
3 #define __ASM_M68K_LIBGCC_H
4 
5 #ifndef CONFIG_CPU_HAS_NO_MULDIV64
6 /*
7  * For those 68K CPUs that support 64bit multiply define umul_ppm()
8  * for the common muldi3 libgcc helper function (in lib/muldi3.c).
9  * CPUs that don't have it (like the original 68000 and ColdFire)
10  * will fallback to using the C-coded version of umul_ppmm().
11  */
12 #define umul_ppmm(w1, w0, u, v)				\
13 	__asm__ ("mulu%.l %3,%1:%0"			\
14 		 : "=d" ((unsigned long)(w0)),		\
15 		   "=d" ((unsigned long)(w1))		\
16 		 : "%0" ((unsigned long)(u)),		\
17 		   "dmi" ((unsigned long)(v)))
18 #endif /* !CONFIG_CPU_HAS_NO_MULDIV64 */
19 
20 #endif /* __ASM_M68K_LIBGCC_H */
21