OSDN Git Service

arm-assembly from cidoca for MULA
authorBrad Midgley <bmidgley@xmission.com>
Mon, 28 Jan 2008 17:32:36 +0000 (17:32 +0000)
committerBrad Midgley <bmidgley@xmission.com>
Mon, 28 Jan 2008 17:32:36 +0000 (17:32 +0000)
sbc/sbc_math.h

index 625d4dd..68b0f19 100644 (file)
@@ -65,5 +65,13 @@ typedef long long sbc_extended_t;
 #define ADD(dst, src)    { dst += src; }
 #define SUB(dst, src)    { dst -= src; }
 #define MUL(dst, a, b)   { dst = (sbc_extended_t) (a) * (b); }
-#define MULA(dst, a, b)  { dst += (sbc_extended_t) (a) * (b); }
 #define DIV2(dst, src)   { dst = ASR(src, 1); }
+
+#ifdef __arm__
+#define MULA(res, a, b) __asm__(               \
+               "smlal %Q0, %R0, %2, %3"        \
+               : "=&r" (res)                   \
+               : "0" (res), "r" (a), "r" (b));
+#else
+#define MULA(dst, a, b)  { dst += (sbc_extended_t) (a) * (b); }
+#endif