mirror of /home/gitosis/repositories/libowfat.git
add non-asm version for gcc
parent
bb518ee596
commit
35ba145b01
|
@ -1,4 +1,4 @@
|
|||
#ifdef __x86_64__
|
||||
#if defined(__x86_64__) && defined(__OPTIMIZE__)
|
||||
|
||||
/* WARNING: this only works if compiled with -fomit-frame-pointer */
|
||||
void imult64() {
|
||||
|
|
|
@ -21,6 +21,16 @@ void umult64() {
|
|||
|
||||
#include "safemult.h"
|
||||
|
||||
#ifdef __GNUC__
|
||||
|
||||
int umult64(uint64 a,uint64 b,uint64* c) {
|
||||
__uint128_t x=((__uint128_t)a)*b;
|
||||
if ((*c=(uint64)x) != x) return 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
/* return 1 for overflow, 0 for ok */
|
||||
int umult64(uint64 a,uint64 b,uint64* c) {
|
||||
uint32 ahi=a>>32;
|
||||
|
@ -46,3 +56,5 @@ int umult64(uint64 a,uint64 b,uint64* c) {
|
|||
}
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue