2 * Copyright (C) 1989-2013 Free Software Foundation, Inc.
4 * SPDX-License-Identifier: GPL-2.0+
10 #define UNITS_PER_WORD 4 /* for ARC */
11 #define BITS_PER_UNIT 8 /* for ARC */
13 #define W_TYPE_SIZE (4 * BITS_PER_UNIT)
15 #define MIN_UNITS_PER_WORD UNITS_PER_WORD
17 /* Work out the largest "word" size that we can deal with on this target. */
18 #if MIN_UNITS_PER_WORD > 4
19 # define LIBGCC2_MAX_UNITS_PER_WORD 8
20 #elif (MIN_UNITS_PER_WORD > 2 \
21 || (MIN_UNITS_PER_WORD > 1 && __SIZEOF_LONG_LONG__ > 4))
22 # define LIBGCC2_MAX_UNITS_PER_WORD 4
24 # define LIBGCC2_MAX_UNITS_PER_WORD MIN_UNITS_PER_WORD
27 /* Work out what word size we are using for this compilation.
28 The value can be set on the command line. */
29 #ifndef LIBGCC2_UNITS_PER_WORD
30 #define LIBGCC2_UNITS_PER_WORD LIBGCC2_MAX_UNITS_PER_WORD
33 typedef int QItype __attribute__ ((mode (QI)));
34 typedef unsigned int UQItype __attribute__ ((mode (QI)));
35 typedef int HItype __attribute__ ((mode (HI)));
36 typedef unsigned int UHItype __attribute__ ((mode (HI)));
37 #if MIN_UNITS_PER_WORD > 1
38 /* These typedefs are usually forbidden on dsp's with UNITS_PER_WORD 1. */
39 typedef int SItype __attribute__ ((mode (SI)));
40 typedef unsigned int USItype __attribute__ ((mode (SI)));
41 #if __SIZEOF_LONG_LONG__ > 4
42 /* These typedefs are usually forbidden on archs with UNITS_PER_WORD 2. */
43 typedef int DItype __attribute__ ((mode (DI)));
44 typedef unsigned int UDItype __attribute__ ((mode (DI)));
45 #if MIN_UNITS_PER_WORD > 4
46 /* These typedefs are usually forbidden on archs with UNITS_PER_WORD 4. */
47 typedef int TItype __attribute__ ((mode (TI)));
48 typedef unsigned int UTItype __attribute__ ((mode (TI)));
53 #if LIBGCC2_UNITS_PER_WORD == 8
54 #define W_TYPE_SIZE (8 * BITS_PER_UNIT)
56 #define UWtype UDItype
58 #define UHWtype UDItype
60 #define UDWtype UTItype
61 #ifdef LIBGCC2_GNU_PREFIX
62 #define __NW(a,b) __gnu_ ## a ## di ## b
63 #define __NDW(a,b) __gnu_ ## a ## ti ## b
65 #define __NW(a,b) __ ## a ## di ## b
66 #define __NDW(a,b) __ ## a ## ti ## b
68 #elif LIBGCC2_UNITS_PER_WORD == 4
69 #define W_TYPE_SIZE (4 * BITS_PER_UNIT)
71 #define UWtype USItype
73 #define UHWtype USItype
75 #define UDWtype UDItype
76 #ifdef LIBGCC2_GNU_PREFIX
77 #define __NW(a,b) __gnu_ ## a ## si ## b
78 #define __NDW(a,b) __gnu_ ## a ## di ## b
80 #define __NW(a,b) __ ## a ## si ## b
81 #define __NDW(a,b) __ ## a ## di ## b
83 #elif LIBGCC2_UNITS_PER_WORD == 2
84 #define W_TYPE_SIZE (2 * BITS_PER_UNIT)
86 #define UWtype UHItype
88 #define UHWtype UHItype
90 #define UDWtype USItype
91 #ifdef LIBGCC2_GNU_PREFIX
92 #define __NW(a,b) __gnu_ ## a ## hi ## b
93 #define __NDW(a,b) __gnu_ ## a ## si ## b
95 #define __NW(a,b) __ ## a ## hi ## b
96 #define __NDW(a,b) __ ## a ## si ## b
99 #define W_TYPE_SIZE BITS_PER_UNIT
101 #define UWtype UQItype
102 #define HWtype QItype
103 #define UHWtype UQItype
104 #define DWtype HItype
105 #define UDWtype UHItype
106 #ifdef LIBGCC2_GNU_PREFIX
107 #define __NW(a,b) __gnu_ ## a ## qi ## b
108 #define __NDW(a,b) __gnu_ ## a ## hi ## b
110 #define __NW(a,b) __ ## a ## qi ## b
111 #define __NDW(a,b) __ ## a ## hi ## b
115 typedef int shift_count_type __attribute__((mode (__libgcc_shift_count__)));
117 #if __BYTE_ORDER__ != __ORDER_LITTLE_ENDIAN__
118 struct DWstruct {Wtype high, low;};
120 struct DWstruct {Wtype low, high;};
123 /* We need this union to unpack/pack DImode values, since we don't have
124 any arithmetic yet. Incoming DImode parameters are stored into the
125 `ll' field, and the unpacked result is read from the struct `s'. */
132 #endif /* __ASM_LIBGCC_H */