|
miasm
Reverse engineering framework
|
Go to the documentation of this file.
24 #ifdef COMPILER_RT_ARMHF_TARGET
25 #define COMPILER_RT_ABI
27 #define COMPILER_RT_ABI __attribute__((__pcs__("aapcs")))
30 #define COMPILER_RT_ABI
33 #define AEABI_RTABI __attribute__((__pcs__("aapcs")))
35 #if defined(_MSC_VER) && !defined(__clang__)
36 #define ALWAYS_INLINE __forceinline
37 #define NOINLINE __declspec(noinline)
38 #define NORETURN __declspec(noreturn)
41 #define ALWAYS_INLINE __attribute__((always_inline))
42 #define NOINLINE __attribute__((noinline))
43 #define NORETURN __attribute__((noreturn))
44 #define UNUSED __attribute__((unused))
48 #define XSTR(a) STR(a)
49 #define SYMBOL_NAME(name) XSTR(__USER_LABEL_PREFIX__) #name
51 #if defined(__ELF__) || defined(__MINGW32__) || defined(__wasm__)
52 #define COMPILER_RT_ALIAS(name, aliasname) \
53 COMPILER_RT_ABI __typeof(name) aliasname __attribute__((__alias__(#name)));
54 #elif defined(__APPLE__)
55 #if defined(VISIBILITY_HIDDEN)
56 #define COMPILER_RT_ALIAS_VISIBILITY(name) \
57 __asm__(".private_extern " SYMBOL_NAME(name));
59 #define COMPILER_RT_ALIAS_VISIBILITY(name)
61 #define COMPILER_RT_ALIAS(name, aliasname) \
62 __asm__(".globl " SYMBOL_NAME(aliasname)); \
63 COMPILER_RT_ALIAS_VISIBILITY(aliasname) \
64 __asm__(SYMBOL_NAME(aliasname) " = " SYMBOL_NAME(name)); \
65 COMPILER_RT_ABI __typeof(name) aliasname;
67 #define COMPILER_RT_ALIAS(name, aliasname)
69 #error Unsupported target
72 #if defined(__NetBSD__) && (defined(_KERNEL) || defined(_STANDALONE))
77 #include <machine/limits.h>
78 #include <sys/stdint.h>
79 #include <sys/types.h>
103 #ifdef CRT_HAS_128BIT
109 #if defined(_MSC_VER) && !defined(__clang__)
112 uint32_t __inline __builtin_ctz(uint32_t
value) {
113 unsigned long trailing_zero = 0;
114 if (_BitScanForward(&trailing_zero,
value))
115 return trailing_zero;
119 uint32_t __inline __builtin_clz(uint32_t
value) {
120 unsigned long leading_zero = 0;
121 if (_BitScanReverse(&leading_zero,
value))
122 return 31 - leading_zero;
126 #if defined(_M_ARM) || defined(_M_X64)
127 uint32_t __inline __builtin_clzll(uint64_t
value) {
128 unsigned long leading_zero = 0;
129 if (_BitScanReverse64(&leading_zero,
value))
130 return 63 - leading_zero;
134 uint32_t __inline __builtin_clzll(uint64_t
value) {
137 uint32_t msh = (uint32_t)(
value >> 32);
138 uint32_t lsh = (uint32_t)(
value & 0xFFFFFFFF);
140 return __builtin_clz(msh);
141 return 32 + __builtin_clz(lsh);
145 #define __builtin_clzl __builtin_clzll
146 #endif // defined(_MSC_VER) && !defined(__clang__)
COMPILER_RT_ABI si_int __divsi3(si_int a, si_int b)
COMPILER_RT_ABI si_int __paritysi2(si_int a)
COMPILER_RT_ABI su_int __udivsi3(su_int n, su_int d)
unsigned long long du_int
Definition: int_types.h:29
int si_int
Definition: int_types.h:25
d
Definition: basic_op.py:30
COMPILER_RT_ABI si_int __paritydi2(di_int a)
COMPILER_RT_ABI su_int __udivmodsi4(su_int a, su_int b, su_int *rem)
value
Definition: export_llvm.py:69
long long di_int
Definition: int_types.h:28
COMPILER_RT_ABI du_int __udivmoddi4(du_int a, du_int b, du_int *rem)
#define COMPILER_RT_ABI
Definition: int_lib.h:30
COMPILER_RT_ABI di_int __divdi3(di_int a, di_int b)
unsigned su_int
Definition: int_types.h:26
a
Definition: basic_op.py:9
b
Definition: basic_op.py:10