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