File kino-asm.patch of Package kino
--- ffmpeg/libavcodec/bitstream.h 2008-02-24 07:05:09.000000000 +0100
+++ ffmpeg/libavcodec/bitstream.h 2024-08-16 09:59:21.050168727 +0200
@@ -56,16 +56,28 @@
#if defined(ARCH_X86)
// avoid +32 for shift optimization (gcc should do that ...)
static inline int32_t NEG_SSR32( int32_t a, int8_t s){
+ if (__builtin_constant_p(s))
+ asm ("sarl %1, %0\n\t"
+ : "+r" (a)
+ : "i" (-s & 0x1F)
+ );
+ else
asm ("sarl %1, %0\n\t"
: "+r" (a)
- : "ic" ((uint8_t)(-s))
+ : "c" ((uint8_t)(-s))
);
- return a;
+ return a;
}
static inline uint32_t NEG_USR32(uint32_t a, int8_t s){
+ if (__builtin_constant_p(s))
asm ("shrl %1, %0\n\t"
: "+r" (a)
- : "ic" ((uint8_t)(-s))
+ : "i" (-s & 0x1F)
+ );
+ else
+ asm ("sarl %1, %0\n\t"
+ : "+r" (a)
+ : "c" ((uint8_t)(-s))
);
return a;
}