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