1 |
349 |
julius |
/*
|
2 |
|
|
Modified for use with or1ksim's testsuite.
|
3 |
|
|
|
4 |
|
|
Contributor Julius Baxter <julius.baxter@orsoc.se>
|
5 |
|
|
*/
|
6 |
|
|
/*
|
7 |
|
|
-------------------------------------------------------------------------------
|
8 |
|
|
One of the macros `BIGENDIAN' or `LITTLEENDIAN' must be defined.
|
9 |
|
|
-------------------------------------------------------------------------------
|
10 |
|
|
*/
|
11 |
|
|
#define BIGENDIAN
|
12 |
|
|
|
13 |
|
|
/*
|
14 |
|
|
-------------------------------------------------------------------------------
|
15 |
|
|
The macro `BITS64' can be defined to indicate that 64-bit integer types are
|
16 |
|
|
supported by the compiler.
|
17 |
|
|
-------------------------------------------------------------------------------
|
18 |
|
|
*/
|
19 |
|
|
#define BITS64
|
20 |
|
|
|
21 |
|
|
/*
|
22 |
|
|
-------------------------------------------------------------------------------
|
23 |
|
|
Each of the following `typedef's defines the most convenient type that holds
|
24 |
|
|
integers of at least as many bits as specified. For example, `uint8' should
|
25 |
|
|
be the most convenient type that can hold unsigned integers of as many as
|
26 |
|
|
8 bits. The `flag' type must be able to hold either a 0 or 1. For most
|
27 |
|
|
implementations of C, `flag', `uint8', and `int8' should all be `typedef'ed
|
28 |
|
|
to the same as `int'.
|
29 |
|
|
-------------------------------------------------------------------------------
|
30 |
|
|
*/
|
31 |
|
|
typedef char flag;
|
32 |
|
|
typedef unsigned char uint8;
|
33 |
|
|
typedef signed char int8;
|
34 |
|
|
typedef int uint16;
|
35 |
|
|
typedef int int16;
|
36 |
|
|
typedef unsigned int uint32;
|
37 |
|
|
typedef signed int int32;
|
38 |
|
|
#ifdef BITS64
|
39 |
|
|
typedef unsigned long long int uint64;
|
40 |
|
|
typedef signed long long int int64;
|
41 |
|
|
#endif
|
42 |
|
|
|
43 |
|
|
/*
|
44 |
|
|
-------------------------------------------------------------------------------
|
45 |
|
|
Each of the following `typedef's defines a type that holds integers
|
46 |
|
|
of _exactly_ the number of bits specified. For instance, for most
|
47 |
|
|
implementation of C, `bits16' and `sbits16' should be `typedef'ed to
|
48 |
|
|
`unsigned short int' and `signed short int' (or `short int'), respectively.
|
49 |
|
|
-------------------------------------------------------------------------------
|
50 |
|
|
*/
|
51 |
|
|
typedef unsigned char bits8;
|
52 |
|
|
typedef signed char sbits8;
|
53 |
|
|
typedef unsigned short int bits16;
|
54 |
|
|
typedef signed short int sbits16;
|
55 |
|
|
typedef unsigned int bits32;
|
56 |
|
|
typedef signed int sbits32;
|
57 |
|
|
#ifdef BITS64
|
58 |
|
|
typedef unsigned long long int bits64;
|
59 |
|
|
typedef signed long long int sbits64;
|
60 |
|
|
#endif
|
61 |
|
|
|
62 |
|
|
#ifdef BITS64
|
63 |
|
|
/*
|
64 |
|
|
-------------------------------------------------------------------------------
|
65 |
|
|
The `LIT64' macro takes as its argument a textual integer literal and
|
66 |
|
|
if necessary ``marks'' the literal as having a 64-bit integer type.
|
67 |
|
|
For example, the GNU C Compiler (`gcc') requires that 64-bit literals be
|
68 |
|
|
appended with the letters `LL' standing for `long long', which is `gcc's
|
69 |
|
|
name for the 64-bit integer type. Some compilers may allow `LIT64' to be
|
70 |
|
|
defined as the identity macro: `#define LIT64( a ) a'.
|
71 |
|
|
-------------------------------------------------------------------------------
|
72 |
|
|
*/
|
73 |
|
|
#define LIT64( a ) a##LL
|
74 |
|
|
#endif
|
75 |
|
|
|
76 |
|
|
/*
|
77 |
|
|
-------------------------------------------------------------------------------
|
78 |
|
|
The macro `INLINE' can be used before functions that should be inlined. If
|
79 |
|
|
a compiler does not support explicit inlining, this macro should be defined
|
80 |
|
|
to be `static'.
|
81 |
|
|
-------------------------------------------------------------------------------
|
82 |
|
|
*/
|
83 |
|
|
//#define INLINE extern inline
|
84 |
|
|
#define INLINE static
|
85 |
|
|
|