1*e415d488SLionel Sambuc /* $NetBSD: mips-gcc.h,v 1.5 2011/06/27 06:40:26 matt Exp $ */ 22fe8fb19SBen Gras 32fe8fb19SBen Gras /* 42fe8fb19SBen Gras ------------------------------------------------------------------------------- 52fe8fb19SBen Gras One of the macros `BIGENDIAN' or `LITTLEENDIAN' must be defined. 62fe8fb19SBen Gras ------------------------------------------------------------------------------- 72fe8fb19SBen Gras */ 82fe8fb19SBen Gras #ifdef __MIPSEB__ 92fe8fb19SBen Gras #define BIGENDIAN 102fe8fb19SBen Gras #else 112fe8fb19SBen Gras #define LITTLEENDIAN 122fe8fb19SBen Gras #endif 132fe8fb19SBen Gras 142fe8fb19SBen Gras /* 152fe8fb19SBen Gras ------------------------------------------------------------------------------- 162fe8fb19SBen Gras The macro `BITS64' can be defined to indicate that 64-bit integer types are 172fe8fb19SBen Gras supported by the compiler. 182fe8fb19SBen Gras ------------------------------------------------------------------------------- 192fe8fb19SBen Gras */ 202fe8fb19SBen Gras #define BITS64 212fe8fb19SBen Gras 222fe8fb19SBen Gras /* 232fe8fb19SBen Gras ------------------------------------------------------------------------------- 242fe8fb19SBen Gras Each of the following `typedef's defines the most convenient type that holds 252fe8fb19SBen Gras integers of at least as many bits as specified. For example, `uint8' should 262fe8fb19SBen Gras be the most convenient type that can hold unsigned integers of as many as 272fe8fb19SBen Gras 8 bits. The `flag' type must be able to hold either a 0 or 1. For most 282fe8fb19SBen Gras implementations of C, `flag', `uint8', and `int8' should all be `typedef'ed 292fe8fb19SBen Gras to the same as `int'. 302fe8fb19SBen Gras ------------------------------------------------------------------------------- 312fe8fb19SBen Gras */ 322fe8fb19SBen Gras typedef int flag; 332fe8fb19SBen Gras typedef int uint8; 342fe8fb19SBen Gras typedef int int8; 352fe8fb19SBen Gras typedef int uint16; 362fe8fb19SBen Gras typedef int int16; 372fe8fb19SBen Gras typedef unsigned int uint32; 382fe8fb19SBen Gras typedef signed int int32; 392fe8fb19SBen Gras #ifdef BITS64 402fe8fb19SBen Gras typedef unsigned long long int uint64; 412fe8fb19SBen Gras typedef signed long long int int64; 422fe8fb19SBen Gras #endif 432fe8fb19SBen Gras 442fe8fb19SBen Gras /* 452fe8fb19SBen Gras ------------------------------------------------------------------------------- 462fe8fb19SBen Gras Each of the following `typedef's defines a type that holds integers 472fe8fb19SBen Gras of _exactly_ the number of bits specified. For instance, for most 482fe8fb19SBen Gras implementation of C, `bits16' and `sbits16' should be `typedef'ed to 492fe8fb19SBen Gras `unsigned short int' and `signed short int' (or `short int'), respectively. 502fe8fb19SBen Gras ------------------------------------------------------------------------------- 512fe8fb19SBen Gras */ 522fe8fb19SBen Gras typedef unsigned char bits8; 532fe8fb19SBen Gras typedef signed char sbits8; 542fe8fb19SBen Gras typedef unsigned short int bits16; 552fe8fb19SBen Gras typedef signed short int sbits16; 562fe8fb19SBen Gras typedef unsigned int bits32; 572fe8fb19SBen Gras typedef signed int sbits32; 582fe8fb19SBen Gras #ifdef BITS64 592fe8fb19SBen Gras typedef unsigned long long int bits64; 602fe8fb19SBen Gras typedef signed long long int sbits64; 612fe8fb19SBen Gras #endif 622fe8fb19SBen Gras 632fe8fb19SBen Gras #ifdef BITS64 642fe8fb19SBen Gras /* 652fe8fb19SBen Gras ------------------------------------------------------------------------------- 662fe8fb19SBen Gras The `LIT64' macro takes as its argument a textual integer literal and 672fe8fb19SBen Gras if necessary ``marks'' the literal as having a 64-bit integer type. 682fe8fb19SBen Gras For example, the GNU C Compiler (`gcc') requires that 64-bit literals be 692fe8fb19SBen Gras appended with the letters `LL' standing for `long long', which is `gcc's 702fe8fb19SBen Gras name for the 64-bit integer type. Some compilers may allow `LIT64' to be 712fe8fb19SBen Gras defined as the identity macro: `#define LIT64( a ) a'. 722fe8fb19SBen Gras ------------------------------------------------------------------------------- 732fe8fb19SBen Gras */ 742fe8fb19SBen Gras #define LIT64( a ) a##LL 752fe8fb19SBen Gras #endif 762fe8fb19SBen Gras 772fe8fb19SBen Gras /* 782fe8fb19SBen Gras ------------------------------------------------------------------------------- 792fe8fb19SBen Gras The macro `INLINE' can be used before functions that should be inlined. If 802fe8fb19SBen Gras a compiler does not support explicit inlining, this macro should be defined 812fe8fb19SBen Gras to be `static'. 822fe8fb19SBen Gras ------------------------------------------------------------------------------- 832fe8fb19SBen Gras */ 842fe8fb19SBen Gras #define INLINE static inline 852fe8fb19SBen Gras 862fe8fb19SBen Gras /* 872fe8fb19SBen Gras ------------------------------------------------------------------------------- 88*e415d488SLionel Sambuc The MIPS FPA is odd in that it stores doubles high-order word first, no matter 892fe8fb19SBen Gras what the endianness of the CPU. VFP is sane. 902fe8fb19SBen Gras ------------------------------------------------------------------------------- 912fe8fb19SBen Gras */ 922fe8fb19SBen Gras #if defined(SOFTFLOAT_FOR_GCC) 932fe8fb19SBen Gras #define FLOAT64_DEMANGLE(a) (a) 942fe8fb19SBen Gras #define FLOAT64_MANGLE(a) (a) 952fe8fb19SBen Gras #endif 96