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