1 /* The common simulator framework for GDB, the GNU Debugger.
3 Copyright 2002, 2005, 2007, 2008, 2009, 2010, 2011
4 Free Software Foundation, Inc.
6 Contributed by Andrew Cagney and Red Hat.
8 This file is part of GDB.
10 This program is free software; you can redistribute it and/or modify
11 it under the terms of the GNU General Public License as published by
12 the Free Software Foundation; either version 3 of the License, or
13 (at your option) any later version.
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License for more details.
20 You should have received a copy of the GNU General Public License
21 along with this program. If not, see <http://www.gnu.org/licenses/>. */
25 /* #define SIM_TYPES_H */
27 /* INTEGER QUANTITIES:
31 signed* signed type of the given size
32 unsigned* The corresponding insigned type
36 *NN Size based on the number of bits
37 *_NN Size according to the number of bytes
38 *_word Size based on the target architecture's word
39 word size (32/64 bits)
40 *_cell Size based on the target architecture's
41 IEEE 1275 cell size (almost always 32 bits)
46 #if !defined (SIM_TYPES_H) && defined (__GNUC__)
51 #define UNSIGNED32(X) ((unsigned32) X##UL)
52 #define UNSIGNED64(X) ((unsigned64) X##ULL)
54 #define SIGNED32(X) ((signed32) X##L)
55 #define SIGNED64(X) ((signed64) X##LL)
57 typedef signed int signed8 __attribute__ ((__mode__ (__QI__)));
58 typedef signed int signed16 __attribute__ ((__mode__ (__HI__)));
59 typedef signed int signed32 __attribute__ ((__mode__ (__SI__)));
60 typedef signed int signed64 __attribute__ ((__mode__ (__DI__)));
62 typedef unsigned int unsigned8 __attribute__ ((__mode__ (__QI__)));
63 typedef unsigned int unsigned16 __attribute__ ((__mode__ (__HI__)));
64 typedef unsigned int unsigned32 __attribute__ ((__mode__ (__SI__)));
65 typedef unsigned int unsigned64 __attribute__ ((__mode__ (__DI__)));
67 typedef struct { unsigned64 a[2]; } unsigned128;
68 typedef struct { signed64 a[2]; } signed128;
73 #if !defined (SIM_TYPES_H) && defined (_MSC_VER)
78 #define UNSIGNED32(X) (X##ui32)
79 #define UNSIGNED64(X) (X##ui64)
81 #define SIGNED32(X) (X##i32)
82 #define SIGNED64(X) (X##i64)
84 typedef signed char signed8;
85 typedef signed short signed16;
86 typedef signed int signed32;
87 typedef signed __int64 signed64;
89 typedef unsigned int unsigned8;
90 typedef unsigned int unsigned16;
91 typedef unsigned int unsigned32;
92 typedef unsigned __int64 unsigned64;
94 typedef struct { unsigned64 a[2]; } unsigned128;
95 typedef struct { signed64 a[2]; } signed128;
100 #if !defined (SIM_TYPES_H)
105 #define UNSIGNED32(X) (X##UL)
106 #define UNSIGNED64(X) (X##ULL)
108 #define SIGNED32(X) (X##L)
109 #define SIGNED64(X) (X##LL)
111 typedef signed char signed8;
112 typedef signed short signed16;
113 #if defined (__ALPHA__)
114 typedef signed int signed32;
115 typedef signed long signed64;
117 typedef signed long signed32;
118 typedef signed long long signed64;
121 typedef unsigned char unsigned8;
122 typedef unsigned short unsigned16;
123 #if defined (__ALPHA__)
124 typedef unsigned int unsigned32;
125 typedef unsigned long unsigned64;
127 typedef unsigned long unsigned32;
128 typedef unsigned long long unsigned64;
131 typedef struct { unsigned64 a[2]; } unsigned128;
132 typedef struct { signed64 a[2]; } signed128;
139 typedef signed8 signed_1;
140 typedef signed16 signed_2;
141 typedef signed32 signed_4;
142 typedef signed64 signed_8;
143 typedef signed128 signed_16;
145 typedef unsigned8 unsigned_1;
146 typedef unsigned16 unsigned_2;
147 typedef unsigned32 unsigned_4;
148 typedef unsigned64 unsigned_8;
149 typedef unsigned128 unsigned_16;
152 /* for general work, the following are defined */
153 /* unsigned: >= 32 bits */
154 /* signed: >= 32 bits */
155 /* long: >= 32 bits, sign undefined */
156 /* int: small indicator */
158 /* target architecture based */
159 #if (WITH_TARGET_WORD_BITSIZE == 64)
160 typedef unsigned64 unsigned_word;
161 typedef signed64 signed_word;
163 #if (WITH_TARGET_WORD_BITSIZE == 32)
164 typedef unsigned32 unsigned_word;
165 typedef signed32 signed_word;
167 #if (WITH_TARGET_WORD_BITSIZE == 16)
168 typedef unsigned16 unsigned_word;
169 typedef signed16 signed_word;
173 /* Other instructions */
174 #if (WITH_TARGET_ADDRESS_BITSIZE == 64)
175 typedef unsigned64 unsigned_address;
176 typedef signed64 signed_address;
178 #if (WITH_TARGET_ADDRESS_BITSIZE == 32)
179 typedef unsigned32 unsigned_address;
180 typedef signed32 signed_address;
182 #if (WITH_TARGET_ADDRESS_BITSIZE == 16)
183 typedef unsigned16 unsigned_address;
184 typedef signed16 signed_address;
186 typedef unsigned_address address_word;
189 /* IEEE 1275 cell size */
190 #if (WITH_TARGET_CELL_BITSIZE == 64)
191 typedef unsigned64 unsigned_cell;
192 typedef signed64 signed_cell;
194 #if (WITH_TARGET_CELL_BITSIZE == 32)
195 typedef unsigned32 unsigned_cell;
196 typedef signed32 signed_cell;
198 typedef signed_cell cell_word; /* cells are normally signed */
201 /* Floating point registers */
202 #if (WITH_TARGET_FLOATING_POINT_BITSIZE == 64)
203 typedef unsigned64 fp_word;
205 #if (WITH_TARGET_FLOATING_POINT_BITSIZE == 32)
206 typedef unsigned32 fp_word;