mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-27 14:34:58 +00:00
Fix the non-gcc 4.0 path to compile
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22593 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
bcd7db59d0
commit
3b65576527
@ -88,7 +88,7 @@ inline unsigned CountLeadingZeros_32(unsigned Value) {
|
||||
// PowerPC is defined for __builtin_clz(0)
|
||||
#if defined(__ppc__) || defined(__ppc64__)
|
||||
if (!Value) return 32;
|
||||
#endif
|
||||
#endif
|
||||
Count = __builtin_clz(Value);
|
||||
#else
|
||||
if (!Value) return 32;
|
||||
@ -117,7 +117,8 @@ inline unsigned CountLeadingZeros_64(uint64_t Value) {
|
||||
if (!Value) return 64;
|
||||
#endif
|
||||
Count = __builtin_clzll(Value);
|
||||
#elif sizeof(long) == sizeof(int64_t)
|
||||
#else
|
||||
if (sizeof(long) == sizeof(int64_t)) {
|
||||
if (!Value) return 64;
|
||||
Count = 0;
|
||||
// bisecton method for count leading zeros
|
||||
@ -127,8 +128,8 @@ inline unsigned CountLeadingZeros_64(uint64_t Value) {
|
||||
Count |= Shift;
|
||||
Value = Tmp;
|
||||
}
|
||||
}
|
||||
#else
|
||||
}
|
||||
} else {
|
||||
// get hi portion
|
||||
unsigned Hi = Hi_32(Value);
|
||||
|
||||
@ -142,7 +143,8 @@ inline unsigned CountLeadingZeros_64(uint64_t Value) {
|
||||
// same as 32 bit value
|
||||
Count = CountLeadingZeros_32(Lo);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
return Count;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user