nixpkgs/pkgs/applications/networking/p2p/mldonkey/gcc44mips64_2.patch
Lluís Batlle i Rossell 0c7429f8cc My attempts to build mldonkey on the fuloong
svn path=/nixpkgs/branches/stdenv-updates/; revision=24034
2010-10-03 09:18:31 +00:00

17 lines
698 B
Diff

diff --git a/src/utils/lib/CryptoPP.cc b/src/utils/lib/CryptoPP.cc
index 9208e1c..788df83 100644
--- a/src/utils/lib/CryptoPP.cc
+++ b/src/utils/lib/CryptoPP.cc
@@ -1880,7 +1880,10 @@ public:
#elif defined(__x86_64__)
__asm__("mulq %3" : "=d" (r.m_halfs.high), "=a" (r.m_halfs.low) : "a" (a), "rm" (b) : "cc");
#elif defined(__mips64)
- __asm__("dmultu %2,%3" : "=h" (r.m_halfs.high), "=l" (r.m_halfs.low) : "r" (a), "r" (b));
+ typedef unsigned int uint128_t __attribute__((mode(TI)));
+ uint128_t tmp = (uint128_t) a * b;
+ r.m_halfs.high = tmp >> 64;
+ r.m_halfs.low = (tmp << 64) >> 64;
#elif defined(_M_IX86)
// for testing
word64 t = (word64)a * b;