diff options
author | Abseil Team <absl-team@google.com> | 2022-06-09 03:12:43 -0700 |
---|---|---|
committer | Copybara-Service <copybara-worker@google.com> | 2022-06-09 03:13:29 -0700 |
commit | 7383f346c9e33a08ed2132f117b3de6b13eac173 (patch) | |
tree | 2f7c916152eb449e7eb672832824334802db78d3 /absl/base | |
parent | e0a32c2aee27aadce321471be734d7643d7d9439 (diff) |
Optimize SwissMap iteration by another 5-10% for ARM
https://pastebin.com/fDvgWgHe
After having a chat with Dougall Johnson (https://twitter.com/dougallj/status/1534213050944802816), we realized that __clzll works with zero arguments per documentation:
https://developer.arm.com/documentation/101028/0009/Data-processing-intrinsics
```
Returns the number of leading zero bits in x. When x is zero it returns the argument width, i.e. 32 or 64.
```
Codegen improves https://godbolt.org/z/ebadf717Y
Thus we can use a little bit different construction not involving CLS but using more understandable CLZ and removing some operations.
PiperOrigin-RevId: 453879080
Change-Id: Ie2d7f834f63364d7bd50dd6a682c107985f21942
Diffstat (limited to 'absl/base')
-rw-r--r-- | absl/base/config.h | 15 |
1 files changed, 0 insertions, 15 deletions
diff --git a/absl/base/config.h b/absl/base/config.h index cf940f32..58097b0d 100644 --- a/absl/base/config.h +++ b/absl/base/config.h @@ -860,21 +860,6 @@ static_assert(ABSL_INTERNAL_INLINE_NAMESPACE_STR[0] != 'h' || #define ABSL_INTERNAL_HAVE_SSSE3 1 #endif -// ABSL_INTERNAL_HAVE_ARM_ACLE is used for compile-time detection of ACLE (ARM -// C language extensions). -#ifdef ABSL_INTERNAL_HAVE_ARM_ACLE -#error ABSL_INTERNAL_HAVE_ARM_ACLE cannot be directly set -// __cls, __rbit were added quite late in clang. They are not supported -// by GCC as well. __cls can be replaced with __builtin_clrsb but clang does -// not recognize cls instruction in latest versions. -// TODO(b/233604649): Relax to __builtin_clrsb and __builtin_bitreverse64 (note -// that the latter is not supported by GCC). -#elif defined(__ARM_ACLE) && defined(__clang__) && \ - ABSL_HAVE_BUILTIN(__builtin_arm_cls64) && \ - ABSL_HAVE_BUILTIN(__builtin_arm_rbit64) -#define ABSL_INTERNAL_HAVE_ARM_ACLE 1 -#endif - // ABSL_INTERNAL_HAVE_ARM_NEON is used for compile-time detection of NEON (ARM // SIMD). #ifdef ABSL_INTERNAL_HAVE_ARM_NEON |