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