OSDN Git Service

a823e721d4fdbb2241d864ecfefa0faf2b61b3e1
[pf3gnuchains/pf3gnuchains4x.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, 2010 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 typedef void VOID;
16
17 typedef sid::signed_host_int_1 QI;
18 typedef sid::signed_host_int_2 HI;
19 typedef sid::signed_host_int_4 SI;
20 typedef sid::signed_host_int_8 DI;
21
22 typedef sid::host_int_1 UQI;
23 typedef sid::host_int_2 UHI;
24 typedef sid::host_int_4 USI;
25 typedef sid::host_int_8 UDI;
26
27 typedef USI SF;
28 typedef UDI DF;
29
30 #define GETLODI(di) ((SI) (di))
31 #define GETHIDI(di) ((SI) ((UDI) (di) >> 32))
32 #define SETLODI(di, val) ((di) = (((di) & 0xffffffff00000000LL) | (val)))
33 #define SETHIDI(di, val) ((di) = (((di) & 0xffffffffLL) | (((DI) (val)) << 32)))
34 #define SETDI(di, hi, lo) ((di) = MAKEDI (hi, lo))
35 #define MAKEDI(hi, lo) ((((DI) (SI) (hi)) << 32) | ((UDI) (USI) (lo)))
36
37 // Variable width small ints.
38 typedef int INT;
39 typedef unsigned int UINT;
40
41 // Addresses.
42 // Instruction addresses.
43 typedef unsigned long IADDR;
44 // Data addresses.
45 typedef unsigned long ADDR;
46 // Deprecated.
47 typedef IADDR PCADDR;  
48
49 // Builtin floating point conversion kinds.
50 // The values here are defined by cgen.
51
52 enum fpconv_kind {
53   FPCONV_DEFAULT = 0,
54   FPCONV_TIES_TO_EVEN = 1,
55   FPCONV_TIES_TO_AWAY = 2,
56   FPCONV_TOWARD_ZERO = 3,
57   FPCONV_TOWARD_POSITIVE = 4,
58   FPCONV_TOWARD_NEGATIVE = 5
59 };
60
61 } // namespace cgen
62
63 #endif // CGEN_TYPES_H