convert into MIPS
From: Yogesh Chaudhary <hidden>
Date: 2003-03-04 21:16:34
Hi All,
can anyone help me converting this little piece of x86 code to MIPS.
here it is...
#define fixfixmul(a,b) \
( { long __result = (a), __arg = (b); \
asm("imul %2;" \
"shrd %3,%2,%0;" \
: "=a" (__result) \
: "0" (__result), "d" (__arg) , "I" (FX_PRECIS) ); \
assert( \
((fix2float(__result) - fix2float(a)*fix2float(b) > -0.2) \
&& \
(fix2float(__result) - fix2float(a)*fix2float(b) < 0.2)) \
|| \
(printf("fixfixmul %f %f = %f, should be %f\n", \
fix2float(a),fix2float(b),fix2float(__result), \
fix2float(a)*fix2float(b)) \
&& 0) \
); \
__result; \
} \
)
thanks, Yogesh
--------------------------------------------------------------------------
Yogesh Chaudhary
Advanced Micro Devices,Inc ( PCS )
9500 Arboretum Blvd., Suite 400 Phone: 512.602.5422
Austin, TX 78759 Fax: 512.602.5051