xref: /linux-6.15/include/linux/libgcc.h (revision e419ddea)
1588cb88cSThomas Gleixner /* SPDX-License-Identifier: GPL-2.0-or-later */
24db2b604SChristoph Hellwig /*
34db2b604SChristoph Hellwig  * include/lib/libgcc.h
44db2b604SChristoph Hellwig  */
54db2b604SChristoph Hellwig 
64db2b604SChristoph Hellwig #ifndef __LIB_LIBGCC_H
74db2b604SChristoph Hellwig #define __LIB_LIBGCC_H
84db2b604SChristoph Hellwig 
94db2b604SChristoph Hellwig #include <asm/byteorder.h>
104db2b604SChristoph Hellwig 
114db2b604SChristoph Hellwig typedef int word_type __attribute__ ((mode (__word__)));
124db2b604SChristoph Hellwig 
134db2b604SChristoph Hellwig #ifdef __BIG_ENDIAN
144db2b604SChristoph Hellwig struct DWstruct {
154db2b604SChristoph Hellwig 	int high, low;
164db2b604SChristoph Hellwig };
174db2b604SChristoph Hellwig #elif defined(__LITTLE_ENDIAN)
184db2b604SChristoph Hellwig struct DWstruct {
194db2b604SChristoph Hellwig 	int low, high;
204db2b604SChristoph Hellwig };
214db2b604SChristoph Hellwig #else
224db2b604SChristoph Hellwig #error I feel sick.
234db2b604SChristoph Hellwig #endif
244db2b604SChristoph Hellwig 
254db2b604SChristoph Hellwig typedef union {
264db2b604SChristoph Hellwig 	struct DWstruct s;
274db2b604SChristoph Hellwig 	long long ll;
284db2b604SChristoph Hellwig } DWunion;
294db2b604SChristoph Hellwig 
304f20b747SGeert Uytterhoeven long long notrace __ashldi3(long long u, word_type b);
314f20b747SGeert Uytterhoeven long long notrace __ashrdi3(long long u, word_type b);
324f20b747SGeert Uytterhoeven word_type notrace __cmpdi2(long long a, long long b);
334f20b747SGeert Uytterhoeven long long notrace __lshrdi3(long long u, word_type b);
344f20b747SGeert Uytterhoeven long long notrace __muldi3(long long u, long long v);
354f20b747SGeert Uytterhoeven word_type notrace __ucmpdi2(unsigned long long a, unsigned long long b);
364f20b747SGeert Uytterhoeven 
37*e419ddeaSGreg Ungerer #ifdef CONFIG_HAVE_ARCH_LIBGCC_H
38*e419ddeaSGreg Ungerer #include <asm/libgcc.h>
39*e419ddeaSGreg Ungerer #endif
40*e419ddeaSGreg Ungerer 
414db2b604SChristoph Hellwig #endif /* __ASM_LIBGCC_H */
42