fix for 32-bit archs

This commit is contained in:
leitner 2008-12-26 01:56:42 +00:00
parent 3629bfd5a7
commit 10ab3bf70a
2 changed files with 13 additions and 1 deletions

View File

@ -22,6 +22,16 @@ void imult64() {
#include "safemult.h"
#if defined(__GNUC__) && (defined(__x86_64__) || defined(__ia64__) || defined(__powerpc64__) || defined(__alpha__) || defined(__mips64__) || defined(__sparc64__))
int imult64(int64 a,int64 b,int64* c) {
__int128_t x=((__int128_t)a)*b;
if ((*c=(int64)x) != x) return 0;
return 1;
}
#else
int imult64(int64 a,int64 b,int64* c) {
int neg=(a<0);
uint64 d;
@ -34,3 +44,5 @@ int imult64(int64 a,int64 b,int64* c) {
}
#endif
#endif

View File

@ -21,7 +21,7 @@ void umult64() {
#include "safemult.h"
#ifdef __GNUC__
#if defined(__GNUC__) && (defined(__x86_64__) || defined(__ia64__) || defined(__powerpc64__) || defined(__alpha__) || defined(__mips64__) || defined(__sparc64__))
int umult64(uint64 a,uint64 b,uint64* c) {
__uint128_t x=((__uint128_t)a)*b;