From 0f311adb2cbc6a9266138d5972b8c6dc07b4200f Mon Sep 17 00:00:00 2001 From: toddouska Date: Fri, 30 May 2014 16:54:09 -0700 Subject: [PATCH] if icc doesn't have 128bit type on x64 don't use it --- configure.ac | 1 + cyassl/ctaocrypt/integer.h | 4 ++++ cyassl/ctaocrypt/tfm.h | 5 +++++ 3 files changed, 10 insertions(+) diff --git a/configure.ac b/configure.ac index 66b1ae3f8..038969c37 100644 --- a/configure.ac +++ b/configure.ac @@ -81,6 +81,7 @@ AC_CHECK_HEADERS([errno.h]) AC_CHECK_LIB(network,socket) AC_CHECK_SIZEOF(long long, 8) AC_CHECK_SIZEOF(long, 4) +AC_CHECK_TYPES(__uint128_t) AC_C_BIGENDIAN # mktime check takes forever on some systems, if time supported it would be # highly unusual for mktime to be missing diff --git a/cyassl/ctaocrypt/integer.h b/cyassl/ctaocrypt/integer.h index 8f20f901b..77b5552c7 100644 --- a/cyassl/ctaocrypt/integer.h +++ b/cyassl/ctaocrypt/integer.h @@ -70,6 +70,10 @@ extern "C" { #define MP_64BIT #endif #endif +/* if intel compiler doesn't provide 128 bit type don't turn on 64bit */ +#if defined(MP_64BIT) && defined(__INTEL_COMPILER) && !defined(HAVE___UINT128_T) + #undef MP_64BIT +#endif /* some default configurations. * diff --git a/cyassl/ctaocrypt/tfm.h b/cyassl/ctaocrypt/tfm.h index abb588f78..f4e98c152 100644 --- a/cyassl/ctaocrypt/tfm.h +++ b/cyassl/ctaocrypt/tfm.h @@ -73,6 +73,11 @@ #if defined(__x86_64__) && !defined(FP_64BIT) #define FP_64BIT #endif +/* if intel compiler doesn't provide 128 bit type don't turn on 64bit */ +#if defined(FP_64BIT) && defined(__INTEL_COMPILER) && !defined(HAVE___UINT128_T) + #undef FP_64BIT + #undef TFM_X86_64 +#endif #endif /* NO_64BIT */ /* try to detect x86-32 */