11.4Smatt/* $NetBSD: arm-gcc.h,v 1.4 2013/01/26 07:08:14 matt Exp $ */ 21.1Sbjh21 31.1Sbjh21/* 41.1Sbjh21------------------------------------------------------------------------------- 51.1Sbjh21One of the macros `BIGENDIAN' or `LITTLEENDIAN' must be defined. 61.1Sbjh21------------------------------------------------------------------------------- 71.1Sbjh21*/ 81.2Sbjh21#ifdef __ARMEB__ 91.2Sbjh21#define BIGENDIAN 101.2Sbjh21#else 111.1Sbjh21#define LITTLEENDIAN 121.2Sbjh21#endif 131.1Sbjh21 141.1Sbjh21/* 151.1Sbjh21------------------------------------------------------------------------------- 161.1Sbjh21The macro `BITS64' can be defined to indicate that 64-bit integer types are 171.1Sbjh21supported by the compiler. 181.1Sbjh21------------------------------------------------------------------------------- 191.1Sbjh21*/ 201.1Sbjh21#define BITS64 211.1Sbjh21 221.1Sbjh21/* 231.1Sbjh21------------------------------------------------------------------------------- 241.1Sbjh21Each of the following `typedef's defines the most convenient type that holds 251.1Sbjh21integers of at least as many bits as specified. For example, `uint8' should 261.1Sbjh21be the most convenient type that can hold unsigned integers of as many as 271.1Sbjh218 bits. The `flag' type must be able to hold either a 0 or 1. For most 281.1Sbjh21implementations of C, `flag', `uint8', and `int8' should all be `typedef'ed 291.1Sbjh21to the same as `int'. 301.1Sbjh21------------------------------------------------------------------------------- 311.1Sbjh21*/ 321.1Sbjh21typedef int flag; 331.1Sbjh21typedef int uint8; 341.1Sbjh21typedef int int8; 351.1Sbjh21typedef int uint16; 361.1Sbjh21typedef int int16; 371.1Sbjh21typedef unsigned int uint32; 381.1Sbjh21typedef signed int int32; 391.1Sbjh21#ifdef BITS64 401.1Sbjh21typedef unsigned long long int uint64; 411.1Sbjh21typedef signed long long int int64; 421.1Sbjh21#endif 431.1Sbjh21 441.1Sbjh21/* 451.1Sbjh21------------------------------------------------------------------------------- 461.1Sbjh21Each of the following `typedef's defines a type that holds integers 471.1Sbjh21of _exactly_ the number of bits specified. For instance, for most 481.1Sbjh21implementation of C, `bits16' and `sbits16' should be `typedef'ed to 491.1Sbjh21`unsigned short int' and `signed short int' (or `short int'), respectively. 501.1Sbjh21------------------------------------------------------------------------------- 511.1Sbjh21*/ 521.1Sbjh21typedef unsigned char bits8; 531.1Sbjh21typedef signed char sbits8; 541.1Sbjh21typedef unsigned short int bits16; 551.1Sbjh21typedef signed short int sbits16; 561.1Sbjh21typedef unsigned int bits32; 571.1Sbjh21typedef signed int sbits32; 581.1Sbjh21#ifdef BITS64 591.1Sbjh21typedef unsigned long long int bits64; 601.1Sbjh21typedef signed long long int sbits64; 611.1Sbjh21#endif 621.1Sbjh21 631.1Sbjh21#ifdef BITS64 641.1Sbjh21/* 651.1Sbjh21------------------------------------------------------------------------------- 661.1Sbjh21The `LIT64' macro takes as its argument a textual integer literal and 671.1Sbjh21if necessary ``marks'' the literal as having a 64-bit integer type. 681.1Sbjh21For example, the GNU C Compiler (`gcc') requires that 64-bit literals be 691.1Sbjh21appended with the letters `LL' standing for `long long', which is `gcc's 701.1Sbjh21name for the 64-bit integer type. Some compilers may allow `LIT64' to be 711.1Sbjh21defined as the identity macro: `#define LIT64( a ) a'. 721.1Sbjh21------------------------------------------------------------------------------- 731.1Sbjh21*/ 741.4Smatt#define LIT64( a ) a##ULL 751.1Sbjh21#endif 761.1Sbjh21 771.1Sbjh21/* 781.1Sbjh21------------------------------------------------------------------------------- 791.1Sbjh21The macro `INLINE' can be used before functions that should be inlined. If 801.1Sbjh21a compiler does not support explicit inlining, this macro should be defined 811.1Sbjh21to be `static'. 821.1Sbjh21------------------------------------------------------------------------------- 831.1Sbjh21*/ 841.3Sperry#define INLINE static inline 851.1Sbjh21 861.1Sbjh21/* 871.1Sbjh21------------------------------------------------------------------------------- 881.2Sbjh21The ARM FPA is odd in that it stores doubles high-order word first, no matter 891.2Sbjh21what the endianness of the CPU. VFP is sane. 901.1Sbjh21------------------------------------------------------------------------------- 911.1Sbjh21*/ 921.2Sbjh21#if defined(SOFTFLOAT_FOR_GCC) 931.2Sbjh21#if defined(__VFP_FP__) || defined(__ARMEB__) 941.2Sbjh21#define FLOAT64_DEMANGLE(a) (a) 951.2Sbjh21#define FLOAT64_MANGLE(a) (a) 961.2Sbjh21#else 971.1Sbjh21#define FLOAT64_DEMANGLE(a) (((a) << 32) | ((a) >> 32)) 981.1Sbjh21#define FLOAT64_MANGLE(a) FLOAT64_DEMANGLE(a) 991.2Sbjh21#endif 1001.1Sbjh21#endif 101