Skip to content
Snippets Groups Projects
Commit ada8d321 authored by David Majnemer's avatar David Majnemer
Browse files

Intrin.h: Don't invade the program's namespace

The program is permitted to have stuff like '#define x' in it so avoid
using identifiers not reserved for the implementation.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@242010 91177308-0d34-0410-b5e6-96231b3b80d8
parent 0b49372f
No related branches found
No related tags found
No related merge requests found
...@@ -513,34 +513,34 @@ _BitScanReverse(unsigned long *_Index, unsigned long _Mask) { ...@@ -513,34 +513,34 @@ _BitScanReverse(unsigned long *_Index, unsigned long _Mask) {
return 1; return 1;
} }
static __inline__ unsigned short __DEFAULT_FN_ATTRS static __inline__ unsigned short __DEFAULT_FN_ATTRS
__popcnt16(unsigned short value) { __popcnt16(unsigned short _Value) {
return __builtin_popcount((int)value); return __builtin_popcount((int)_Value);
} }
static __inline__ unsigned int __DEFAULT_FN_ATTRS static __inline__ unsigned int __DEFAULT_FN_ATTRS
__popcnt(unsigned int value) { __popcnt(unsigned int _Value) {
return __builtin_popcount(value); return __builtin_popcount(_Value);
} }
static __inline__ unsigned char __DEFAULT_FN_ATTRS static __inline__ unsigned char __DEFAULT_FN_ATTRS
_bittest(long const *a, long b) { _bittest(long const *__BitBase, long __BitPos) {
return (*a >> b) & 1; return (*__BitBase >> __BitPos) & 1;
} }
static __inline__ unsigned char __DEFAULT_FN_ATTRS static __inline__ unsigned char __DEFAULT_FN_ATTRS
_bittestandcomplement(long *a, long b) { _bittestandcomplement(long *__BitBase, long __BitPos) {
unsigned char x = (*a >> b) & 1; unsigned char __Res = (*__BitBase >> __BitPos) & 1;
*a = *a ^ (1 << b); *__BitBase = *__BitBase ^ (1 << __BitPos);
return x; return __Res;
} }
static __inline__ unsigned char __DEFAULT_FN_ATTRS static __inline__ unsigned char __DEFAULT_FN_ATTRS
_bittestandreset(long *a, long b) { _bittestandreset(long *__BitBase, long __BitPos) {
unsigned char x = (*a >> b) & 1; unsigned char __Res = (*__BitBase >> __BitPos) & 1;
*a = *a & ~(1 << b); *__BitBase = *__BitBase & ~(1 << __BitPos);
return x; return __Res;
} }
static __inline__ unsigned char __DEFAULT_FN_ATTRS static __inline__ unsigned char __DEFAULT_FN_ATTRS
_bittestandset(long *a, long b) { _bittestandset(long *__BitBase, long __BitPos) {
unsigned char x = (*a >> b) & 1; unsigned char __Res = (*__BitBase >> __BitPos) & 1;
*a = *a | (1 << b); *__BitBase = *__BitBase | (1 << __BitPos);
return x; return __Res;
} }
#if defined(__i386__) || defined(__x86_64__) #if defined(__i386__) || defined(__x86_64__)
static __inline__ unsigned char __DEFAULT_FN_ATTRS static __inline__ unsigned char __DEFAULT_FN_ATTRS
...@@ -565,30 +565,30 @@ _BitScanReverse64(unsigned long *_Index, unsigned __int64 _Mask) { ...@@ -565,30 +565,30 @@ _BitScanReverse64(unsigned long *_Index, unsigned __int64 _Mask) {
} }
static __inline__ static __inline__
unsigned __int64 __DEFAULT_FN_ATTRS unsigned __int64 __DEFAULT_FN_ATTRS
__popcnt64(unsigned __int64 value) { __popcnt64(unsigned __int64 _Value) {
return __builtin_popcountll(value); return __builtin_popcountll(_Value);
} }
static __inline__ unsigned char __DEFAULT_FN_ATTRS static __inline__ unsigned char __DEFAULT_FN_ATTRS
_bittest64(__int64 const *a, __int64 b) { _bittest64(__int64 const *__BitBase, __int64 __BitPos) {
return (*a >> b) & 1; return (*__BitBase >> __BitPos) & 1;
} }
static __inline__ unsigned char __DEFAULT_FN_ATTRS static __inline__ unsigned char __DEFAULT_FN_ATTRS
_bittestandcomplement64(__int64 *a, __int64 b) { _bittestandcomplement64(__int64 *__BitBase, __int64 __BitPos) {
unsigned char x = (*a >> b) & 1; unsigned char __Res = (*__BitBase >> __BitPos) & 1;
*a = *a ^ (1ll << b); *__BitBase = *__BitBase ^ (1ll << __BitPos);
return x; return __Res;
} }
static __inline__ unsigned char __DEFAULT_FN_ATTRS static __inline__ unsigned char __DEFAULT_FN_ATTRS
_bittestandreset64(__int64 *a, __int64 b) { _bittestandreset64(__int64 *__BitBase, __int64 __BitPos) {
unsigned char x = (*a >> b) & 1; unsigned char __Res = (*__BitBase >> __BitPos) & 1;
*a = *a & ~(1ll << b); *__BitBase = *__BitBase & ~(1ll << __BitPos);
return x; return __Res;
} }
static __inline__ unsigned char __DEFAULT_FN_ATTRS static __inline__ unsigned char __DEFAULT_FN_ATTRS
_bittestandset64(__int64 *a, __int64 b) { _bittestandset64(__int64 *__BitBase, __int64 __BitPos) {
unsigned char x = (*a >> b) & 1; unsigned char __Res = (*__BitBase >> __BitPos) & 1;
*a = *a | (1ll << b); *__BitBase = *__BitBase | (1ll << __BitPos);
return x; return __Res;
} }
static __inline__ unsigned char __DEFAULT_FN_ATTRS static __inline__ unsigned char __DEFAULT_FN_ATTRS
_interlockedbittestandset64(__int64 volatile *__BitBase, __int64 __BitPos) { _interlockedbittestandset64(__int64 volatile *__BitBase, __int64 __BitPos) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment