* sun build fix for thinko (?)
[deliverable/binutils-gdb.git] / sim / common / sim-types.h
CommitLineData
30efae3a
AC
1/* This file is part of psim (model of the PowerPC(tm) architecture)
2
f45dd42b 3 Copyright (C) 1994-1997, Andrew Cagney <cagney@highland.com.au>
30efae3a
AC
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
d32658fe
AC
26#ifndef SIM_TYPES_H
27#define SIM_TYPES_H
30efae3a
AC
28
29
30/* INTEGER QUANTITIES:
31
32 TYPES:
33
34 natural* sign determined by host
35 signed* signed type of the given size
36 unsigned* The corresponding insigned type
37
38 SIZES
39
40 *NN Size based on the number of bits
41 *_NN Size according to the number of bytes
42 *_word Size based on the target architecture's word
43 word size (32/64 bits)
44 *_cell Size based on the target architecture's
45 IEEE 1275 cell size (almost always 32 bits)
d32658fe
AC
46 *_address Fits target address
47
48 NONSPECIFIC
49
50 address_word
51 Alias for unsigned_address
52
53 cell_word Alias for signed_cell
54
55 fp_word Holds a floating point word.
30efae3a
AC
56
57*/
58
59
60/* bit based */
61typedef char natural8;
62typedef short natural16;
63typedef long natural32;
64
65typedef signed char signed8;
66typedef signed short signed16;
67typedef signed long signed32;
68
69typedef unsigned char unsigned8;
70typedef unsigned short unsigned16;
71typedef unsigned long unsigned32;
72
f45dd42b 73#if defined __GNUC__ || defined _MSC_VER
30efae3a
AC
74#ifdef __GNUC__
75
97f4d183
AC
76/* GDB sometimes likes to make what appear to be signed `0x*L' values
77 unsigned by default */
78
30efae3a
AC
79typedef long long natural64;
80typedef signed long long signed64;
81typedef unsigned long long unsigned64;
82
83#define UNSIGNED64(X) (X##ULL)
97f4d183 84#define SIGNED64(X) ((signed64) X##LL)
30efae3a
AC
85
86#define UNSIGNED32(X) (X##UL)
97f4d183 87#define SIGNED32(X) ((signed32) X##L)
30efae3a 88
f45dd42b 89#else /* _MSC_VER */
30efae3a
AC
90
91typedef __int64 natural64;
92typedef signed __int64 signed64;
93typedef unsigned __int64 unsigned64;
94
95#define UNSIGNED64(X) (X##ui64)
96#define SIGNED64(X) (X##i64)
97
f45dd42b
AC
98#define SIGNED32(X) (X##ui32)
99#define UNSIGNED32(X) (X##i32)
30efae3a 100
f45dd42b 101#endif /* _MSC_VER */
412c4e94
AC
102
103typedef struct { unsigned64 a[2]; } unsigned128;
104typedef struct { signed64 a[2]; } signed128;
105
f45dd42b 106#else /* Not GNUC or _MSC_VER */
30efae3a
AC
107/* Not supported */
108#endif
109
110/* byte based */
111typedef natural8 natural_1;
112typedef natural16 natural_2;
113typedef natural32 natural_4;
114typedef natural64 natural_8;
f45dd42b 115/* typedef natural64 natural_8; */
30efae3a
AC
116
117typedef signed8 signed_1;
118typedef signed16 signed_2;
119typedef signed32 signed_4;
120typedef signed64 signed_8;
f45dd42b 121typedef signed128 signed_16;
30efae3a
AC
122
123typedef unsigned8 unsigned_1;
124typedef unsigned16 unsigned_2;
125typedef unsigned32 unsigned_4;
126typedef unsigned64 unsigned_8;
f45dd42b 127typedef unsigned128 unsigned_16;
30efae3a
AC
128
129
130/* for general work, the following are defined */
131/* unsigned: >= 32 bits */
132/* signed: >= 32 bits */
133/* long: >= 32 bits, sign undefined */
134/* int: small indicator */
135
136/* target architecture based */
137#if (WITH_TARGET_WORD_BITSIZE == 64)
138typedef natural64 natural_word;
139typedef unsigned64 unsigned_word;
140typedef signed64 signed_word;
f45dd42b
AC
141#endif
142#if (WITH_TARGET_WORD_BITSIZE == 32)
30efae3a
AC
143typedef natural32 natural_word;
144typedef unsigned32 unsigned_word;
145typedef signed32 signed_word;
146#endif
147
148
149/* Other instructions */
412c4e94 150#if (WITH_TARGET_ADDRESS_BITSIZE == 64)
97f4d183
AC
151typedef unsigned64 unsigned_address;
152typedef signed64 signed_address;
412c4e94
AC
153#endif
154#if (WITH_TARGET_ADDRESS_BITSIZE == 32)
97f4d183
AC
155typedef unsigned32 unsigned_address;
156typedef signed32 signed_address;
412c4e94 157#endif
97f4d183 158typedef unsigned_address address_word;
30efae3a 159
412c4e94
AC
160/* IEEE 1275 cell size */
161#if (WITH_TARGET_CELL_BITSIZE == 64)
162typedef natural64 natural_cell;
163typedef unsigned64 unsigned_cell;
164typedef signed64 signed_cell;
165#endif
166#if (WITH_TARGET_CELL_BITSIZE == 32)
30efae3a
AC
167typedef natural32 natural_cell;
168typedef unsigned32 unsigned_cell;
169typedef signed32 signed_cell;
412c4e94 170#endif
30efae3a 171
97f4d183
AC
172/* Floating point registers */
173#if (WITH_TARGET_FLOATING_POINT_BITSIZE == 64)
174typedef unsigned64 fp_word;
175#endif
176#if (WITH_TARGET_FLOATING_POINT_BITSIZE == 32)
177typedef unsigned32 fp_word;
178#endif
179
180
d32658fe 181#endif
This page took 0.070183 seconds and 4 git commands to generate.