OSDN Git Service

* public snapshot of sid simulator
[pf3gnuchains/pf3gnuchains3x.git] / sid / component / cgen-cpu / cgen-types.h
1 // cgen-types.h - Types for CGEN-based SID simulators.  -*- C++ -*-
2
3 // Copyright (C) 1999, 2000 Red Hat.
4 // This file is part of SID and is licensed under the GPL.
5 // See the file COPYING.SID for conditions for redistribution.
6
7 #ifndef CGEN_TYPES_H
8 #define CGEN_TYPES_H
9
10 namespace cgen {
11
12 // Modes.
13
14 typedef bool BI;
15
16 typedef sid::signed_host_int_1 QI;
17 typedef sid::signed_host_int_2 HI;
18 typedef sid::signed_host_int_4 SI;
19 typedef sid::signed_host_int_8 DI;
20
21 typedef sid::host_int_1 UQI;
22 typedef sid::host_int_2 UHI;
23 typedef sid::host_int_4 USI;
24 typedef sid::host_int_8 UDI;
25
26 #define GETLODI(di) ((SI) (di))
27 #define GETHIDI(di) ((SI) ((UDI) (di) >> 32))
28 #define SETLODI(di, val) ((di) = (((di) & 0xffffffff00000000LL) | (val)))
29 #define SETHIDI(di, val) ((di) = (((di) & 0xffffffffLL) | (((DI) (val)) << 32)))
30 #define SETDI(di, hi, lo) ((di) = MAKEDI (hi, lo))
31 #define MAKEDI(hi, lo) ((((DI) (SI) (hi)) << 32) | ((UDI) (USI) (lo)))
32
33 // Variable width small ints.
34 typedef int INT;
35 typedef unsigned int UINT;
36
37 // Addresses.
38 // Instruction addresses.
39 typedef unsigned long IADDR;
40 // Data addresses.
41 typedef unsigned long ADDR;
42 // Deprecated.
43 typedef IADDR PCADDR;
44
45 } // namespace cgen
46
47 #endif // CGEN_TYPES_H