diff options
author | Jack Lloyd <[email protected]> | 2018-12-31 11:51:37 -0500 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2018-12-31 11:51:37 -0500 |
commit | 0438423269420f8ea2c5f0c2c4f874c5afbe3ca9 (patch) | |
tree | 0269aa210f97d3932dbd77c3df1f8ece4c281551 /src/lib | |
parent | d594fce9591b93fbdfc8079af86a62c1bde55b64 (diff) |
Use __builtin_bswapN builtins on XLC
Recent XLC is based on clang and has these
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/utils/bswap.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/lib/utils/bswap.h b/src/lib/utils/bswap.h index b6238d1e7..02f63c64e 100644 --- a/src/lib/utils/bswap.h +++ b/src/lib/utils/bswap.h @@ -1,6 +1,6 @@ /* * Byte Swapping Operations -* (C) 1999-2011 Jack Lloyd +* (C) 1999-2011,2018 Jack Lloyd * (C) 2007 Yves Jerschow * * Botan is released under the Simplified BSD License (see license.txt) @@ -22,7 +22,7 @@ namespace Botan { */ inline uint16_t reverse_bytes(uint16_t val) { -#if defined(BOTAN_BUILD_COMPILER_IS_GCC) || defined(BOTAN_BUILD_COMPILER_IS_CLANG) +#if defined(BOTAN_BUILD_COMPILER_IS_GCC) || defined(BOTAN_BUILD_COMPILER_IS_CLANG) || defined(BOTAN_BUILD_COMPILER_IS_XLC) return __builtin_bswap16(val); #else return static_cast<uint16_t>((val << 8) | (val >> 8)); @@ -34,7 +34,7 @@ inline uint16_t reverse_bytes(uint16_t val) */ inline uint32_t reverse_bytes(uint32_t val) { -#if defined(BOTAN_BUILD_COMPILER_IS_GCC) || defined(BOTAN_BUILD_COMPILER_IS_CLANG) +#if defined(BOTAN_BUILD_COMPILER_IS_GCC) || defined(BOTAN_BUILD_COMPILER_IS_CLANG) || defined(BOTAN_BUILD_COMPILER_IS_XLC) return __builtin_bswap32(val); #elif defined(BOTAN_BUILD_COMPILER_IS_MSVC) @@ -63,7 +63,7 @@ inline uint32_t reverse_bytes(uint32_t val) */ inline uint64_t reverse_bytes(uint64_t val) { -#if defined(BOTAN_BUILD_COMPILER_IS_GCC) || defined(BOTAN_BUILD_COMPILER_IS_CLANG) +#if defined(BOTAN_BUILD_COMPILER_IS_GCC) || defined(BOTAN_BUILD_COMPILER_IS_CLANG) || defined(BOTAN_BUILD_COMPILER_IS_XLC) return __builtin_bswap64(val); #elif defined(BOTAN_BUILD_COMPILER_IS_MSVC) |