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