forked from mirrors/linux
		
	 e419ddeabe
			
		
	
	
		e419ddeabe
		
	
	
	
	
		
			
			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 <gerg@linux-m68k.org> Link: https://lore.kernel.org/20231113133209.1367286-1-gerg@linux-m68k.org Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org> Reviewed-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
		
			
				
	
	
		
			41 lines
		
	
	
	
		
			875 B
		
	
	
	
		
			C
		
	
	
	
	
	
			
		
		
	
	
			41 lines
		
	
	
	
		
			875 B
		
	
	
	
		
			C
		
	
	
	
	
	
| /* SPDX-License-Identifier: GPL-2.0-or-later */
 | |
| /*
 | |
|  * include/lib/libgcc.h
 | |
|  */
 | |
| 
 | |
| #ifndef __LIB_LIBGCC_H
 | |
| #define __LIB_LIBGCC_H
 | |
| 
 | |
| #include <asm/byteorder.h>
 | |
| 
 | |
| typedef int word_type __attribute__ ((mode (__word__)));
 | |
| 
 | |
| #ifdef __BIG_ENDIAN
 | |
| struct DWstruct {
 | |
| 	int high, low;
 | |
| };
 | |
| #elif defined(__LITTLE_ENDIAN)
 | |
| struct DWstruct {
 | |
| 	int low, high;
 | |
| };
 | |
| #else
 | |
| #error I feel sick.
 | |
| #endif
 | |
| 
 | |
| typedef union {
 | |
| 	struct DWstruct s;
 | |
| 	long long ll;
 | |
| } DWunion;
 | |
| 
 | |
| long long notrace __ashldi3(long long u, word_type b);
 | |
| long long notrace __ashrdi3(long long u, word_type b);
 | |
| word_type notrace __cmpdi2(long long a, long long b);
 | |
| long long notrace __lshrdi3(long long u, word_type b);
 | |
| long long notrace __muldi3(long long u, long long v);
 | |
| word_type notrace __ucmpdi2(unsigned long long a, unsigned long long b);
 | |
| 
 | |
| #ifdef CONFIG_HAVE_ARCH_LIBGCC_H
 | |
| #include <asm/libgcc.h>
 | |
| #endif
 | |
| 
 | |
| #endif /* __ASM_LIBGCC_H */
 |