xref: /linux/arch/m68k/include/asm/libgcc.h (revision e7244cc382524ac5354dbf7b7cb351e926e8118f)
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 	do {						\
14 		unsigned long __u = (u), __v = (v);	\
15 		unsigned long __w0, __w1;		\
16 							\
17 		__asm__ ("mulu%.l %3,%1:%0"		\
18 			 : "=d" (__w0),			\
19 			   "=d" (__w1)			\
20 			 : "%0" (__u),			\
21 			   "dmi" (__v));		\
22 							\
23 		(w0) = __w0; (w1) = __w1;		\
24 	} while (0)
25 #endif /* !CONFIG_CPU_HAS_NO_MULDIV64 */
26 
27 #endif /* __ASM_M68K_LIBGCC_H */
28