summaryrefslogtreecommitdiff
path: root/include/llvm/Support/MathExtras.h
diff options
context:
space:
mode:
authorDuncan Sands <baldrick@free.fr>2009-07-23 19:08:27 +0000
committerDuncan Sands <baldrick@free.fr>2009-07-23 19:08:27 +0000
commit17e4aa7d0a0aa67a115da82319534f9e425d960a (patch)
tree4f9026688dc463c42abbf32d52a1113b6844d979 /include/llvm/Support/MathExtras.h
parentdaf2212e8337c2333631787ed2765a23ddafd527 (diff)
downloadllvm-17e4aa7d0a0aa67a115da82319534f9e425d960a.tar.gz
llvm-17e4aa7d0a0aa67a115da82319534f9e425d960a.tar.bz2
llvm-17e4aa7d0a0aa67a115da82319534f9e425d960a.tar.xz
Fix PR4614: the Intel C compiler defines _GNUC__
but does not provide __builtin_bswap32/64. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76896 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Support/MathExtras.h')
-rw-r--r--include/llvm/Support/MathExtras.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/llvm/Support/MathExtras.h b/include/llvm/Support/MathExtras.h
index 85e19acd9e..a143d1975d 100644
--- a/include/llvm/Support/MathExtras.h
+++ b/include/llvm/Support/MathExtras.h
@@ -108,7 +108,7 @@ inline uint16_t ByteSwap_16(uint16_t Value) {
/// ByteSwap_32 - This function returns a byte-swapped representation of the
/// 32-bit argument, Value.
inline uint32_t ByteSwap_32(uint32_t Value) {
-#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)
+#if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) && !defined(__ICC)
return __builtin_bswap32(Value);
#elif defined(_MSC_VER) && !defined(_DEBUG)
return _byteswap_ulong(Value);
@@ -124,7 +124,7 @@ inline uint32_t ByteSwap_32(uint32_t Value) {
/// ByteSwap_64 - This function returns a byte-swapped representation of the
/// 64-bit argument, Value.
inline uint64_t ByteSwap_64(uint64_t Value) {
-#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)
+#if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) && !defined(__ICC)
return __builtin_bswap64(Value);
#elif defined(_MSC_VER) && !defined(_DEBUG)
return _byteswap_uint64(Value);