diff options
author | Jack Lloyd <[email protected]> | 2017-10-24 20:56:54 -0400 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2017-10-24 20:56:54 -0400 |
commit | 710daea322295bd8901ec3d2a03447985a89f39d (patch) | |
tree | d1b3b8dc2e4af8a4b592b21719a36ec1399f9ec2 /src/lib/utils/bit_ops.h | |
parent | 4bff25a393c771618f0d14428adbd40e37625d2e (diff) |
Skip ARM32 specific byteswap code, enable MSVC byteswap intrinsics
While older versions of GCC did very badly with __builtin_bswap on
ARM, I checked GCC 4.8 and it behaves correctly, emitting either rev
or else the same optimal sequence as was used in the inline asm
(depending on if ARMv7 is enabled or not.)
Enable MSVC byteswap intrinsics, which (hopefully) work on all platforms.
Drop the x86-32 specific asm for byteswap.
Diffstat (limited to 'src/lib/utils/bit_ops.h')
-rw-r--r-- | src/lib/utils/bit_ops.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lib/utils/bit_ops.h b/src/lib/utils/bit_ops.h index 2da0e55fb..aa41db391 100644 --- a/src/lib/utils/bit_ops.h +++ b/src/lib/utils/bit_ops.h @@ -102,7 +102,7 @@ inline size_t ctz(T n) return 8*sizeof(T); } -#if defined(BOTAN_BUILD_COMPILER_IS_GCC) +#if defined(BOTAN_BUILD_COMPILER_IS_GCC) || defined(BOTAN_BUILD_COMPILER_IS_CLANG) template<> inline size_t ctz(uint32_t n) |