Use an inline function for MAC64() on x86-32.

Message ID 1300120307-1359-1-git-send-email-justin.ruggles@gmail.com
State Superseded
Headers show

Commit Message

Justin Ruggles March 14, 2011, 4:31 p.m.
Fixes fate-acodec-ac3_fixed regression test.
---
 libavcodec/x86/mathops.h |   15 +++++++++++----
 1 files changed, 11 insertions(+), 4 deletions(-)

Comments

Justin Ruggles March 14, 2011, 4:41 p.m. | #1
On 03/14/2011 12:31 PM, Justin Ruggles wrote:

> 
> Fixes fate-acodec-ac3_fixed regression test.
> ---
>  libavcodec/x86/mathops.h |   15 +++++++++++----
>  1 files changed, 11 insertions(+), 4 deletions(-)


ignore this one. wrong commit message.

-Justin

Patch

diff --git a/libavcodec/x86/mathops.h b/libavcodec/x86/mathops.h
index 5949dfe..1e47769 100644
--- a/libavcodec/x86/mathops.h
+++ b/libavcodec/x86/mathops.h
@@ -39,10 +39,17 @@ 
      __asm__ ("imull %3\n\t" : "=d"(rt), "=a"(dummy): "a" ((int)(ra)), "rm" ((int)(rb)));\
      rt; })
 
-#define MUL64(ra, rb) \
-    ({ int64_t rt;\
-     __asm__ ("imull %2\n\t" : "=A"(rt) : "a" ((int)(ra)), "g" ((int)(rb)));\
-     rt; })
+static av_unused av_always_inline av_const int64_t MUL64(int a, int b)
+{
+    int64_t rt;
+    __asm__ volatile(
+        "imull %2  \n\t"
+        : "=A"(rt)
+        : "a"((int)(a)), "g"((int)(b))
+    );
+    return rt;
+}
+#define MUL64 MUL64
 #endif
 
 #if HAVE_CMOV