1 /* The common simulator framework for GDB, the GNU Debugger.
3 Copyright 2002-2015 Free Software Foundation, Inc.
5 Contributed by Andrew Cagney and Red Hat.
7 This file is part of GDB.
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 3 of the License, or
12 (at your option) any later version.
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License
20 along with this program. If not, see <http://www.gnu.org/licenses/>. */
28 /* INTEGER QUANTITIES:
32 signed* signed type of the given size
33 unsigned* The corresponding insigned type
37 *NN Size based on the number of bits
38 *_NN Size according to the number of bytes
39 *_word Size based on the target architecture's word
40 word size (32/64 bits)
41 *_cell Size based on the target architecture's
42 IEEE 1275 cell size (almost always 32 bits)
50 # define UNSIGNED32(X) (X##ui32)
51 # define UNSIGNED64(X) (X##ui64)
52 # define SIGNED32(X) (X##i32)
53 # define SIGNED64(X) (X##i64)
55 # define UNSIGNED32(X) ((unsigned32) X##UL)
56 # define UNSIGNED64(X) ((unsigned64) X##ULL)
57 # define SIGNED32(X) ((signed32) X##L)
58 # define SIGNED64(X) ((signed64) X##LL)
61 typedef int8_t signed8
;
62 typedef int16_t signed16
;
63 typedef int32_t signed32
;
64 typedef int64_t signed64
;
66 typedef uint8_t unsigned8
;
67 typedef uint16_t unsigned16
;
68 typedef uint32_t unsigned32
;
69 typedef uint64_t unsigned64
;
71 typedef struct { unsigned64 a
[2]; } unsigned128
;
72 typedef struct { signed64 a
[2]; } signed128
;
77 typedef signed8 signed_1
;
78 typedef signed16 signed_2
;
79 typedef signed32 signed_4
;
80 typedef signed64 signed_8
;
81 typedef signed128 signed_16
;
83 typedef unsigned8 unsigned_1
;
84 typedef unsigned16 unsigned_2
;
85 typedef unsigned32 unsigned_4
;
86 typedef unsigned64 unsigned_8
;
87 typedef unsigned128 unsigned_16
;
90 /* for general work, the following are defined */
91 /* unsigned: >= 32 bits */
92 /* signed: >= 32 bits */
93 /* long: >= 32 bits, sign undefined */
94 /* int: small indicator */
96 /* target architecture based */
97 #if (WITH_TARGET_WORD_BITSIZE == 64)
98 typedef unsigned64 unsigned_word
;
99 typedef signed64 signed_word
;
101 #if (WITH_TARGET_WORD_BITSIZE == 32)
102 typedef unsigned32 unsigned_word
;
103 typedef signed32 signed_word
;
105 #if (WITH_TARGET_WORD_BITSIZE == 16)
106 typedef unsigned16 unsigned_word
;
107 typedef signed16 signed_word
;
111 /* Other instructions */
112 #if (WITH_TARGET_ADDRESS_BITSIZE == 64)
113 typedef unsigned64 unsigned_address
;
114 typedef signed64 signed_address
;
116 #if (WITH_TARGET_ADDRESS_BITSIZE == 32)
117 typedef unsigned32 unsigned_address
;
118 typedef signed32 signed_address
;
120 #if (WITH_TARGET_ADDRESS_BITSIZE == 16)
121 typedef unsigned16 unsigned_address
;
122 typedef signed16 signed_address
;
124 typedef unsigned_address address_word
;
127 /* IEEE 1275 cell size */
128 #if (WITH_TARGET_CELL_BITSIZE == 64)
129 typedef unsigned64 unsigned_cell
;
130 typedef signed64 signed_cell
;
132 #if (WITH_TARGET_CELL_BITSIZE == 32)
133 typedef unsigned32 unsigned_cell
;
134 typedef signed32 signed_cell
;
136 typedef signed_cell cell_word
; /* cells are normally signed */
139 /* Floating point registers */
140 #if (WITH_TARGET_FLOATING_POINT_BITSIZE == 64)
141 typedef unsigned64 fp_word
;
143 #if (WITH_TARGET_FLOATING_POINT_BITSIZE == 32)
144 typedef unsigned32 fp_word
;