From a3873f6f345b3bc806328492de23592ab273854e Mon Sep 17 00:00:00 2001 From: weidai Date: Mon, 24 Sep 2007 07:05:29 +0000 Subject: [PATCH] fix compile with ICC 9.1 on x64 --- trunk/c5/config.h | 2 +- trunk/c5/integer.cpp | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/trunk/c5/config.h b/trunk/c5/config.h index fff8a561..b2d6248f 100644 --- a/trunk/c5/config.h +++ b/trunk/c5/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/trunk/c5/integer.cpp b/trunk/c5/integer.cpp index e8c22494..be5f4164 100644 --- a/trunk/c5/integer.cpp +++ b/trunk/c5/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