]>
git.ipfire.org Git - thirdparty/binutils-gdb.git/blob - sim/common/sim-types.h
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 typedef long long natural64
;
69 typedef signed long long signed64
;
70 typedef unsigned long long unsigned64
;
71 typedef struct { unsigned64 a
[2]; } unsigned128
;
72 typedef struct { signed64 a
[2]; } signed128
;
74 #define UNSIGNED64(X) (X##ULL)
75 #define SIGNED64(X) (X##LL)
77 #define UNSIGNED32(X) (X##UL)
78 #define SIGNED32(X) (X##L)
82 typedef __int64 natural64
;
83 typedef signed __int64 signed64
;
84 typedef unsigned __int64 unsigned64
;
85 typeded
struct { unsigned64 hi
; unsigned64 lo
; } unsigned128
;
86 typeded
struct { signed64 hi
; signed64 lo
; } signed128
;
88 #define UNSIGNED64(X) (X##ui64)
89 #define SIGNED64(X) (X##i64)
91 #define SIGNED32(X) (X##ui32)
92 #define UNSIGNED32(X) (X##i32)
95 #else /* Not GNUC or _MSC_VER */
100 typedef natural8 natural_1
;
101 typedef natural16 natural_2
;
102 typedef natural32 natural_4
;
103 typedef natural64 natural_8
;
104 /* typedef natural64 natural_8; */
106 typedef signed8 signed_1
;
107 typedef signed16 signed_2
;
108 typedef signed32 signed_4
;
109 typedef signed64 signed_8
;
110 typedef signed128 signed_16
;
112 typedef unsigned8 unsigned_1
;
113 typedef unsigned16 unsigned_2
;
114 typedef unsigned32 unsigned_4
;
115 typedef unsigned64 unsigned_8
;
116 typedef unsigned128 unsigned_16
;
119 /* for general work, the following are defined */
120 /* unsigned: >= 32 bits */
121 /* signed: >= 32 bits */
122 /* long: >= 32 bits, sign undefined */
123 /* int: small indicator */
125 /* target architecture based */
126 #if (WITH_TARGET_WORD_BITSIZE == 64)
127 typedef natural64 natural_word
;
128 typedef unsigned64 unsigned_word
;
129 typedef signed64 signed_word
;
131 #if (WITH_TARGET_WORD_BITSIZE == 32)
132 typedef natural32 natural_word
;
133 typedef unsigned32 unsigned_word
;
134 typedef signed32 signed_word
;
138 /* Other instructions */
139 typedef unsigned32 address_word
;
141 /* IEEE 1275 cell size - only support 32bit mode at present */
142 typedef natural32 natural_cell
;
143 typedef unsigned32 unsigned_cell
;
144 typedef signed32 signed_cell
;
146 #endif /* _SIM_TYPES_H_ */