Implement ERET instruction.
[deliverable/binutils-gdb.git] / sim / common / sim-types.h
1 /* This file is part of psim (model of the PowerPC(tm) architecture)
2
3 Copyright (C) 1994-1997, Andrew Cagney <cagney@highland.com.au>
4
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.
9
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.
14
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.
18
19 --
20
21 PowerPC is a trademark of International Business Machines Corporation. */
22
23
24 /* Basic type sizes for the PowerPC */
25
26 #ifndef _SIM_TYPES_H_
27 #define _SIM_TYPES_H_
28
29
30
31
32 /* INTEGER QUANTITIES:
33
34 TYPES:
35
36 natural* sign determined by host
37 signed* signed type of the given size
38 unsigned* The corresponding insigned type
39
40 SIZES
41
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)
48
49 */
50
51
52 /* bit based */
53 typedef char natural8;
54 typedef short natural16;
55 typedef long natural32;
56
57 typedef signed char signed8;
58 typedef signed short signed16;
59 typedef signed long signed32;
60
61 typedef unsigned char unsigned8;
62 typedef unsigned short unsigned16;
63 typedef unsigned long unsigned32;
64
65 #if defined __GNUC__ || defined _MSC_VER
66 #ifdef __GNUC__
67
68 /* GDB sometimes likes to make what appear to be signed `0x*L' values
69 unsigned by default */
70
71 typedef long long natural64;
72 typedef signed long long signed64;
73 typedef unsigned long long unsigned64;
74
75 #define UNSIGNED64(X) (X##ULL)
76 #define SIGNED64(X) ((signed64) X##LL)
77
78 #define UNSIGNED32(X) (X##UL)
79 #define SIGNED32(X) ((signed32) X##L)
80
81 #else /* _MSC_VER */
82
83 typedef __int64 natural64;
84 typedef signed __int64 signed64;
85 typedef unsigned __int64 unsigned64;
86
87 #define UNSIGNED64(X) (X##ui64)
88 #define SIGNED64(X) (X##i64)
89
90 #define SIGNED32(X) (X##ui32)
91 #define UNSIGNED32(X) (X##i32)
92
93 #endif /* _MSC_VER */
94
95 typedef struct { unsigned64 a[2]; } unsigned128;
96 typedef struct { signed64 a[2]; } signed128;
97
98 #else /* Not GNUC or _MSC_VER */
99 /* Not supported */
100 #endif
101
102 /* byte based */
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; */
108
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;
114
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;
120
121
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 */
127
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;
133 #endif
134 #if (WITH_TARGET_WORD_BITSIZE == 32)
135 typedef natural32 natural_word;
136 typedef unsigned32 unsigned_word;
137 typedef signed32 signed_word;
138 #endif
139
140
141 /* Other instructions */
142 #if (WITH_TARGET_ADDRESS_BITSIZE == 64)
143 typedef unsigned64 unsigned_address;
144 typedef signed64 signed_address;
145 #endif
146 #if (WITH_TARGET_ADDRESS_BITSIZE == 32)
147 typedef unsigned32 unsigned_address;
148 typedef signed32 signed_address;
149 #endif
150 typedef unsigned_address address_word;
151
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;
157 #endif
158 #if (WITH_TARGET_CELL_BITSIZE == 32)
159 typedef natural32 natural_cell;
160 typedef unsigned32 unsigned_cell;
161 typedef signed32 signed_cell;
162 #endif
163
164 /* Floating point registers */
165 #if (WITH_TARGET_FLOATING_POINT_BITSIZE == 64)
166 typedef unsigned64 fp_word;
167 #endif
168 #if (WITH_TARGET_FLOATING_POINT_BITSIZE == 32)
169 typedef unsigned32 fp_word;
170 #endif
171
172
173 #endif /* _SIM_TYPES_H_ */
This page took 0.035776 seconds and 4 git commands to generate.