28 #ifndef KJK_INTRIN_X86_H_ 29 #define KJK_INTRIN_X86_H_ 81 #define _ReturnAddress() (__builtin_return_address(0)) 82 #define _AddressOfReturnAddress() (&(((void **)(__builtin_frame_address(0)))[1])) 87 #if !HAS_BUILTIN(_ReadWriteBarrier) 90 __asm__ __volatile__(
"" : : :
"memory");
95 #define _ReadBarrier _ReadWriteBarrier 96 #define _WriteBarrier _ReadWriteBarrier 98 #if !HAS_BUILTIN(_mm_mfence) 101 __asm__ __volatile__(
"mfence" : : :
"memory");
105 #if !HAS_BUILTIN(_mm_lfence) 109 __asm__ __volatile__(
"lfence");
114 #if !HAS_BUILTIN(_mm_sfence) 118 __asm__ __volatile__(
"sfence");
127 __asm__ __volatile__(
"lock; orl $0, %0;" : :
"m"(
local));
134 #if (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) > 40100 136 #if !HAS_BUILTIN(_InterlockedCompareExchange8) 139 return __sync_val_compare_and_swap(
Destination, Comperand, Exchange);
143 #if !HAS_BUILTIN(_InterlockedCompareExchange16) 146 return __sync_val_compare_and_swap(
Destination, Comperand, Exchange);
150 #if !HAS_BUILTIN(_InterlockedCompareExchange) 153 return __sync_val_compare_and_swap(
Destination, Comperand, Exchange);
157 #if !HAS_BUILTIN(_InterlockedCompareExchangePointer) 160 return (
void *)__sync_val_compare_and_swap(
Destination, Comperand, Exchange);
164 #if !HAS_BUILTIN(_InterlockedExchange8) 168 __sync_synchronize();
173 #if !HAS_BUILTIN(_InterlockedExchange16) 177 __sync_synchronize();
182 #if !HAS_BUILTIN(_InterlockedExchange) 186 __sync_synchronize();
191 #if !HAS_BUILTIN(_InterlockedExchangePointer) 195 __sync_synchronize();
196 return (
void *)__sync_lock_test_and_set(
Target,
Value);
200 #if defined(__x86_64__) 204 __sync_synchronize();
209 #if !HAS_BUILTIN(_InterlockedExchangeAdd8) 216 #if !HAS_BUILTIN(_InterlockedExchangeAdd16) 223 #if !HAS_BUILTIN(_InterlockedExchangeAdd) 230 #if defined(__x86_64__) 237 #if !HAS_BUILTIN(_InterlockedAnd8) 240 return __sync_fetch_and_and(
value,
mask);
244 #if !HAS_BUILTIN(_InterlockedAnd16) 247 return __sync_fetch_and_and(
value,
mask);
251 #if !HAS_BUILTIN(_InterlockedAnd) 254 return __sync_fetch_and_and(
value,
mask);
258 #if defined(__x86_64__) 261 return __sync_fetch_and_and(
value,
mask);
265 #if !HAS_BUILTIN(_InterlockedOr8) 272 #if !HAS_BUILTIN(_InterlockedOr16) 279 #if !HAS_BUILTIN(_InterlockedOr) 286 #if defined(__x86_64__) 293 #if !HAS_BUILTIN(_InterlockedXor8) 296 return __sync_fetch_and_xor(
value,
mask);
300 #if !HAS_BUILTIN(_InterlockedXor16) 303 return __sync_fetch_and_xor(
value,
mask);
307 #if !HAS_BUILTIN(_InterlockedXor) 310 return __sync_fetch_and_xor(
value,
mask);
314 #if defined(__x86_64__) 317 return __sync_fetch_and_xor(
value,
mask);
321 #if !HAS_BUILTIN(_InterlockedDecrement) 324 return __sync_sub_and_fetch(lpAddend, 1);
328 #if !HAS_BUILTIN(_InterlockedIncrement) 331 return __sync_add_and_fetch(lpAddend, 1);
335 #if !HAS_BUILTIN(_InterlockedDecrement16) 338 return __sync_sub_and_fetch(lpAddend, 1);
342 #if !HAS_BUILTIN(_InterlockedIncrement16) 345 return __sync_add_and_fetch(lpAddend, 1);
349 #if defined(__x86_64__) 350 __INTRIN_INLINE long long _InterlockedDecrement64(
volatile long long * lpAddend)
352 return __sync_sub_and_fetch(lpAddend, 1);
355 __INTRIN_INLINE long long _InterlockedIncrement64(
volatile long long * lpAddend)
357 return __sync_add_and_fetch(lpAddend, 1);
363 #if !HAS_BUILTIN(_InterlockedCompareExchange8) 366 char retval = Comperand;
367 __asm__(
"lock; cmpxchgb %b[Exchange], %[Destination]" : [retval]
"+a" (retval) : [
Destination]
"m" (*
Destination), [Exchange]
"q" (Exchange) :
"memory");
372 #if !HAS_BUILTIN(_InterlockedCompareExchange16) 375 short retval = Comperand;
376 __asm__(
"lock; cmpxchgw %w[Exchange], %[Destination]" : [retval]
"+a" (retval) : [
Destination]
"m" (*
Destination), [Exchange]
"q" (Exchange):
"memory");
381 #if !HAS_BUILTIN(_InterlockedCompareExchange) 384 long retval = Comperand;
385 __asm__(
"lock; cmpxchgl %k[Exchange], %[Destination]" : [retval]
"+a" (retval) : [
Destination]
"m" (*
Destination), [Exchange]
"q" (Exchange):
"memory");
390 #if !HAS_BUILTIN(_InterlockedCompareExchangePointer) 393 void * retval = (
void *)Comperand;
394 __asm__(
"lock; cmpxchgl %k[Exchange], %[Destination]" : [retval]
"=a" (retval) :
"[retval]" (retval), [
Destination]
"m" (*
Destination), [Exchange]
"q" (Exchange) :
"memory");
399 #if !HAS_BUILTIN(_InterlockedExchange8) 403 __asm__(
"xchgb %[retval], %[Target]" : [retval]
"+r" (retval) : [
Target]
"m" (*
Target) :
"memory");
408 #if !HAS_BUILTIN(_InterlockedExchange16) 411 short retval =
Value;
412 __asm__(
"xchgw %[retval], %[Target]" : [retval]
"+r" (retval) : [
Target]
"m" (*
Target) :
"memory");
417 #if !HAS_BUILTIN(_InterlockedExchange) 421 __asm__(
"xchgl %[retval], %[Target]" : [retval]
"+r" (retval) : [
Target]
"m" (*
Target) :
"memory");
426 #if !HAS_BUILTIN(_InterlockedExchangePointer) 429 void * retval =
Value;
430 __asm__(
"xchgl %[retval], %[Target]" : [retval]
"+r" (retval) : [
Target]
"m" (*
Target) :
"memory");
435 #if !HAS_BUILTIN(_InterlockedExchangeAdd8) 439 __asm__(
"lock; xaddb %[retval], %[Addend]" : [retval]
"+r" (retval) : [
Addend]
"m" (*
Addend) :
"memory");
444 #if !HAS_BUILTIN(_InterlockedExchangeAdd16) 447 short retval =
Value;
448 __asm__(
"lock; xaddw %[retval], %[Addend]" : [retval]
"+r" (retval) : [
Addend]
"m" (*
Addend) :
"memory");
453 #if !HAS_BUILTIN(_InterlockedExchangeAdd) 457 __asm__(
"lock; xaddl %[retval], %[Addend]" : [retval]
"+r" (retval) : [
Addend]
"m" (*
Addend) :
"memory");
462 #if !HAS_BUILTIN(_InterlockedAnd8) 481 #if !HAS_BUILTIN(_InterlockedAnd16) 500 #if !HAS_BUILTIN(_InterlockedAnd) 519 #if !HAS_BUILTIN(_InterlockedOr8) 538 #if !HAS_BUILTIN(_InterlockedOr16) 557 #if !HAS_BUILTIN(_InterlockedOr) 576 #if !HAS_BUILTIN(_InterlockedXor8) 595 #if !HAS_BUILTIN(_InterlockedXor16) 614 #if !HAS_BUILTIN(_InterlockedXor) 633 #if !HAS_BUILTIN(_InterlockedDecrement) 640 #if !HAS_BUILTIN(_InterlockedIncrement) 647 #if !HAS_BUILTIN(_InterlockedDecrement16) 654 #if !HAS_BUILTIN(_InterlockedIncrement16) 661 #if defined(__x86_64__) 662 __INTRIN_INLINE long long _InterlockedDecrement64(
volatile long long * lpAddend)
664 return _InterlockedExchangeAdd64(lpAddend, -1) - 1;
667 __INTRIN_INLINE long long _InterlockedIncrement64(
volatile long long * lpAddend)
669 return _InterlockedExchangeAdd64(lpAddend, 1) + 1;
675 #if (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) > 40100 && defined(__x86_64__) 679 return __sync_val_compare_and_swap(
Destination, Comperand, Exchange);
684 #if !HAS_BUILTIN(_InterlockedCompareExchange64) 687 long long retval = Comperand;
691 "lock; cmpxchg8b %[Destination]" :
692 [retval]
"+A" (retval) :
694 "b" ((
unsigned long)((Exchange >> 0) & 0xFFFFFFFF)),
695 "c" ((
unsigned long)((Exchange >> 32) & 0xFFFFFFFF)) :
710 "lock; addl %[Value], %[Lo32];" 712 "lock; adcl $0, %[Hi32];" 714 [Lo32]
"+m" (*((
volatile long *)(
Addend) + 0)), [Hi32]
"+m" (*((
volatile long *)(
Addend) + 1)) :
723 #if !HAS_BUILTIN(_interlockedbittestandreset) 726 unsigned char retval;
727 __asm__(
"lock; btrl %[b], %[a]; setb %b[retval]" : [retval]
"=q" (retval), [
a]
"+m" (*
a) : [
b]
"Ir" (
b) :
"memory");
732 #if defined(__x86_64__) 733 __INTRIN_INLINE unsigned char _interlockedbittestandreset64(
volatile long long *
a,
long long b)
735 unsigned char retval;
736 __asm__(
"lock; btrq %[b], %[a]; setb %b[retval]" : [retval]
"=r" (retval), [
a]
"+m" (*
a) : [
b]
"Ir" (
b) :
"memory");
741 #if !HAS_BUILTIN(_interlockedbittestandset) 744 unsigned char retval;
745 __asm__(
"lock; btsl %[b], %[a]; setc %b[retval]" : [retval]
"=q" (retval), [
a]
"+m" (*
a) : [
b]
"Ir" (
b) :
"memory");
750 #if defined(__x86_64__) 751 __INTRIN_INLINE unsigned char _interlockedbittestandset64(
volatile long long *
a,
long long b)
753 unsigned char retval;
754 __asm__(
"lock; btsq %[b], %[a]; setc %b[retval]" : [retval]
"=r" (retval), [
a]
"+m" (*
a) : [
b]
"Ir" (
b) :
"memory");
761 #if !HAS_BUILTIN(__stosb) 769 "[Dest]" (Dest),
"a" (
Data),
"[Count]" (
Count)
780 "[Dest]" (Dest),
"a" (
Data),
"[Count]" (
Count)
790 "[Dest]" (Dest),
"a" (
Data),
"[Count]" (
Count)
801 "[Dest]" (Dest),
"a" (
Data),
"[Count]" (
Count)
848 #if defined(__x86_64__) 881 unsigned short value;
895 unsigned long long value;
959 #if !HAS_BUILTIN(__readfsbyte) 968 #if !HAS_BUILTIN(__readfsword) 971 unsigned short value;
977 #if !HAS_BUILTIN(__readfsdword) 1004 if(!__builtin_constant_p(
Offset))
1005 __asm__ __volatile__(
"addb %b[Offset], %%fs:%a[Offset]" : : [
Offset]
"r" (
Offset) :
"memory");
1012 if(!__builtin_constant_p(
Offset))
1013 __asm__ __volatile__(
"addw %w[Offset], %%fs:%a[Offset]" : : [
Offset]
"r" (
Offset) :
"memory");
1020 if(!__builtin_constant_p(
Offset))
1021 __asm__ __volatile__(
"addl %k[Offset], %%fs:%a[Offset]" : : [
Offset]
"r" (
Offset) :
"memory");
1031 #if !HAS_BUILTIN(_BitScanForward) 1035 return Mask ? 1 : 0;
1039 #if !HAS_BUILTIN(_BitScanReverse) 1043 return Mask ? 1 : 0;
1047 #if !HAS_BUILTIN(_bittest) 1051 unsigned char retval;
1053 if(__builtin_constant_p(
b))
1054 __asm__(
"bt %[b], %[a]; setb %b[retval]" : [retval]
"=q" (retval) : [
a]
"mr" (*(
a + (
b / 32))), [
b]
"Ir" (
b % 32));
1056 __asm__(
"bt %[b], %[a]; setb %b[retval]" : [retval]
"=q" (retval) : [
a]
"m" (*
a), [
b]
"r" (
b));
1065 unsigned long long Index64;
1068 return Mask ? 1 : 0;
1073 unsigned long long Index64;
1076 return Mask ? 1 : 0;
1081 unsigned char retval;
1083 if(__builtin_constant_p(
b))
1084 __asm__(
"bt %[b], %[a]; setb %b[retval]" : [retval]
"=q" (retval) : [
a]
"mr" (*(
a + (
b / 64))), [
b]
"Ir" (
b % 64));
1086 __asm__(
"bt %[b], %[a]; setb %b[retval]" : [retval]
"=q" (retval) : [
a]
"m" (*
a), [
b]
"r" (
b));
1092 #if !HAS_BUILTIN(_bittestandcomplement) 1095 unsigned char retval;
1097 if(__builtin_constant_p(
b))
1098 __asm__(
"btc %[b], %[a]; setb %b[retval]" : [
a]
"+mr" (*(
a + (
b / 32))), [retval]
"=q" (retval) : [
b]
"Ir" (
b % 32));
1100 __asm__(
"btc %[b], %[a]; setb %b[retval]" : [
a]
"+m" (*
a), [retval]
"=q" (retval) : [
b]
"r" (
b));
1106 #if !HAS_BUILTIN(_bittestandreset) 1109 unsigned char retval;
1111 if(__builtin_constant_p(
b))
1112 __asm__(
"btr %[b], %[a]; setb %b[retval]" : [
a]
"+mr" (*(
a + (
b / 32))), [retval]
"=q" (retval) : [
b]
"Ir" (
b % 32));
1114 __asm__(
"btr %[b], %[a]; setb %b[retval]" : [
a]
"+m" (*
a), [retval]
"=q" (retval) : [
b]
"r" (
b));
1120 #if !HAS_BUILTIN(_bittestandset) 1123 unsigned char retval;
1125 if(__builtin_constant_p(
b))
1126 __asm__(
"bts %[b], %[a]; setb %b[retval]" : [
a]
"+mr" (*(
a + (
b / 32))), [retval]
"=q" (retval) : [
b]
"Ir" (
b % 32));
1128 __asm__(
"bts %[b], %[a]; setb %b[retval]" : [
a]
"+m" (*
a), [retval]
"=q" (retval) : [
b]
"r" (
b));
1138 unsigned char retval;
1140 if(__builtin_constant_p(
b))
1141 __asm__(
"btsq %[b], %[a]; setb %b[retval]" : [
a]
"+mr" (*(
a + (
b / 64))), [retval]
"=q" (retval) : [
b]
"Ir" (
b % 64));
1143 __asm__(
"btsq %[b], %[a]; setb %b[retval]" : [
a]
"+m" (*
a), [retval]
"=q" (retval) : [
b]
"r" (
b));
1150 unsigned char retval;
1152 if(__builtin_constant_p(
b))
1153 __asm__(
"btrq %[b], %[a]; setb %b[retval]" : [
a]
"+mr" (*(
a + (
b / 64))), [retval]
"=q" (retval) : [
b]
"Ir" (
b % 64));
1155 __asm__(
"btrq %[b], %[a]; setb %b[retval]" : [
a]
"+m" (*
a), [retval]
"=q" (retval) : [
b]
"r" (
b));
1160 __INTRIN_INLINE unsigned char _bittestandcomplement64(
long long *
a,
long long b)
1162 unsigned char retval;
1164 if(__builtin_constant_p(
b))
1165 __asm__(
"btcq %[b], %[a]; setb %b[retval]" : [
a]
"+mr" (*(
a + (
b / 64))), [retval]
"=q" (retval) : [
b]
"Ir" (
b % 64));
1167 __asm__(
"btcq %[b], %[a]; setb %b[retval]" : [
a]
"+m" (*
a), [retval]
"=q" (retval) : [
b]
"r" (
b));
1174 #if !HAS_BUILTIN(_rotl8) 1177 unsigned char retval;
1178 __asm__(
"rolb %b[shift], %b[retval]" : [retval]
"=rm" (retval) :
"[retval]" (
value), [
shift]
"Nc" (
shift));
1183 #if !HAS_BUILTIN(_rotl16) 1186 unsigned short retval;
1187 __asm__(
"rolw %b[shift], %w[retval]" : [retval]
"=rm" (retval) :
"[retval]" (
value), [
shift]
"Nc" (
shift));
1192 #if !HAS_BUILTIN(_rotl) 1195 unsigned int retval;
1196 __asm__(
"roll %b[shift], %k[retval]" : [retval]
"=rm" (retval) :
"[retval]" (
value), [
shift]
"Nc" (
shift));
1204 unsigned long long retval;
1205 __asm__(
"rolq %b[shift], %k[retval]" : [retval]
"=rm" (retval) :
"[retval]" (
value), [
shift]
"Nc" (
shift));
1209 #if !HAS_BUILTIN(_rotl64) 1218 #if !HAS_BUILTIN(_rotr) 1221 unsigned int retval;
1222 __asm__(
"rorl %b[shift], %k[retval]" : [retval]
"=rm" (retval) :
"[retval]" (
value), [
shift]
"Nc" (
shift));
1227 #if !HAS_BUILTIN(_rotr8) 1230 unsigned char retval;
1231 __asm__(
"rorb %b[shift], %b[retval]" : [retval]
"=qm" (retval) :
"[retval]" (
value), [
shift]
"Nc" (
shift));
1236 #if !HAS_BUILTIN(_rotr16) 1239 unsigned short retval;
1240 __asm__(
"rorw %b[shift], %w[retval]" : [retval]
"=rm" (retval) :
"[retval]" (
value), [
shift]
"Nc" (
shift));
1248 unsigned long long retval;
1249 __asm__(
"rorq %b[shift], %k[retval]" : [retval]
"=rm" (retval) :
"[retval]" (
value), [
shift]
"Nc" (
shift));
1253 #if !HAS_BUILTIN(_rotr64) 1262 #if !HAS_BUILTIN(_lrotl) 1265 unsigned long retval;
1266 __asm__(
"roll %b[shift], %k[retval]" : [retval]
"=rm" (retval) :
"[retval]" (
value), [
shift]
"Nc" (
shift));
1271 #if !HAS_BUILTIN(_lrotr) 1274 unsigned long retval;
1275 __asm__(
"rorl %b[shift], %k[retval]" : [retval]
"=rm" (retval) :
"[retval]" (
value), [
shift]
"Nc" (
shift));
1289 unsigned long long retval =
Mask;
1293 "shldl %b[Bit], %%eax, %%edx; sall %b[Bit], %%eax" :
1295 [Bit]
"Nc" ((
unsigned char)((
unsigned long)Bit) & 0xFF)
1303 long long retval =
Mask;
1307 "shrdl %b[Bit], %%edx, %%eax; sarl %b[Bit], %%edx" :
1309 [Bit]
"Nc" ((
unsigned char)((
unsigned long)Bit) & 0xFF)
1317 unsigned long long retval =
Mask;
1321 "shrdl %b[Bit], %%edx, %%eax; shrl %b[Bit], %%edx" :
1323 [Bit]
"Nc" ((
unsigned char)((
unsigned long)Bit) & 0xFF)
1331 unsigned short retval;
1332 __asm__(
"rorw $8, %w[retval]" : [retval]
"=rm" (retval) :
"[retval]" (
value));
1338 unsigned long retval;
1339 __asm__(
"bswapl %[retval]" : [retval]
"=r" (retval) :
"[retval]" (
value));
1346 unsigned long long retval;
1347 __asm__(
"bswapq %[retval]" : [retval]
"=r" (retval) :
"[retval]" (
value));
1354 unsigned long long int64part;
1356 unsigned long lowpart;
1357 unsigned long hipart;
1360 retval.int64part =
value;
1362 "bswapl %[hipart]\n" 1363 : [lowpart]
"=r" (retval.hipart), [hipart]
"=r" (retval.lowpart) :
"[lowpart]" (retval.lowpart),
"[hipart]" (retval.hipart) );
1364 return retval.int64part;
1368 #if !HAS_BUILTIN(__lzcnt) 1371 return __builtin_clz(
value);
1375 #if !HAS_BUILTIN(__lzcnt16) 1378 return __builtin_clz(
value);
1382 #if !HAS_BUILTIN(__popcnt) 1385 return __builtin_popcount(
value);
1389 #if !HAS_BUILTIN(__popcnt16) 1392 return __builtin_popcount(
value);
1399 return __builtin_clzll(
value);
1404 return __builtin_popcountll(
value);
1410 #if !HAS_BUILTIN(__emul) 1414 __asm__(
"imull %[b]" :
"=A" (retval) : [
a]
"a" (
a), [
b]
"rm" (
b));
1419 #if !HAS_BUILTIN(__emulu) 1422 unsigned long long retval;
1423 __asm__(
"mull %[b]" :
"=A" (retval) : [
a]
"a" (
a), [
b]
"rm" (
b));
1438 __asm__(
"imulq %[b]" :
"=d" (retval) : [
a]
"a" (
a), [
b]
"rm" (
b));
1442 __INTRIN_INLINE unsigned long long __umulh(
unsigned long long a,
unsigned long long b)
1444 unsigned long long retval;
1445 __asm__(
"mulq %[b]" :
"=d" (retval) : [
a]
"a" (
a), [
b]
"rm" (
b));
1456 __asm__ __volatile__(
"inb %w[Port], %b[byte]" : [
byte]
"=a" (
byte) : [
Port]
"Nd" (
Port));
1462 unsigned short word;
1469 unsigned long dword;
1470 __asm__ __volatile__(
"inl %w[Port], %k[dword]" : [dword]
"=a" (dword) : [
Port]
"Nd" (
Port));
1583 #if !HAS_BUILTIN(__rdtsc) 1587 unsigned long long low, high;
1588 __asm__ __volatile__(
"rdtsc" :
"=a"(low),
"=d"(high));
1589 return low | (high << 32);
1591 unsigned long long retval;
1592 __asm__ __volatile__(
"rdtsc" :
"=A"(retval));
1600 __asm__ __volatile__(
"push %0\n popf" : :
"rim"(
Value));
1606 __asm__ __volatile__(
"pushf\n pop %0" :
"=rm"(retval));
1612 #if !HAS_BUILTIN(__debugbreak) 1619 #if !HAS_BUILTIN(__ud2) 1626 #if !HAS_BUILTIN(__int2c) 1635 __asm__(
"cli" : : :
"memory");
1640 __asm__(
"sti" : : :
"memory");
1645 __asm__(
"hlt" : : :
"memory");
1648 #if !HAS_BUILTIN(__fastfail) 1653 __builtin_unreachable();
1683 unsigned long long value;
1690 unsigned long long value;
1697 unsigned long long value;
1704 unsigned long long value;
1711 unsigned long long value;
1735 unsigned long value;
1742 unsigned long value;
1749 unsigned long value;
1756 unsigned long value;
1767 unsigned long long value;
1908 unsigned long low, high;
1909 __asm__ __volatile__(
"rdmsr" :
"=a" (low),
"=d" (high) :
"c" (
reg));
1910 return ((
unsigned long long)high << 32) | low;
1912 unsigned long long retval;
1913 __asm__ __volatile__(
"rdmsr" :
"=A" (retval) :
"c" (
reg));
1921 __asm__ __volatile__(
"wrmsr" : :
"a" (
Value),
"d" (
Value >> 32),
"c" (Register));
1923 __asm__ __volatile__(
"wrmsr" : :
"A" (
Value),
"c" (Register));
1929 unsigned long long retval;
1937 unsigned long retval;
1938 __asm__ __volatile__(
"lsl %[a], %[retval]" : [retval]
"=r" (retval) : [
a]
"rm" (
a));
1944 __asm__ __volatile__(
"wbinvd" : : :
"memory");
1964 #if !HAS_BUILTIN(_mm_pause) 1967 __asm__ __volatile__(
"pause" : : :
"memory");
__INTRIN_INLINE void __ud2(void)
__INTRIN_INLINE void __writecr4(unsigned int Data)
__INTRIN_INLINE unsigned short __cdecl _inpw(unsigned short Port)
__INTRIN_INLINE void __stosd(unsigned long *Dest, unsigned long Data, size_t Count)
__INTRIN_INLINE void __writedr(unsigned reg, unsigned int value)
__INTRIN_INLINE void _mm_lfence(void)
__INTRIN_INLINE void __stosb(unsigned char *Dest, unsigned char Data, size_t Count)
__INTRIN_INLINE unsigned long long __cdecl _rotl64(unsigned long long value, int shift)
__INTRIN_INLINE void __addfsbyte(unsigned long Offset, unsigned char Data)
__INTRIN_INLINE void *__cdecl memcpy(void *dest, const void *source, size_t num)
__INTRIN_INLINE char _InterlockedCompareExchange8(volatile char *Destination, char Exchange, char Comperand)
__INTRIN_INLINE unsigned long __readcr2(void)
__INTRIN_INLINE void __movsb(unsigned char *Destination, const unsigned char *Source, size_t Count)
__INTRIN_INLINE unsigned long long __readmsr(unsigned long reg)
__INTRIN_INLINE unsigned char _interlockedbittestandreset(volatile long *a, long b)
__INTRIN_INLINE void __writefsbyte(unsigned long Offset, unsigned char Data)
__INTRIN_INLINE unsigned short __cdecl _rotl16(unsigned short value, unsigned char shift)
__INTRIN_INLINE void __incfsdword(unsigned long Offset)
__INTRIN_INLINE unsigned long __readfsdword(unsigned long Offset)
__INTRIN_INLINE unsigned char _BitScanReverse(unsigned long *Index, unsigned long Mask)
__INTRIN_INLINE void __wbinvd(void)
__INTRIN_INLINE long _InterlockedXor(volatile long *value, long mask)
__INTRIN_INLINE void __incfsword(unsigned long Offset)
__INTRIN_INLINE unsigned long __cdecl _lrotr(unsigned long value, int shift)
__INTRIN_INLINE void __inbytestring(unsigned short Port, unsigned char *Buffer, unsigned long Count)
__INTRIN_INLINE void __halt(void)
__INTRIN_INLINE long long _InterlockedCompareExchange64(volatile long long *Destination, long long Exchange, long long Comperand)
__INTRIN_INLINE void __stosw(unsigned short *Dest, unsigned short Data, size_t Count)
__INTRIN_INLINE void __lidt(void *Source)
__INTRIN_INLINE unsigned int __popcnt(unsigned int value)
GLint GLint GLint GLint GLint x
__INTRIN_INLINE unsigned long long __ull_rshift(unsigned long long Mask, int Bit)
__INTRIN_INLINE unsigned long __segmentlimit(unsigned long a)
__declspec(noreturn) __INTRIN_INLINE void __fastfail(unsigned int Code)
__INTRIN_INLINE unsigned long long __cdecl _byteswap_uint64(unsigned long long value)
__INTRIN_INLINE unsigned long __readcr3(void)
__INTRIN_INLINE unsigned char __readfsbyte(unsigned long Offset)
__INTRIN_INLINE void __indwordstring(unsigned short Port, unsigned long *Buffer, unsigned long Count)
__INTRIN_INLINE void __movsd(unsigned long *Destination, const unsigned long *Source, size_t Count)
__INTRIN_INLINE long long __emul(int a, int b)
__INTRIN_INLINE short _InterlockedIncrement16(volatile short *lpAddend)
__INTRIN_INLINE void __writefsword(unsigned long Offset, unsigned short Data)
__INTRIN_INLINE unsigned int __cdecl _rotl(unsigned int value, int shift)
__INTRIN_INLINE unsigned long long __cdecl _rotr64(unsigned long long value, int shift)
__INTRIN_INLINE unsigned int __lzcnt(unsigned int value)
__INTRIN_INLINE unsigned char _BitScanForward(unsigned long *Index, unsigned long Mask)
__INTRIN_INLINE unsigned char _bittestandset(long *a, long b)
__INTRIN_INLINE long _InterlockedOr(volatile long *value, long mask)
__INTRIN_INLINE int __cdecl _inp(unsigned short Port)
__INTRIN_INLINE unsigned long __cdecl _byteswap_ulong(unsigned long value)
__INTRIN_INLINE void __cdecl __debugbreak(void)
__INTRIN_INLINE void __writecr3(unsigned int Data)
__INTRIN_INLINE void __outbytestring(unsigned short Port, unsigned char *Buffer, unsigned long Count)
__INTRIN_INLINE unsigned char _bittestandreset(long *a, long b)
__INTRIN_INLINE uintptr_t __readeflags(void)
__INTRIN_INLINE long _InterlockedIncrement(volatile long *lpAddend)
__asm__("\t.globl GetPhys\n" "GetPhys:\t\n" "mflr 0\n\t" "stwu 0,-16(1)\n\t" "mfmsr 5\n\t" "andi. 6,5,0xffef\n\t" "mtmsr 6\n\t" "isync\n\t" "sync\n\t" "lwz 3,0(3)\n\t" "mtmsr 5\n\t" "isync\n\t" "sync\n\t" "lwz 0,0(1)\n\t" "addi 1,1,16\n\t" "mtlr 0\n\t" "blr")
__INTRIN_INLINE void __sidt(void *Destination)
__INTRIN_INLINE void _ReadWriteBarrier(void)
__INTRIN_INLINE void __addfsword(unsigned long Offset, unsigned short Data)
__INTRIN_INLINE void __writefsdword(unsigned long Offset, unsigned long Data)
__INTRIN_INLINE long _InterlockedAddLargeStatistic(volatile long long *const Addend, const long Value)
__INTRIN_INLINE unsigned short __readfsword(unsigned long Offset)
__INTRIN_INLINE void __writecr0(unsigned int Data)
__INTRIN_INLINE unsigned char __inbyte(unsigned short Port)
__INTRIN_INLINE char _InterlockedExchangeAdd8(char volatile *Addend, char Value)
__INTRIN_INLINE unsigned char __cdecl _rotr8(unsigned char value, unsigned char shift)
__INTRIN_INLINE short _InterlockedDecrement16(volatile short *lpAddend)
__INTRIN_INLINE long _InterlockedCompareExchange(volatile long *Destination, long Exchange, long Comperand)
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _Out_opt_ PUSHORT _Inout_opt_ PUNICODE_STRING Value
__INTRIN_INLINE void __nop(void)
__INTRIN_INLINE long _InterlockedAnd(volatile long *value, long mask)
__INTRIN_INLINE short _InterlockedAnd16(volatile short *value, short mask)
__INTRIN_INLINE void _mm_pause(void)
GLboolean GLboolean GLboolean b
__INTRIN_INLINE long long __cdecl _abs64(long long value)
__INTRIN_INLINE void _mm_sfence(void)
__INTRIN_INLINE long long __ll_rshift(long long Mask, int Bit)
__INTRIN_INLINE char _InterlockedXor8(volatile char *value, char mask)
__INTRIN_INLINE void * _InterlockedCompareExchangePointer(void *volatile *Destination, void *Exchange, void *Comperand)
__INTRIN_INLINE long _InterlockedDecrement(volatile long *lpAddend)
_In_ WDFCOLLECTION _In_ ULONG Index
__INTRIN_INLINE void * _InterlockedExchangePointer(void *volatile *Target, void *Value)
__INTRIN_INLINE unsigned int __cdecl _rotr(unsigned int value, int shift)
__INTRIN_INLINE void __cdecl _enable(void)
__INTRIN_INLINE void __writemsr(unsigned long Register, unsigned long long Value)
__INTRIN_INLINE void __cpuid(int CPUInfo[4], int InfoType)
_In_ PUNICODE_STRING _Inout_ PUNICODE_STRING Destination
__INTRIN_INLINE unsigned long __cdecl _inpd(unsigned short Port)
__INTRIN_INLINE char _InterlockedExchange8(volatile char *Target, char Value)
__INTRIN_INLINE void __outdwordstring(unsigned short Port, unsigned long *Buffer, unsigned long Count)
__INTRIN_INLINE long _InterlockedExchangeAdd(volatile long *Addend, long Value)
__INTRIN_INLINE void __int2c(void)
__INTRIN_INLINE long _InterlockedExchange(volatile long *Target, long Value)
__INTRIN_INLINE short _InterlockedCompareExchange16(volatile short *Destination, short Exchange, short Comperand)
__INTRIN_INLINE void __writeeflags(uintptr_t Value)
_In_ UCHAR _In_ UCHAR _In_ ULONG Code
__INTRIN_INLINE unsigned long long __rdtsc(void)
__INTRIN_INLINE void __cdecl _disable(void)
GLsizei const GLfloat * value
__INTRIN_INLINE unsigned int __readdr(unsigned int reg)
__INTRIN_INLINE char _InterlockedOr8(volatile char *value, char mask)
__INTRIN_INLINE unsigned long __readcr0(void)
__INTRIN_INLINE unsigned long __readcr4(void)
__INTRIN_INLINE void __inwordstring(unsigned short Port, unsigned short *Buffer, unsigned long Count)
__INTRIN_INLINE void _sgdt(void *Destination)
__INTRIN_INLINE unsigned long __indword(unsigned short Port)
__INTRIN_INLINE unsigned long long __emulu(unsigned int a, unsigned int b)
__INTRIN_INLINE unsigned long __cdecl _lrotl(unsigned long value, int shift)
_In_ ULONG _In_ ULONG Offset
__INTRIN_INLINE unsigned long long __readpmc(unsigned long counter)
__INTRIN_INLINE unsigned short __lzcnt16(unsigned short value)
__INTRIN_INLINE void __cpuidex(int CPUInfo[4], int InfoType, int ECXValue)
__INTRIN_INLINE char _InterlockedAnd8(volatile char *value, char mask)
__INTRIN_INLINE void __addfsdword(unsigned long Offset, unsigned long Data)
__INTRIN_INLINE void __incfsbyte(unsigned long Offset)
__INTRIN_INLINE unsigned short __cdecl _outpw(unsigned short Port, unsigned short dataword)
__INTRIN_INLINE unsigned long long __ll_lshift(unsigned long long Mask, int Bit)
void *__cdecl memmove(void *dest, const void *source, size_t num)
GLint GLint GLint GLint GLint GLint y
__INTRIN_INLINE short _InterlockedOr16(volatile short *value, short mask)
__INTRIN_INLINE int __cdecl _outp(unsigned short Port, int databyte)
__INTRIN_INLINE short _InterlockedExchange16(volatile short *Target, short Value)
__INTRIN_INLINE short _InterlockedExchangeAdd16(volatile short *Addend, short Value)
__INTRIN_INLINE unsigned char __cdecl _rotl8(unsigned char value, unsigned char shift)
__INTRIN_INLINE void __invlpg(void *Address)
__INTRIN_INLINE unsigned char _bittest(const long *a, long b)
__INTRIN_INLINE unsigned short __cdecl _rotr16(unsigned short value, unsigned char shift)
__INTRIN_INLINE short _InterlockedXor16(volatile short *value, short mask)
__INTRIN_INLINE unsigned short __cdecl _byteswap_ushort(unsigned short value)
__INTRIN_INLINE void _mm_mfence(void)
__INTRIN_INLINE unsigned long __cdecl _outpd(unsigned short Port, unsigned long dataword)
_In_ UINT _In_ UINT _In_ PNDIS_PACKET Source
__INTRIN_INLINE void __outwordstring(unsigned short Port, unsigned short *Buffer, unsigned long Count)
GLboolean GLboolean GLboolean GLboolean a
__INTRIN_INLINE void __outword(unsigned short Port, unsigned short Data)
__INTRIN_INLINE unsigned short __inword(unsigned short Port)
__INTRIN_INLINE void __outbyte(unsigned short Port, unsigned char Data)
__INTRIN_INLINE void __movsw(unsigned short *Destination, const unsigned short *Source, size_t Count)
__INTRIN_INLINE void __outdword(unsigned short Port, unsigned long Data)
__INTRIN_INLINE unsigned char _interlockedbittestandset(volatile long *a, long b)
__INTRIN_INLINE unsigned char _bittestandcomplement(long *a, long b)
__INTRIN_INLINE unsigned short __popcnt16(unsigned short value)