summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--config.h2
-rw-r--r--integer.cpp2
2 files changed, 3 insertions, 1 deletions
diff --git a/config.h b/config.h
index fff8a56..b2d6248 100644
--- a/config.h
+++ b/config.h
@@ -125,7 +125,7 @@ typedef unsigned int word32;
// define hword, word, and dword. these are used for multiprecision integer arithmetic
// Intel compiler won't have _umul128 until version 10.0. See http://softwarecommunity.intel.com/isn/Community/en-US/forums/thread/30231625.aspx
-#if (defined(_MSC_VER) && (!defined(__INTEL_COMPILER) || __INTEL_COMPILER >= 1000) && (defined(_M_X64) || defined(_M_IA64))) || (defined(__DECCXX) && defined(__alpha__))
+#if (defined(_MSC_VER) && (!defined(__INTEL_COMPILER) || __INTEL_COMPILER >= 1000) && (defined(_M_X64) || defined(_M_IA64))) || (defined(__DECCXX) && defined(__alpha__)) || (defined(__INTEL_COMPILER) && defined(__x86_64__))
typedef word32 hword;
typedef word64 word;
#else
diff --git a/integer.cpp b/integer.cpp
index e8c2249..be5f416 100644
--- a/integer.cpp
+++ b/integer.cpp
@@ -187,6 +187,8 @@ public:
DWord r;
#ifdef CRYPTOPP_NATIVE_DWORD_AVAILABLE
r.m_whole = (dword)a * b;
+ #elif defined(__x86_64__)
+ asm ("mulq %3" : "=a"(r.m_halfs.low), "=d"(r.m_halfs.high) : "a"(a), "g"(b) : "cc");
#else
r.m_halfs.low = _umul128(a, b, &r.m_halfs.high);
#endif