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