1 /* The common simulator framework for GDB, the GNU Debugger.
3 Copyright 2002 Free Software Foundation, Inc.
5 Contributed by Andrew Cagney and Red Hat.
7 This file is part of GDB.
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 2 of the License, or
12 (at your option) any later version.
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License
20 along with this program; if not, write to the Free Software
21 Foundation, Inc., 59 Temple Place - Suite 330,
22 Boston, MA 02111-1307, USA. */
26 /* #define SIM_TYPES_H */
28 /* INTEGER QUANTITIES:
32 signed* signed type of the given size
33 unsigned* The corresponding insigned type
37 *NN Size based on the number of bits
38 *_NN Size according to the number of bytes
39 *_word Size based on the target architecture's word
40 word size (32/64 bits)
41 *_cell Size based on the target architecture's
42 IEEE 1275 cell size (almost always 32 bits)
47 #if !defined (SIM_TYPES_H) && defined (__GNUC__)
52 #define UNSIGNED32(X) ((unsigned32) X##UL)
53 #define UNSIGNED64(X) ((unsigned64) X##ULL)
55 #define SIGNED32(X) ((signed32) X##L)
56 #define SIGNED64(X) ((signed64) X##LL)
58 typedef signed int signed8
__attribute__ ((__mode__ (__QI__
)));
59 typedef signed int signed16
__attribute__ ((__mode__ (__HI__
)));
60 typedef signed int signed32
__attribute__ ((__mode__ (__SI__
)));
61 typedef signed int signed64
__attribute__ ((__mode__ (__DI__
)));
63 typedef unsigned int unsigned8
__attribute__ ((__mode__ (__QI__
)));
64 typedef unsigned int unsigned16
__attribute__ ((__mode__ (__HI__
)));
65 typedef unsigned int unsigned32
__attribute__ ((__mode__ (__SI__
)));
66 typedef unsigned int unsigned64
__attribute__ ((__mode__ (__DI__
)));
68 typedef struct { unsigned64 a
[2]; } unsigned128
;
69 typedef struct { signed64 a
[2]; } signed128
;
74 #if !defined (SIM_TYPES_H) && defined (_MSC_VER)
79 #define UNSIGNED32(X) (X##ui32)
80 #define UNSIGNED64(X) (X##ui64)
82 #define SIGNED32(X) (X##i32)
83 #define SIGNED64(X) (X##i64)
85 typedef signed char signed8
;
86 typedef signed short signed16
;
87 typedef signed int signed32
;
88 typedef signed __int64 signed64
;
90 typedef unsigned int unsigned8
;
91 typedef unsigned int unsigned16
;
92 typedef unsigned int unsigned32
;
93 typedef unsigned __int64 unsigned64
;
95 typedef struct { unsigned64 a
[2]; } unsigned128
;
96 typedef struct { signed64 a
[2]; } signed128
;
101 #if !defined (SIM_TYPES_H)
106 #define UNSIGNED32(X) (X##UL)
107 #define UNSIGNED64(X) (X##ULL)
109 #define SIGNED32(X) (X##L)
110 #define SIGNED64(X) (X##LL)
112 typedef signed char signed8
;
113 typedef signed short signed16
;
114 #if defined (__ALPHA__)
115 typedef signed int unsigned32
;
116 typedef signed long unsigned64
;
118 typedef signed long unsigned32
;
119 typedef signed long long unsigned64
;
122 typedef unsigned char unsigned8
;
123 typedef unsigned short unsigned16
;
124 #if defined (__ALPHA__)
125 typedef unsigned int unsigned32
;
126 typedef unsigned long unsigned64
;
128 typedef unsigned long unsigned32
;
129 typedef unsigned long long unsigned64
;
132 typedef struct { unsigned64 a
[2]; } unsigned128
;
133 typedef struct { signed64 a
[2]; } signed128
;
140 typedef signed8 signed_1
;
141 typedef signed16 signed_2
;
142 typedef signed32 signed_4
;
143 typedef signed64 signed_8
;
144 typedef signed128 signed_16
;
146 typedef unsigned8 unsigned_1
;
147 typedef unsigned16 unsigned_2
;
148 typedef unsigned32 unsigned_4
;
149 typedef unsigned64 unsigned_8
;
150 typedef unsigned128 unsigned_16
;
153 /* for general work, the following are defined */
154 /* unsigned: >= 32 bits */
155 /* signed: >= 32 bits */
156 /* long: >= 32 bits, sign undefined */
157 /* int: small indicator */
159 /* target architecture based */
160 #if (WITH_TARGET_WORD_BITSIZE == 64)
161 typedef unsigned64 unsigned_word
;
162 typedef signed64 signed_word
;
164 #if (WITH_TARGET_WORD_BITSIZE == 32)
165 typedef unsigned32 unsigned_word
;
166 typedef signed32 signed_word
;
168 #if (WITH_TARGET_WORD_BITSIZE == 16)
169 typedef unsigned16 unsigned_word
;
170 typedef signed16 signed_word
;
174 /* Other instructions */
175 #if (WITH_TARGET_ADDRESS_BITSIZE == 64)
176 typedef unsigned64 unsigned_address
;
177 typedef signed64 signed_address
;
179 #if (WITH_TARGET_ADDRESS_BITSIZE == 32)
180 typedef unsigned32 unsigned_address
;
181 typedef signed32 signed_address
;
183 #if (WITH_TARGET_ADDRESS_BITSIZE == 16)
184 typedef unsigned16 unsigned_address
;
185 typedef signed16 signed_address
;
187 typedef unsigned_address address_word
;
190 /* IEEE 1275 cell size */
191 #if (WITH_TARGET_CELL_BITSIZE == 64)
192 typedef unsigned64 unsigned_cell
;
193 typedef signed64 signed_cell
;
195 #if (WITH_TARGET_CELL_BITSIZE == 32)
196 typedef unsigned32 unsigned_cell
;
197 typedef signed32 signed_cell
;
199 typedef signed_cell cell_word
; /* cells are normally signed */
202 /* Floating point registers */
203 #if (WITH_TARGET_FLOATING_POINT_BITSIZE == 64)
204 typedef unsigned64 fp_word
;
206 #if (WITH_TARGET_FLOATING_POINT_BITSIZE == 32)
207 typedef unsigned32 fp_word
;