1 /* SPDX-License-Identifier: GPL-2.0+ */
3 * Copyright (C) 1989-2013 Free Software Foundation, Inc.
9 #define UNITS_PER_WORD 4 /* for ARC */
10 #define BITS_PER_UNIT 8 /* for ARC */
12 #define W_TYPE_SIZE (4 * BITS_PER_UNIT)
14 #define MIN_UNITS_PER_WORD UNITS_PER_WORD
16 /* Work out the largest "word" size that we can deal with on this target. */
17 #if MIN_UNITS_PER_WORD > 4
18 # define LIBGCC2_MAX_UNITS_PER_WORD 8
19 #elif (MIN_UNITS_PER_WORD > 2 \
20 || (MIN_UNITS_PER_WORD > 1 && __SIZEOF_LONG_LONG__ > 4))
21 # define LIBGCC2_MAX_UNITS_PER_WORD 4
23 # define LIBGCC2_MAX_UNITS_PER_WORD MIN_UNITS_PER_WORD
26 /* Work out what word size we are using for this compilation.
27 The value can be set on the command line. */
28 #ifndef LIBGCC2_UNITS_PER_WORD
29 #define LIBGCC2_UNITS_PER_WORD LIBGCC2_MAX_UNITS_PER_WORD
32 typedef int QItype __attribute__ ((mode (QI)));
33 typedef unsigned int UQItype __attribute__ ((mode (QI)));
34 typedef int HItype __attribute__ ((mode (HI)));
35 typedef unsigned int UHItype __attribute__ ((mode (HI)));
36 #if MIN_UNITS_PER_WORD > 1
37 /* These typedefs are usually forbidden on dsp's with UNITS_PER_WORD 1. */
38 typedef int SItype __attribute__ ((mode (SI)));
39 typedef unsigned int USItype __attribute__ ((mode (SI)));
40 #if __SIZEOF_LONG_LONG__ > 4
41 /* These typedefs are usually forbidden on archs with UNITS_PER_WORD 2. */
42 typedef int DItype __attribute__ ((mode (DI)));
43 typedef unsigned int UDItype __attribute__ ((mode (DI)));
44 #if MIN_UNITS_PER_WORD > 4
45 /* These typedefs are usually forbidden on archs with UNITS_PER_WORD 4. */
46 typedef int TItype __attribute__ ((mode (TI)));
47 typedef unsigned int UTItype __attribute__ ((mode (TI)));
52 #if LIBGCC2_UNITS_PER_WORD == 8
53 #define W_TYPE_SIZE (8 * BITS_PER_UNIT)
55 #define UWtype UDItype
57 #define UHWtype UDItype
59 #define UDWtype UTItype
60 #ifdef LIBGCC2_GNU_PREFIX
61 #define __NW(a,b) __gnu_ ## a ## di ## b
62 #define __NDW(a,b) __gnu_ ## a ## ti ## b
64 #define __NW(a,b) __ ## a ## di ## b
65 #define __NDW(a,b) __ ## a ## ti ## b
67 #elif LIBGCC2_UNITS_PER_WORD == 4
68 #define W_TYPE_SIZE (4 * BITS_PER_UNIT)
70 #define UWtype USItype
72 #define UHWtype USItype
74 #define UDWtype UDItype
75 #ifdef LIBGCC2_GNU_PREFIX
76 #define __NW(a,b) __gnu_ ## a ## si ## b
77 #define __NDW(a,b) __gnu_ ## a ## di ## b
79 #define __NW(a,b) __ ## a ## si ## b
80 #define __NDW(a,b) __ ## a ## di ## b
82 #elif LIBGCC2_UNITS_PER_WORD == 2
83 #define W_TYPE_SIZE (2 * BITS_PER_UNIT)
85 #define UWtype UHItype
87 #define UHWtype UHItype
89 #define UDWtype USItype
90 #ifdef LIBGCC2_GNU_PREFIX
91 #define __NW(a,b) __gnu_ ## a ## hi ## b
92 #define __NDW(a,b) __gnu_ ## a ## si ## b
94 #define __NW(a,b) __ ## a ## hi ## b
95 #define __NDW(a,b) __ ## a ## si ## b
98 #define W_TYPE_SIZE BITS_PER_UNIT
100 #define UWtype UQItype
101 #define HWtype QItype
102 #define UHWtype UQItype
103 #define DWtype HItype
104 #define UDWtype UHItype
105 #ifdef LIBGCC2_GNU_PREFIX
106 #define __NW(a,b) __gnu_ ## a ## qi ## b
107 #define __NDW(a,b) __gnu_ ## a ## hi ## b
109 #define __NW(a,b) __ ## a ## qi ## b
110 #define __NDW(a,b) __ ## a ## hi ## b
114 typedef int shift_count_type __attribute__((mode (__libgcc_shift_count__)));
116 #if __BYTE_ORDER__ != __ORDER_LITTLE_ENDIAN__
117 struct DWstruct {Wtype high, low;};
119 struct DWstruct {Wtype low, high;};
122 /* We need this union to unpack/pack DImode values, since we don't have
123 any arithmetic yet. Incoming DImode parameters are stored into the
124 `ll' field, and the unpacked result is read from the struct `s'. */
131 #endif /* __ASM_LIBGCC_H */