xref: /freebsd/lib/libc/arm/softfloat/arm-gcc.h (revision 0a10f22a30d61a6f32777a236a82d461129538cc)
12357939bSOlivier Houchard /* $NetBSD: arm-gcc.h,v 1.2 2001/02/21 18:09:25 bjh21 Exp $ */
22357939bSOlivier Houchard /* $FreeBSD$ */
32357939bSOlivier Houchard 
42357939bSOlivier Houchard /*
52357939bSOlivier Houchard -------------------------------------------------------------------------------
62357939bSOlivier Houchard One of the macros `BIGENDIAN' or `LITTLEENDIAN' must be defined.
72357939bSOlivier Houchard -------------------------------------------------------------------------------
82357939bSOlivier Houchard */
92357939bSOlivier Houchard #ifdef __ARMEB__
102357939bSOlivier Houchard #define BIGENDIAN
112357939bSOlivier Houchard #else
122357939bSOlivier Houchard #define LITTLEENDIAN
132357939bSOlivier Houchard #endif
142357939bSOlivier Houchard 
152357939bSOlivier Houchard /*
162357939bSOlivier Houchard -------------------------------------------------------------------------------
172357939bSOlivier Houchard The macro `BITS64' can be defined to indicate that 64-bit integer types are
182357939bSOlivier Houchard supported by the compiler.
192357939bSOlivier Houchard -------------------------------------------------------------------------------
202357939bSOlivier Houchard */
212357939bSOlivier Houchard #define BITS64
222357939bSOlivier Houchard 
232357939bSOlivier Houchard /*
242357939bSOlivier Houchard -------------------------------------------------------------------------------
252357939bSOlivier Houchard Each of the following `typedef's defines the most convenient type that holds
262357939bSOlivier Houchard integers of at least as many bits as specified.  For example, `uint8' should
272357939bSOlivier Houchard be the most convenient type that can hold unsigned integers of as many as
282357939bSOlivier Houchard 8 bits.  The `flag' type must be able to hold either a 0 or 1.  For most
292357939bSOlivier Houchard implementations of C, `flag', `uint8', and `int8' should all be `typedef'ed
302357939bSOlivier Houchard to the same as `int'.
312357939bSOlivier Houchard -------------------------------------------------------------------------------
322357939bSOlivier Houchard */
332357939bSOlivier Houchard typedef int flag;
342357939bSOlivier Houchard typedef int uint8;
352357939bSOlivier Houchard typedef int int8;
362357939bSOlivier Houchard typedef int uint16;
372357939bSOlivier Houchard typedef int int16;
382357939bSOlivier Houchard typedef unsigned int uint32;
392357939bSOlivier Houchard typedef signed int int32;
402357939bSOlivier Houchard #ifdef BITS64
412357939bSOlivier Houchard typedef unsigned long long int uint64;
422357939bSOlivier Houchard typedef signed long long int int64;
432357939bSOlivier Houchard #endif
442357939bSOlivier Houchard 
452357939bSOlivier Houchard /*
462357939bSOlivier Houchard -------------------------------------------------------------------------------
472357939bSOlivier Houchard Each of the following `typedef's defines a type that holds integers
482357939bSOlivier Houchard of _exactly_ the number of bits specified.  For instance, for most
492357939bSOlivier Houchard implementation of C, `bits16' and `sbits16' should be `typedef'ed to
502357939bSOlivier Houchard `unsigned short int' and `signed short int' (or `short int'), respectively.
512357939bSOlivier Houchard -------------------------------------------------------------------------------
522357939bSOlivier Houchard */
532357939bSOlivier Houchard typedef unsigned char bits8;
542357939bSOlivier Houchard typedef signed char sbits8;
552357939bSOlivier Houchard typedef unsigned short int bits16;
562357939bSOlivier Houchard typedef signed short int sbits16;
572357939bSOlivier Houchard typedef unsigned int bits32;
582357939bSOlivier Houchard typedef signed int sbits32;
592357939bSOlivier Houchard #ifdef BITS64
602357939bSOlivier Houchard typedef unsigned long long int bits64;
612357939bSOlivier Houchard typedef signed long long int sbits64;
622357939bSOlivier Houchard #endif
632357939bSOlivier Houchard 
642357939bSOlivier Houchard #ifdef BITS64
652357939bSOlivier Houchard /*
662357939bSOlivier Houchard -------------------------------------------------------------------------------
672357939bSOlivier Houchard The `LIT64' macro takes as its argument a textual integer literal and
682357939bSOlivier Houchard if necessary ``marks'' the literal as having a 64-bit integer type.
692357939bSOlivier Houchard For example, the GNU C Compiler (`gcc') requires that 64-bit literals be
702357939bSOlivier Houchard appended with the letters `LL' standing for `long long', which is `gcc's
712357939bSOlivier Houchard name for the 64-bit integer type.  Some compilers may allow `LIT64' to be
722357939bSOlivier Houchard defined as the identity macro:  `#define LIT64( a ) a'.
732357939bSOlivier Houchard -------------------------------------------------------------------------------
742357939bSOlivier Houchard */
752357939bSOlivier Houchard #define LIT64( a ) a##LL
762357939bSOlivier Houchard #endif
772357939bSOlivier Houchard 
782357939bSOlivier Houchard /*
792357939bSOlivier Houchard -------------------------------------------------------------------------------
802357939bSOlivier Houchard The macro `INLINE' can be used before functions that should be inlined.  If
812357939bSOlivier Houchard a compiler does not support explicit inlining, this macro should be defined
822357939bSOlivier Houchard to be `static'.
832357939bSOlivier Houchard -------------------------------------------------------------------------------
842357939bSOlivier Houchard */
852357939bSOlivier Houchard #define INLINE static __inline
862357939bSOlivier Houchard 
872357939bSOlivier Houchard /*
882357939bSOlivier Houchard -------------------------------------------------------------------------------
892357939bSOlivier Houchard The ARM FPA is odd in that it stores doubles high-order word first, no matter
902357939bSOlivier Houchard what the endianness of the CPU.  VFP is sane.
912357939bSOlivier Houchard -------------------------------------------------------------------------------
922357939bSOlivier Houchard */
932357939bSOlivier Houchard #if defined(SOFTFLOAT_FOR_GCC)
94*0a10f22aSAndrew Turner #if defined (__ARM_EABI__) || defined(__VFP_FP__) || defined(__ARMEB__)
952357939bSOlivier Houchard #define FLOAT64_DEMANGLE(a)	(a)
962357939bSOlivier Houchard #define FLOAT64_MANGLE(a)	(a)
972357939bSOlivier Houchard #else
98955c8cbbSAndrew Turner #define FLOAT64_DEMANGLE(a)	((((a) & 0xfffffffful) << 32) | ((a) >> 32))
992357939bSOlivier Houchard #define FLOAT64_MANGLE(a)	FLOAT64_DEMANGLE(a)
1002357939bSOlivier Houchard #endif
1012357939bSOlivier Houchard #endif
102