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. */
24 /* Basic type sizes for the PowerPC */
32 /* INTEGER QUANTITIES:
36 natural* sign determined by host
37 signed* signed type of the given size
38 unsigned* The corresponding insigned type
42 *NN Size based on the number of bits
43 *_NN Size according to the number of bytes
44 *_word Size based on the target architecture's word
45 word size (32/64 bits)
46 *_cell Size based on the target architecture's
47 IEEE 1275 cell size (almost always 32 bits)
53 typedef char natural8;
54 typedef short natural16;
55 typedef long natural32;
57 typedef signed char signed8;
58 typedef signed short signed16;
59 typedef signed long signed32;
61 typedef unsigned char unsigned8;
62 typedef unsigned short unsigned16;
63 typedef unsigned long unsigned32;
65 #if defined __GNUC__ || defined _MSC_VER
68 /* GDB sometimes likes to make what appear to be signed `0x*L' values
69 unsigned by default */
71 typedef long long natural64;
72 typedef signed long long signed64;
73 typedef unsigned long long unsigned64;
75 #define UNSIGNED64(X) (X##ULL)
76 #define SIGNED64(X) ((signed64) X##LL)
78 #define UNSIGNED32(X) (X##UL)
79 #define SIGNED32(X) ((signed32) X##L)
83 typedef __int64 natural64;
84 typedef signed __int64 signed64;
85 typedef unsigned __int64 unsigned64;
87 #define UNSIGNED64(X) (X##ui64)
88 #define SIGNED64(X) (X##i64)
90 #define SIGNED32(X) (X##ui32)
91 #define UNSIGNED32(X) (X##i32)
95 typedef struct { unsigned64 a[2]; } unsigned128;
96 typedef struct { signed64 a[2]; } signed128;
98 #else /* Not GNUC or _MSC_VER */
103 typedef natural8 natural_1;
104 typedef natural16 natural_2;
105 typedef natural32 natural_4;
106 typedef natural64 natural_8;
107 /* typedef natural64 natural_8; */
109 typedef signed8 signed_1;
110 typedef signed16 signed_2;
111 typedef signed32 signed_4;
112 typedef signed64 signed_8;
113 typedef signed128 signed_16;
115 typedef unsigned8 unsigned_1;
116 typedef unsigned16 unsigned_2;
117 typedef unsigned32 unsigned_4;
118 typedef unsigned64 unsigned_8;
119 typedef unsigned128 unsigned_16;
122 /* for general work, the following are defined */
123 /* unsigned: >= 32 bits */
124 /* signed: >= 32 bits */
125 /* long: >= 32 bits, sign undefined */
126 /* int: small indicator */
128 /* target architecture based */
129 #if (WITH_TARGET_WORD_BITSIZE == 64)
130 typedef natural64 natural_word;
131 typedef unsigned64 unsigned_word;
132 typedef signed64 signed_word;
134 #if (WITH_TARGET_WORD_BITSIZE == 32)
135 typedef natural32 natural_word;
136 typedef unsigned32 unsigned_word;
137 typedef signed32 signed_word;
141 /* Other instructions */
142 #if (WITH_TARGET_ADDRESS_BITSIZE == 64)
143 typedef unsigned64 unsigned_address;
144 typedef signed64 signed_address;
146 #if (WITH_TARGET_ADDRESS_BITSIZE == 32)
147 typedef unsigned32 unsigned_address;
148 typedef signed32 signed_address;
150 typedef unsigned_address address_word;
152 /* IEEE 1275 cell size */
153 #if (WITH_TARGET_CELL_BITSIZE == 64)
154 typedef natural64 natural_cell;
155 typedef unsigned64 unsigned_cell;
156 typedef signed64 signed_cell;
158 #if (WITH_TARGET_CELL_BITSIZE == 32)
159 typedef natural32 natural_cell;
160 typedef unsigned32 unsigned_cell;
161 typedef signed32 signed_cell;
164 /* Floating point registers */
165 #if (WITH_TARGET_FLOATING_POINT_BITSIZE == 64)
166 typedef unsigned64 fp_word;
168 #if (WITH_TARGET_FLOATING_POINT_BITSIZE == 32)
169 typedef unsigned32 fp_word;
173 #endif /* _SIM_TYPES_H_ */