1129202Scognet/* $NetBSD: arm-gcc.h,v 1.2 2001/02/21 18:09:25 bjh21 Exp $ */
2129202Scognet/* $FreeBSD: releng/10.2/lib/libc/arm/softfloat/arm-gcc.h 255361 2013-09-07 14:04:10Z andrew $ */
3129202Scognet
4129202Scognet/*
5129202Scognet-------------------------------------------------------------------------------
6129202ScognetOne of the macros `BIGENDIAN' or `LITTLEENDIAN' must be defined.
7129202Scognet-------------------------------------------------------------------------------
8129202Scognet*/
9129202Scognet#ifdef __ARMEB__
10129202Scognet#define BIGENDIAN
11129202Scognet#else
12129202Scognet#define LITTLEENDIAN
13129202Scognet#endif
14129202Scognet
15129202Scognet/*
16129202Scognet-------------------------------------------------------------------------------
17129202ScognetThe macro `BITS64' can be defined to indicate that 64-bit integer types are
18129202Scognetsupported by the compiler.
19129202Scognet-------------------------------------------------------------------------------
20129202Scognet*/
21129202Scognet#define BITS64
22129202Scognet
23129202Scognet/*
24129202Scognet-------------------------------------------------------------------------------
25129202ScognetEach of the following `typedef's defines the most convenient type that holds
26129202Scognetintegers of at least as many bits as specified.  For example, `uint8' should
27129202Scognetbe the most convenient type that can hold unsigned integers of as many as
28129202Scognet8 bits.  The `flag' type must be able to hold either a 0 or 1.  For most
29129202Scognetimplementations of C, `flag', `uint8', and `int8' should all be `typedef'ed
30129202Scognetto the same as `int'.
31129202Scognet-------------------------------------------------------------------------------
32129202Scognet*/
33129202Scognettypedef int flag;
34129202Scognettypedef int uint8;
35129202Scognettypedef int int8;
36129202Scognettypedef int uint16;
37129202Scognettypedef int int16;
38129202Scognettypedef unsigned int uint32;
39129202Scognettypedef signed int int32;
40129202Scognet#ifdef BITS64
41129202Scognettypedef unsigned long long int uint64;
42129202Scognettypedef signed long long int int64;
43129202Scognet#endif
44129202Scognet
45129202Scognet/*
46129202Scognet-------------------------------------------------------------------------------
47129202ScognetEach of the following `typedef's defines a type that holds integers
48129202Scognetof _exactly_ the number of bits specified.  For instance, for most
49129202Scognetimplementation of C, `bits16' and `sbits16' should be `typedef'ed to
50129202Scognet`unsigned short int' and `signed short int' (or `short int'), respectively.
51129202Scognet-------------------------------------------------------------------------------
52129202Scognet*/
53129202Scognettypedef unsigned char bits8;
54129202Scognettypedef signed char sbits8;
55129202Scognettypedef unsigned short int bits16;
56129202Scognettypedef signed short int sbits16;
57129202Scognettypedef unsigned int bits32;
58129202Scognettypedef signed int sbits32;
59129202Scognet#ifdef BITS64
60129202Scognettypedef unsigned long long int bits64;
61129202Scognettypedef signed long long int sbits64;
62129202Scognet#endif
63129202Scognet
64129202Scognet#ifdef BITS64
65129202Scognet/*
66129202Scognet-------------------------------------------------------------------------------
67129202ScognetThe `LIT64' macro takes as its argument a textual integer literal and
68129202Scognetif necessary ``marks'' the literal as having a 64-bit integer type.
69129202ScognetFor example, the GNU C Compiler (`gcc') requires that 64-bit literals be
70129202Scognetappended with the letters `LL' standing for `long long', which is `gcc's
71129202Scognetname for the 64-bit integer type.  Some compilers may allow `LIT64' to be
72129202Scognetdefined as the identity macro:  `#define LIT64( a ) a'.
73129202Scognet-------------------------------------------------------------------------------
74129202Scognet*/
75129202Scognet#define LIT64( a ) a##LL
76129202Scognet#endif
77129202Scognet
78129202Scognet/*
79129202Scognet-------------------------------------------------------------------------------
80129202ScognetThe macro `INLINE' can be used before functions that should be inlined.  If
81129202Scogneta compiler does not support explicit inlining, this macro should be defined
82129202Scognetto be `static'.
83129202Scognet-------------------------------------------------------------------------------
84129202Scognet*/
85129202Scognet#define INLINE static __inline
86129202Scognet
87129202Scognet/*
88129202Scognet-------------------------------------------------------------------------------
89129202ScognetThe ARM FPA is odd in that it stores doubles high-order word first, no matter
90129202Scognetwhat the endianness of the CPU.  VFP is sane.
91129202Scognet-------------------------------------------------------------------------------
92129202Scognet*/
93129202Scognet#if defined(SOFTFLOAT_FOR_GCC)
94255361Sandrew#if defined (__ARM_EABI__) || defined(__VFP_FP__) || defined(__ARMEB__)
95129202Scognet#define FLOAT64_DEMANGLE(a)	(a)
96129202Scognet#define FLOAT64_MANGLE(a)	(a)
97129202Scognet#else
98245084Sandrew#define FLOAT64_DEMANGLE(a)	((((a) & 0xfffffffful) << 32) | ((a) >> 32))
99129202Scognet#define FLOAT64_MANGLE(a)	FLOAT64_DEMANGLE(a)
100129202Scognet#endif
101129202Scognet#endif
102