1 X-Git-Url: http://git.ffmpeg.org/gitweb/ffmpeg.git/blobdiff_plain/ccc684993276248d64c328a810fb7714af2f4c70..effadce6c756247ea8bae32dc13bb3e6f464f0eb:/libavcodec/x86/mathops.h
3 diff --git a/libavcodec/x86/mathops.h b/libavcodec/x86/mathops.h
4 index 6298f5ed19..ca7e2dffc1 100644
5 --- a/libavcodec/x86/mathops.h
6 +++ b/libavcodec/x86/mathops.h
8 static av_always_inline av_const int MULL(int a, int b, unsigned shift)
11 + if (__builtin_constant_p(shift))
14 "shrdl %4, %%edx, %%eax \n\t"
15 :"=a"(rt), "=d"(dummy)
16 - :"a"(a), "rm"(b), "ci"((uint8_t)shift)
17 + :"a"(a), "rm"(b), "i"(shift & 0x1F)
22 + "shrdl %4, %%edx, %%eax \n\t"
23 + :"=a"(rt), "=d"(dummy)
24 + :"a"(a), "rm"(b), "c"((uint8_t)shift)
29 @@ -113,19 +121,31 @@ __asm__ volatile(\
30 // avoid +32 for shift optimization (gcc should do that ...)
31 #define NEG_SSR32 NEG_SSR32
32 static inline int32_t NEG_SSR32( int32_t a, int8_t s){
33 + if (__builtin_constant_p(s))
34 __asm__ ("sarl %1, %0\n\t"
36 - : "ic" ((uint8_t)(-s))
40 + __asm__ ("sarl %1, %0\n\t"
42 + : "c" ((uint8_t)(-s))
47 #define NEG_USR32 NEG_USR32
48 static inline uint32_t NEG_USR32(uint32_t a, int8_t s){
49 + if (__builtin_constant_p(s))
50 __asm__ ("shrl %1, %0\n\t"
52 - : "ic" ((uint8_t)(-s))
56 + __asm__ ("shrl %1, %0\n\t"
58 + : "c" ((uint8_t)(-s))