linux-mips
[Top] [All Lists]

convert into MIPS

To: linux-mips@linux-mips.org
Subject: convert into MIPS
From: "Yogesh Chaudhary" <yogesh.chaudhary@amd.com>
Date: Tue, 4 Mar 2003 15:08:27 -0600 (CST)
Cc: "Yogesh Chaudhary" <yogesh.chaudhary@amd.com>
Original-recipient: rfc822;linux-mips@linux-mips.org
Sender: linux-mips-bounce@linux-mips.org
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



<Prev in Thread] Current Thread [Next in Thread>
  • convert into MIPS, Yogesh Chaudhary <=