1/** @file
2
3  Copyright (c) 2014, ARM Limited. All rights reserved.
4
5  This program and the accompanying materials
6  are licensed and made available under the terms and conditions of the BSD License
7  which accompanies this distribution.  The full text of the license may be found at
8  http://opensource.org/licenses/bsd-license.php
9
10  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12
13**/
14
15/* $NetBSD: arm-gcc.h,v 1.4 2013/01/26 07:08:14 matt Exp $ */
16
17/*
18-------------------------------------------------------------------------------
19One of the macros `BIGENDIAN' or `LITTLEENDIAN' must be defined.
20-------------------------------------------------------------------------------
21*/
22#define LITTLEENDIAN
23
24/*
25-------------------------------------------------------------------------------
26The macro `BITS64' can be defined to indicate that 64-bit integer types are
27supported by the compiler.
28-------------------------------------------------------------------------------
29*/
30#define BITS64
31
32/*
33-------------------------------------------------------------------------------
34Each of the following `typedef's defines the most convenient type that holds
35integers of at least as many bits as specified.  For example, `uint8' should
36be the most convenient type that can hold unsigned integers of as many as
378 bits.  The `flag' type must be able to hold either a 0 or 1.  For most
38implementations of C, `flag', `uint8', and `int8' should all be `typedef'ed
39to the same as `int'.
40-------------------------------------------------------------------------------
41*/
42typedef int flag;
43typedef int uint8;
44typedef int int8;
45typedef int uint16;
46typedef int int16;
47typedef unsigned int uint32;
48typedef signed int int32;
49#ifdef BITS64
50typedef unsigned long long int uint64;
51typedef signed long long int int64;
52#endif
53
54/*
55-------------------------------------------------------------------------------
56Each of the following `typedef's defines a type that holds integers
57of _exactly_ the number of bits specified.  For instance, for most
58implementation of C, `bits16' and `sbits16' should be `typedef'ed to
59`unsigned short int' and `signed short int' (or `short int'), respectively.
60-------------------------------------------------------------------------------
61*/
62typedef unsigned char bits8;
63typedef signed char sbits8;
64typedef unsigned short int bits16;
65typedef signed short int sbits16;
66typedef unsigned int bits32;
67typedef signed int sbits32;
68#ifdef BITS64
69typedef unsigned long long int bits64;
70typedef signed long long int sbits64;
71#endif
72
73#ifdef BITS64
74/*
75-------------------------------------------------------------------------------
76The `LIT64' macro takes as its argument a textual integer literal and
77if necessary ``marks'' the literal as having a 64-bit integer type.
78For example, the GNU C Compiler (`gcc') requires that 64-bit literals be
79appended with the letters `LL' standing for `long long', which is `gcc's
80name for the 64-bit integer type.  Some compilers may allow `LIT64' to be
81defined as the identity macro:  `#define LIT64( a ) a'.
82-------------------------------------------------------------------------------
83*/
84#define LIT64( a ) a##ULL
85#endif
86
87/*
88-------------------------------------------------------------------------------
89The macro `INLINE' can be used before functions that should be inlined.  If
90a compiler does not support explicit inlining, this macro should be defined
91to be `static'.
92-------------------------------------------------------------------------------
93*/
94#define INLINE static inline
95
96/*
97-------------------------------------------------------------------------------
98The ARM FPA is odd in that it stores doubles high-order word first, no matter
99what the endianness of the CPU.  VFP is sane.
100-------------------------------------------------------------------------------
101*/
102#if defined(SOFTFLOAT_FOR_GCC)
103#if defined(__VFP_FP__)
104#define FLOAT64_DEMANGLE(a) (a)
105#define FLOAT64_MANGLE(a)   (a)
106#else
107#define FLOAT64_DEMANGLE(a) (((a) << 32) | ((a) >> 32))
108#define FLOAT64_MANGLE(a)   FLOAT64_DEMANGLE(a)
109#endif
110#endif
111