[FFmpeg-devel] [PATCH] avcodec/x86/mathops: use constrained immediate operands

James Almer jamrial at gmail.com
Sun Jul 16 02:58:32 EEST 2023


Should fix assembling with binutil as >= 2.41

Signed-off-by: James Almer <jamrial at gmail.com>
---
This is IMO a big breakage. binutil's as has until now clipped these values on
its own, and never required the compiler to do it.

 libavcodec/x86/mathops.h | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/libavcodec/x86/mathops.h b/libavcodec/x86/mathops.h
index 6298f5ed19..a08c6193bf 100644
--- a/libavcodec/x86/mathops.h
+++ b/libavcodec/x86/mathops.h
@@ -39,7 +39,7 @@ static av_always_inline av_const int MULL(int a, int b, unsigned shift)
         "imull %3               \n\t"
         "shrdl %4, %%edx, %%eax \n\t"
         :"=a"(rt), "=d"(dummy)
-        :"a"(a), "rm"(b), "ci"((uint8_t)shift)
+        :"a"(a), "rm"(b), "cI"((uint8_t)shift)
     );
     return rt;
 }
@@ -115,16 +115,17 @@ __asm__ volatile(\
 static inline  int32_t NEG_SSR32( int32_t a, int8_t s){
     __asm__ ("sarl %1, %0\n\t"
          : "+r" (a)
-         : "ic" ((uint8_t)(-s))
+         : "Ic" ((uint8_t)(-s))
     );
     return a;
 }
 
 #define NEG_USR32 NEG_USR32
 static inline uint32_t NEG_USR32(uint32_t a, int8_t s){
+
     __asm__ ("shrl %1, %0\n\t"
          : "+r" (a)
-         : "ic" ((uint8_t)(-s))
+         : "Ic" ((uint8_t)(-s))
     );
     return a;
 }
-- 
2.41.0



More information about the ffmpeg-devel mailing list