diff options
Diffstat (limited to 'src/inc/bitposition.h')
-rw-r--r-- | src/inc/bitposition.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/inc/bitposition.h b/src/inc/bitposition.h index 0f3831fce9..392d9a6632 100644 --- a/src/inc/bitposition.h +++ b/src/inc/bitposition.h @@ -25,7 +25,11 @@ inline unsigned BitPosition(unsigned value) { _ASSERTE((value != 0) && ((value & (value-1)) == 0)); -#ifndef _TARGET_AMD64_ +#if defined(_TARGET_ARM_) && defined(__llvm__) + // use intrinsic functions for arm32 + // this is applied for LLVM only but it may work for some compilers + DWORD index = __builtin_clz(__builtin_arm_rbit(value)); +#elif !defined(_TARGET_AMD64_) const unsigned PRIME = 37; static const char hashTable[PRIME] = |