fix compile with ICC 9.1 on x64

pull/2/head
weidai 2007-09-24 07:05:29 +00:00
parent 645b318c4d
commit c9c1fdbcb4
2 changed files with 3 additions and 1 deletions

View File

@ -125,7 +125,7 @@ typedef unsigned int word32;
// define hword, word, and dword. these are used for multiprecision integer arithmetic // 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 // 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 word32 hword;
typedef word64 word; typedef word64 word;
#else #else

View File

@ -187,6 +187,8 @@ public:
DWord r; DWord r;
#ifdef CRYPTOPP_NATIVE_DWORD_AVAILABLE #ifdef CRYPTOPP_NATIVE_DWORD_AVAILABLE
r.m_whole = (dword)a * b; 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 #else
r.m_halfs.low = _umul128(a, b, &r.m_halfs.high); r.m_halfs.low = _umul128(a, b, &r.m_halfs.high);
#endif #endif