From 710daea322295bd8901ec3d2a03447985a89f39d Mon Sep 17 00:00:00 2001 From: Jack Lloyd Date: Tue, 24 Oct 2017 20:56:54 -0400 Subject: 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. --- src/lib/utils/bit_ops.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/lib/utils/bit_ops.h') 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) -- cgit v1.2.3