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