1 /* This file is part of psim (model of the PowerPC(tm) architecture)
3 Copyright (C) 1994-1997, Andrew Cagney <cagney@highland.com.au>
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public License
7 as published by the Free Software Foundation; either version 2 of
8 the License, or (at your option) any later version.
10 This library is distributed in the hope that it will be useful, but
11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details.
15 You should have received a copy of the GNU Library General Public
16 License along with this library; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21 PowerPC is a trademark of International Business Machines Corporation. */
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 unsigned32
;
115 typedef signed long unsigned64
;
117 typedef signed long unsigned32
;
118 typedef signed long long unsigned64
;
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
;
169 /* Other instructions */
170 #if (WITH_TARGET_ADDRESS_BITSIZE == 64)
171 typedef unsigned64 unsigned_address
;
172 typedef signed64 signed_address
;
174 #if (WITH_TARGET_ADDRESS_BITSIZE == 32)
175 typedef unsigned32 unsigned_address
;
176 typedef signed32 signed_address
;
178 typedef unsigned_address address_word
;
181 /* IEEE 1275 cell size */
182 #if (WITH_TARGET_CELL_BITSIZE == 64)
183 typedef unsigned64 unsigned_cell
;
184 typedef signed64 signed_cell
;
186 #if (WITH_TARGET_CELL_BITSIZE == 32)
187 typedef unsigned32 unsigned_cell
;
188 typedef signed32 signed_cell
;
190 typedef signed_cell cell_word
; /* cells are normally signed */
193 /* Floating point registers */
194 #if (WITH_TARGET_FLOATING_POINT_BITSIZE == 64)
195 typedef unsigned64 fp_word
;
197 #if (WITH_TARGET_FLOATING_POINT_BITSIZE == 32)
198 typedef unsigned32 fp_word
;