llvm.org GIT mirror llvm / 5222775
MathExtras.h: don't check for unsupported GCC versions git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368908 91177308-0d34-0410-b5e6-96231b3b80d8 JF Bastien a month ago
1 changed file(s) with 8 addition(s) and 8 deletion(s). Raw diff Collapse all Expand all
7272 }
7373 };
7474
75 #if __GNUC__ >= 4 || defined(_MSC_VER)
75 #if defined(__GNUC__) || defined(_MSC_VER)
7676 template struct TrailingZerosCounter {
7777 static unsigned count(T Val, ZeroBehavior ZB) {
7878 if (ZB != ZB_Undefined && Val == 0)
7979 return 32;
8080
81 #if __has_builtin(__builtin_ctz) || LLVM_GNUC_PREREQ(4, 0, 0)
81 #if __has_builtin(__builtin_ctz) || defined(__GNUC__)
8282 return __builtin_ctz(Val);
8383 #elif defined(_MSC_VER)
8484 unsigned long Index;
9494 if (ZB != ZB_Undefined && Val == 0)
9595 return 64;
9696
97 #if __has_builtin(__builtin_ctzll) || LLVM_GNUC_PREREQ(4, 0, 0)
97 #if __has_builtin(__builtin_ctzll) || defined(__GNUC__)
9898 return __builtin_ctzll(Val);
9999 #elif defined(_MSC_VER)
100100 unsigned long Index;
141141 }
142142 };
143143
144 #if __GNUC__ >= 4 || defined(_MSC_VER)
144 #if defined(__GNUC__) || defined(_MSC_VER)
145145 template struct LeadingZerosCounter {
146146 static unsigned count(T Val, ZeroBehavior ZB) {
147147 if (ZB != ZB_Undefined && Val == 0)
148148 return 32;
149149
150 #if __has_builtin(__builtin_clz) || LLVM_GNUC_PREREQ(4, 0, 0)
150 #if __has_builtin(__builtin_clz) || defined(__GNUC__)
151151 return __builtin_clz(Val);
152152 #elif defined(_MSC_VER)
153153 unsigned long Index;
163163 if (ZB != ZB_Undefined && Val == 0)
164164 return 64;
165165
166 #if __has_builtin(__builtin_clzll) || LLVM_GNUC_PREREQ(4, 0, 0)
166 #if __has_builtin(__builtin_clzll) || defined(__GNUC__)
167167 return __builtin_clzll(Val);
168168 #elif defined(_MSC_VER)
169169 unsigned long Index;
485485 static unsigned count(T Value) {
486486 // Generic version, forward to 32 bits.
487487 static_assert(SizeOfT <= 4, "Not implemented!");
488 #if __GNUC__ >= 4
488 #if defined(__GNUC__)
489489 return __builtin_popcount(Value);
490490 #else
491491 uint32_t v = Value;
498498
499499 template struct PopulationCounter {
500500 static unsigned count(T Value) {
501 #if __GNUC__ >= 4
501 #if defined(__GNUC__)
502502 return __builtin_popcountll(Value);
503503 #else
504504 uint64_t v = Value;