From ccc9b05698933a00f8b813965705b6a0a00850c8 Mon Sep 17 00:00:00 2001 From: Richard Kreckel Date: Sun, 24 Oct 2004 22:27:51 +0000 Subject: [PATCH] * src/base/cl_low.h: Add mulu64 assembler macro for ia64. --- ChangeLog | 4 ++++ src/base/cl_low.h | 11 +++++++++++ 2 files changed, 15 insertions(+) diff --git a/ChangeLog b/ChangeLog index a40a73c..3ea6920 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2004-10-25 Richard B. Kreckel + + * src/base/cl_low.h: Add mulu64 assembler macro for ia64. + 2004-10-24 Richard B. Kreckel * src/base/cl_low.h: Add mul and div macros for x86_64. diff --git a/src/base/cl_low.h b/src/base/cl_low.h index 2aba0b0..15d8519 100644 --- a/src/base/cl_low.h +++ b/src/base/cl_low.h @@ -360,6 +360,17 @@ inline uint32 mulu32_unchecked (uint32 arg1, uint32 arg2) ); \ hi_zuweisung _hi; lo_zuweisung _lo; \ }) +#elif defined(__GNUC__) && defined(__ia64__) && !defined(NO_ASM) + #define mulu64(x,y,hi_zuweisung,lo_zuweisung) \ + ({ var register uint64 _x = (x); \ + var register uint64 _y = (y); \ + var register uint64 _hi; \ + __asm__("xma.hu %0 = %1, %2, f0" \ + : "=f" (_hi) \ + : "f" ((uint64)(_x)), "f" ((uint64)(_y)) \ + ); \ + hi_zuweisung _hi; lo_zuweisung ((uint64)(_x)*(uint64)(_y));\ + }) #else #define mulu64(x,y,hi_zuweisung,lo_zuweisung) \ { lo_zuweisung mulu64_(x,y); hi_zuweisung mulu64_high; }