The MIPS CABAC inline assembly uses 32-bit-only registers and
instructions (sll with $25, movz, movn) and is included by every CABAC
decoder without an inline-asm guard. Compiled with -mips16, as OpenWrt
builds MIPS packages, the assembler rejects it:

  {standard input}:9366: Error: invalid operands `sll $25,$4,0x11'
  {standard input}:9369: Error: opcode not supported on this processor:
  mips32r2 (mips32r2) `movz $6,$16,$17'

Fall back to the C implementation when __mips16 is defined.

Signed-off-by: Rosen Penev <[email protected]>
---
 libavcodec/mips/cabac.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavcodec/mips/cabac.h b/libavcodec/mips/cabac.h
index db2639b2bc..bb66fea6a3 100644
--- a/libavcodec/mips/cabac.h
+++ b/libavcodec/mips/cabac.h
@@ -30,7 +30,7 @@
 #include "libavutil/mips/mmiutils.h"
 #include "config.h"
 
-#if !HAVE_MIPS32R6 && !HAVE_MIPS64R6
+#if !defined(__mips16) && !HAVE_MIPS32R6 && !HAVE_MIPS64R6
 #define get_cabac_inline get_cabac_inline_mips
 static av_always_inline int get_cabac_inline_mips(CABACContext *c,
                                                   uint8_t * const state){
@@ -269,5 +269,5 @@ static av_always_inline int 
get_cabac_bypass_sign_mips(CABACContext *c, int val)
 
     return res;
 }
-#endif /* !HAVE_MIPS32R6 && !HAVE_MIPS64R6 */
+#endif /* !defined(__mips16) && !HAVE_MIPS32R6 && !HAVE_MIPS64R6 */
 #endif /* AVCODEC_MIPS_CABAC_H */
-- 
2.55.0

_______________________________________________
ffmpeg-devel mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to