]>
git.proxmox.com Git - mirror_edk2.git/blob - ArmPkg/Library/ArmSoftFloatLib/arm-gcc.h
3 Copyright (c) 2014, ARM Limited. All rights reserved.
5 SPDX-License-Identifier: BSD-2-Clause-Patent
9 /* $NetBSD: arm-gcc.h,v 1.4 2013/01/26 07:08:14 matt Exp $ */
12 -------------------------------------------------------------------------------
13 One of the macros `BIGENDIAN' or `LITTLEENDIAN' must be defined.
14 -------------------------------------------------------------------------------
23 -------------------------------------------------------------------------------
24 The macro `BITS64' can be defined to indicate that 64-bit integer types are
25 supported by the compiler.
26 -------------------------------------------------------------------------------
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
38 -------------------------------------------------------------------------------
45 typedef unsigned int uint32
;
46 typedef signed int int32
;
48 typedef unsigned long long int uint64
;
49 typedef signed long long int int64
;
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 -------------------------------------------------------------------------------
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
;
67 typedef unsigned long long int bits64
;
68 typedef signed long long int sbits64
;
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 -------------------------------------------------------------------------------
82 #define LIT64( a ) a##ULL
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
90 -------------------------------------------------------------------------------
92 #define INLINE static inline
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 -------------------------------------------------------------------------------
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)
105 #define FLOAT64_DEMANGLE(a) (((a) << 32) | ((a) >> 32))
106 #define FLOAT64_MANGLE(a) FLOAT64_DEMANGLE(a)