^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) /* SPDX-License-Identifier: GPL-2.0 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) #ifndef __H8300_LIBGCC_H__
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) #define __H8300_LIBGCC_H__
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) #ifdef __ASSEMBLY__
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) #define A0 r0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) #define A0L r0l
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) #define A0H r0h
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) #define A1 r1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) #define A1L r1l
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) #define A1H r1h
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) #define A2 r2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) #define A2L r2l
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) #define A2H r2h
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) #define A3 r3
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) #define A3L r3l
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) #define A3H r3h
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) #define S0 r4
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) #define S0L r4l
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) #define S0H r4h
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) #define S1 r5
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) #define S1L r5l
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) #define S1H r5h
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) #define S2 r6
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) #define S2L r6l
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) #define S2H r6h
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) #define PUSHP push.l
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) #define POPP pop.l
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) #define A0P er0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) #define A1P er1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) #define A2P er2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) #define A3P er3
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) #define S0P er4
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) #define S1P er5
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) #define S2P er6
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) #define A0E e0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) #define A1E e1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) #define A2E e2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) #define A3E e3
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) #else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) #define Wtype SItype
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) #define UWtype USItype
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) #define HWtype SItype
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) #define UHWtype USItype
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) #define DWtype DItype
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) #define UDWtype UDItype
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) #define UWtype USItype
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) #define Wtype SItype
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) #define UWtype USItype
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) #define W_TYPE_SIZE (4 * BITS_PER_UNIT)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) #define BITS_PER_UNIT (8)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) typedef int SItype __attribute__ ((mode (SI)));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) typedef unsigned int USItype __attribute__ ((mode (SI)));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) typedef int DItype __attribute__ ((mode (DI)));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65) typedef unsigned int UDItype __attribute__ ((mode (DI)));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66) struct DWstruct {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67) Wtype high, low;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69) typedef union {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70) struct DWstruct s;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71) DWtype ll;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72) } DWunion;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 73)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 74) typedef int word_type __attribute__ ((mode (__word__)));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 75)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 76) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 77)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 78) #endif