comparison armv4l/mathops.h @ 8112:954dd6e341ce libavcodec

ARM: change MULL() macro to inline function
author mru
date Thu, 06 Nov 2008 01:33:20 +0000
parents 97b08ce5d507
children aa55fd152068
comparison
equal deleted inserted replaced
8111:97b08ce5d507 8112:954dd6e341ce
24 24
25 #include <stdint.h> 25 #include <stdint.h>
26 #include "libavutil/common.h" 26 #include "libavutil/common.h"
27 27
28 #ifdef FRAC_BITS 28 #ifdef FRAC_BITS
29 # define MULL(a, b) \ 29 # define MULL MULL
30 ({ int lo, hi;\ 30 static inline av_const int MULL(int a, int b)
31 __asm__("smull %0, %1, %2, %3 \n\t"\ 31 {
32 "mov %0, %0, lsr %4\n\t"\ 32 int lo, hi;
33 "add %1, %0, %1, lsl %5\n\t"\ 33 __asm__("smull %0, %1, %2, %3 \n\t"
34 : "=&r"(lo), "=&r"(hi)\ 34 "mov %0, %0, lsr %4 \n\t"
35 : "r"(b), "r"(a), "i"(FRAC_BITS), "i"(32-FRAC_BITS));\ 35 "add %1, %0, %1, lsl %5 \n\t"
36 hi; }) 36 : "=&r"(lo), "=&r"(hi)
37 : "r"(b), "r"(a), "i"(FRAC_BITS), "i"(32-FRAC_BITS));
38 return hi;
39 }
37 #endif 40 #endif
38 41
39 #ifdef HAVE_ARMV6 42 #ifdef HAVE_ARMV6
40 static inline av_const int MULH(int a, int b) 43 static inline av_const int MULH(int a, int b)
41 { 44 {