1 /* This file is part of psim (model of the PowerPC(tm) architecture)
3 Copyright (C) 1994-1995, Andrew Cagney <cagney@highland.com.au>
4 Copyright (C) 1997, Free Software Foundation, Inc.
6 This library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Library General Public License
8 as published by the Free Software Foundation; either version 2 of
9 the License, or (at your option) any later version.
11 This library is distributed in the hope that it will be useful, but
12 WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Library General Public License for more details.
16 You should have received a copy of the GNU Library General Public
17 License along with this library; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22 PowerPC is a trademark of International Business Machines Corporation. */
25 /* Basic type sizes for the PowerPC */
33 /* INTEGER QUANTITIES:
37 natural* sign determined by host
38 signed* signed type of the given size
39 unsigned* The corresponding insigned type
43 *NN Size based on the number of bits
44 *_NN Size according to the number of bytes
45 *_word Size based on the target architecture's word
46 word size (32/64 bits)
47 *_cell Size based on the target architecture's
48 IEEE 1275 cell size (almost always 32 bits)
54 typedef char natural8;
55 typedef short natural16;
56 typedef long natural32;
58 typedef signed char signed8;
59 typedef signed short signed16;
60 typedef signed long signed32;
62 typedef unsigned char unsigned8;
63 typedef unsigned short unsigned16;
64 typedef unsigned long unsigned32;
66 #if defined __GNUC__ || defined _WIN32
69 typedef long long natural64;
70 typedef signed long long signed64;
71 typedef unsigned long long unsigned64;
73 #define UNSIGNED64(X) (X##ULL)
74 #define SIGNED64(X) (X##LL)
76 #define UNSIGNED32(X) (X##UL)
77 #define SIGNED32(X) (X##L)
81 typedef __int64 natural64;
82 typedef signed __int64 signed64;
83 typedef unsigned __int64 unsigned64;
85 #define UNSIGNED64(X) (X##ui64)
86 #define SIGNED64(X) (X##i64)
88 #define SIGNED32(X) (X)
89 #define UNSIGNED32(X) (X)
92 #else /* Not GNUC or WIN32 */
97 typedef natural8 natural_1;
98 typedef natural16 natural_2;
99 typedef natural32 natural_4;
100 typedef natural64 natural_8;
102 typedef signed8 signed_1;
103 typedef signed16 signed_2;
104 typedef signed32 signed_4;
105 typedef signed64 signed_8;
107 typedef unsigned8 unsigned_1;
108 typedef unsigned16 unsigned_2;
109 typedef unsigned32 unsigned_4;
110 typedef unsigned64 unsigned_8;
113 /* for general work, the following are defined */
114 /* unsigned: >= 32 bits */
115 /* signed: >= 32 bits */
116 /* long: >= 32 bits, sign undefined */
117 /* int: small indicator */
119 /* target architecture based */
120 #if (WITH_TARGET_WORD_BITSIZE == 64)
121 typedef natural64 natural_word;
122 typedef unsigned64 unsigned_word;
123 typedef signed64 signed_word;
125 typedef natural32 natural_word;
126 typedef unsigned32 unsigned_word;
127 typedef signed32 signed_word;
131 /* Other instructions */
132 typedef unsigned32 address_word;
134 /* IEEE 1275 cell size - only support 32bit mode at present */
135 typedef natural32 natural_cell;
136 typedef unsigned32 unsigned_cell;
137 typedef signed32 signed_cell;
139 #endif /* _SIM_TYPES_H_ */