1/* $NetBSD: mips-gcc.h,v 1.4 2011/02/25 11:55:28 pooka Exp $ */
2
3/*
4-------------------------------------------------------------------------------
5One of the macros `BIGENDIAN' or `LITTLEENDIAN' must be defined.
6-------------------------------------------------------------------------------
7*/
8#ifdef __MIPSEB__
9#define BIGENDIAN
10#else
11#define LITTLEENDIAN
12#endif
13
14/*
15-------------------------------------------------------------------------------
16The macro `BITS64' can be defined to indicate that 64-bit integer types are
17supported by the compiler.
18-------------------------------------------------------------------------------
19*/
20#define BITS64
21
22/*
23-------------------------------------------------------------------------------
24Each of the following `typedef's defines the most convenient type that holds
25integers of at least as many bits as specified.  For example, `uint8' should
26be the most convenient type that can hold unsigned integers of as many as
278 bits.  The `flag' type must be able to hold either a 0 or 1.  For most
28implementations of C, `flag', `uint8', and `int8' should all be `typedef'ed
29to the same as `int'.
30-------------------------------------------------------------------------------
31*/
32typedef int flag;
33typedef int uint8;
34typedef int int8;
35typedef int uint16;
36typedef int int16;
37typedef unsigned int uint32;
38typedef signed int int32;
39#ifdef BITS64
40typedef unsigned long long int uint64;
41typedef signed long long int int64;
42#endif
43
44/*
45-------------------------------------------------------------------------------
46Each of the following `typedef's defines a type that holds integers
47of _exactly_ the number of bits specified.  For instance, for most
48implementation of C, `bits16' and `sbits16' should be `typedef'ed to
49`unsigned short int' and `signed short int' (or `short int'), respectively.
50-------------------------------------------------------------------------------
51*/
52typedef unsigned char bits8;
53typedef signed char sbits8;
54typedef unsigned short int bits16;
55typedef signed short int sbits16;
56typedef unsigned int bits32;
57typedef signed int sbits32;
58#ifdef BITS64
59typedef unsigned long long int bits64;
60typedef signed long long int sbits64;
61#endif
62
63#ifdef BITS64
64/*
65-------------------------------------------------------------------------------
66The `LIT64' macro takes as its argument a textual integer literal and
67if necessary ``marks'' the literal as having a 64-bit integer type.
68For example, the GNU C Compiler (`gcc') requires that 64-bit literals be
69appended with the letters `LL' standing for `long long', which is `gcc's
70name for the 64-bit integer type.  Some compilers may allow `LIT64' to be
71defined as the identity macro:  `#define LIT64( a ) a'.
72-------------------------------------------------------------------------------
73*/
74#define LIT64( a ) a##LL
75#endif
76
77/*
78-------------------------------------------------------------------------------
79The macro `INLINE' can be used before functions that should be inlined.  If
80a compiler does not support explicit inlining, this macro should be defined
81to be `static'.
82-------------------------------------------------------------------------------
83*/
84#define INLINE static inline
85
86/*
87-------------------------------------------------------------------------------
88The MIPS FPA is odd in that it stores doubles high-order word first, no matter
89what the endianness of the CPU.  VFP is sane.
90-------------------------------------------------------------------------------
91*/
92#if defined(SOFTFLOAT_FOR_GCC)
93#define FLOAT64_DEMANGLE(a)	(a)
94#define FLOAT64_MANGLE(a)	(a)
95#endif
96