]>
git.proxmox.com Git - mirror_edk2.git/blob - StdLib/LibC/Main/Arm/int_lib.h
2 University of Illinois/NCSA
5 Copyright (c) 2009-2014 by the contributors listed in CREDITS.TXT
13 University of Illinois at Urbana-Champaign
17 Permission is hereby granted, free of charge, to any person obtaining a copy of
18 this software and associated documentation files (the "Software"), to deal with
19 the Software without restriction, including without limitation the rights to
20 use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
21 of the Software, and to permit persons to whom the Software is furnished to do
22 so, subject to the following conditions:
24 * Redistributions of source code must retain the above copyright notice,
25 this list of conditions and the following disclaimers.
27 * Redistributions in binary form must reproduce the above copyright notice,
28 this list of conditions and the following disclaimers in the
29 documentation and/or other materials provided with the distribution.
31 * Neither the names of the LLVM Team, University of Illinois at
32 Urbana-Champaign, nor the names of its contributors may be used to
33 endorse or promote products derived from this Software without specific
34 prior written permission.
36 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
37 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
38 FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
39 CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
40 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
41 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE
48 /* Assumption: Signed integral is 2's complement. */
49 /* Assumption: Right shift of signed negative is arithmetic shift. */
50 /* Assumption: Endianness is little or big (not mixed). */
52 /* ABI macro definitions */
55 * TODO define this appropriately for targets that require explicit export
56 * declarations (i.e. Windows)
58 #define COMPILER_RT_EXPORT
61 # define ARM_EABI_FNALIAS(aeabi_name, name) \
62 void __aeabi_##aeabi_name() __attribute__((alias("__" #name)));
63 # define COMPILER_RT_ABI COMPILER_RT_EXPORT __attribute__((pcs("aapcs")))
65 # define ARM_EABI_FNALIAS(aeabi_name, name)
66 # define COMPILER_RT_ABI COMPILER_RT_EXPORT
69 #if defined(__NetBSD__) && (defined(_KERNEL) || defined(_STANDALONE))
71 * Kernel and boot environment can't use normal headers,
72 * so use the equivalent system headers.
74 # include <machine/limits.h>
75 # include <sys/stdint.h>
76 # include <sys/types.h>
78 /* Include the standard compiler builtin headers we use functionality from. */
85 /* Include the commonly used internal type definitions. */
86 #include "int_types.h"
88 /* Include internal utility function declarations. */
91 COMPILER_RT_ABI si_int
__paritysi2(si_int a
);
92 COMPILER_RT_ABI si_int
__paritydi2(di_int a
);
94 COMPILER_RT_ABI di_int
__divdi3(di_int a
, di_int b
);
95 COMPILER_RT_ABI si_int
__divsi3(si_int a
, si_int b
);
96 COMPILER_RT_ABI su_int
__udivsi3(su_int n
, su_int d
);
98 COMPILER_RT_ABI su_int
__udivmodsi4(su_int a
, su_int b
, su_int
* rem
);
99 COMPILER_RT_ABI du_int
__udivmoddi4(du_int a
, du_int b
, du_int
* rem
);
100 #ifdef CRT_HAS_128BIT
101 COMPILER_RT_ABI si_int
__clzti2(ti_int a
);
102 COMPILER_RT_ABI tu_int
__udivmodti4(tu_int a
, tu_int b
, tu_int
* rem
);
105 #endif /* INT_LIB_H */