]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blob - sim/common/cgen-types.h
Update year range in copyright notice of all files owned by the GDB project.
[thirdparty/binutils-gdb.git] / sim / common / cgen-types.h
1 /* Types for Cpu tools GENerated simulators.
2 Copyright (C) 1996-2015 Free Software Foundation, Inc.
3 Contributed by Cygnus Support.
4
5 This file is part of GDB, the GNU debugger.
6
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 3 of the License, or
10 (at your option) any later version.
11
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with this program. If not, see <http://www.gnu.org/licenses/>. */
19
20 /* This file is not included with cgen-sim.h as it defines types
21 needed by sim-base.h. */
22
23 #ifndef CGEN_TYPES_H
24 #define CGEN_TYPES_H
25
26 /* Miscellaneous cgen configury defined here as this file gets
27 included soon enough. */
28
29 /* Indicate we support --profile-model. */
30 #undef SIM_HAVE_MODEL
31 #define SIM_HAVE_MODEL
32
33 /* Indicate we support --{profile,trace}-{range,function}. */
34 #undef SIM_HAVE_ADDR_RANGE
35 #define SIM_HAVE_ADDR_RANGE
36
37 #ifdef __GNUC__
38 #define HAVE_LONGLONG
39 #undef DI_FN_SUPPORT
40 #else
41 #undef HAVE_LONGLONG
42 #define DI_FN_SUPPORT
43 #endif
44 \f
45 /* Mode support. */
46
47 /* Common mode types. */
48 /* ??? Target specific modes. */
49 typedef enum mode_type {
50 MODE_VOID, MODE_BI,
51 MODE_QI, MODE_HI, MODE_SI, MODE_DI,
52 MODE_UQI, MODE_UHI, MODE_USI, MODE_UDI,
53 MODE_SF, MODE_DF, MODE_XF, MODE_TF,
54 MODE_TARGET_MAX /* = MODE_TF? */,
55 /* These are host modes. */
56 MODE_INT, MODE_UINT, MODE_PTR, /*??? MODE_ADDR, MODE_IADDR,*/
57 MODE_MAX
58 } MODE_TYPE;
59
60 #define MAX_TARGET_MODES ((int) MODE_TARGET_MAX)
61 #define MAX_MODES ((int) MODE_MAX)
62
63 extern const char *mode_names[];
64 #define MODE_NAME(m) (mode_names[m])
65
66 typedef void VOID;
67 typedef unsigned char BI;
68 typedef signed8 QI;
69 typedef signed16 HI;
70 typedef signed32 SI;
71 typedef unsigned8 UQI;
72 typedef unsigned16 UHI;
73 typedef unsigned32 USI;
74
75 #ifdef HAVE_LONGLONG
76 typedef signed64 DI;
77 typedef unsigned64 UDI;
78 #define GETLODI(di) ((SI) (di))
79 #define GETHIDI(di) ((SI) ((UDI) (di) >> 32))
80 #define SETLODI(di, val) ((di) = (((di) & 0xffffffff00000000LL) | (val)))
81 #define SETHIDI(di, val) ((di) = (((di) & 0xffffffffLL) | (((DI) (val)) << 32)))
82 #define MAKEDI(hi, lo) ((((DI) (SI) (hi)) << 32) | ((UDI) (USI) (lo)))
83 #else
84 /* DI mode support if "long long" doesn't exist.
85 At one point CGEN supported K&R C compilers, and ANSI C compilers without
86 "long long". One can argue the various merits of keeping this in or
87 throwing it out. I went to the trouble of adding it so for the time being
88 I'm leaving it in. */
89 typedef struct { SI hi,lo; } DI;
90 typedef DI UDI;
91 #define GETLODI(di) ((di).lo)
92 #define GETHIDI(di) ((di).hi)
93 #define SETLODI(di, val) ((di).lo = (val))
94 #define SETHIDI(di, val) ((di).hi = (val))
95 extern DI make_struct_di (SI, SI);
96 #define MAKEDI(hi, lo) (make_struct_di ((hi), (lo)))
97 #endif
98
99 /* These are used to record extracted raw data from an instruction, among other
100 things. It must be a host data type, and not a target one. */
101 typedef int INT;
102 typedef unsigned int UINT;
103
104 typedef unsigned_address ADDR; /* FIXME: wip*/
105 typedef unsigned_address IADDR; /* FIXME: wip*/
106
107 /* fp types are in cgen-fpu.h */
108
109 #endif /* CGEN_TYPES_H */