Credit Andrew - update libsndfile to 1.2.2; allow Maxchannels to be greater than...
[goodguy/cinelerra.git] / cinelerra-5.1 / thirdparty / src / ffmpeg-5.1.patch999
1 X-Git-Url: http://git.ffmpeg.org/gitweb/ffmpeg.git/blobdiff_plain/ccc684993276248d64c328a810fb7714af2f4c70..effadce6c756247ea8bae32dc13bb3e6f464f0eb:/libavcodec/x86/mathops.h
2
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
7 @@ -35,12 +35,20 @@
8  static av_always_inline av_const int MULL(int a, int b, unsigned shift)
9  {
10      int rt, dummy;
11 +    if (__builtin_constant_p(shift))
12      __asm__ (
13          "imull %3               \n\t"
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)
18      );
19 +    else
20 +        __asm__ (
21 +            "imull %3               \n\t"
22 +            "shrdl %4, %%edx, %%eax \n\t"
23 +            :"=a"(rt), "=d"(dummy)
24 +            :"a"(a), "rm"(b), "c"((uint8_t)shift)
25 +        );
26      return rt;
27  }
28  
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"
35           : "+r" (a)
36 -         : "ic" ((uint8_t)(-s))
37 +         : "i" (-s & 0x1F)
38      );
39 +    else
40 +        __asm__ ("sarl %1, %0\n\t"
41 +               : "+r" (a)
42 +               : "c" ((uint8_t)(-s))
43 +        );
44      return a;
45  }
46  
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"
51           : "+r" (a)
52 -         : "ic" ((uint8_t)(-s))
53 +         : "i" (-s & 0x1F)
54      );
55 +    else
56 +        __asm__ ("shrl %1, %0\n\t"
57 +               : "+r" (a)
58 +               : "c" ((uint8_t)(-s))
59 +        );
60      return a;
61  }
62