[FFmpeg-devel] [PATCH 2/9] lavu/riscv: grok B as an extension

Rémi Denis-Courmont remi at remlab.net
Mon Jul 22 21:44:21 EEST 2024


The RISC-V B bit manipulation extension was ratified only two months ago.
But it is strictly equivalent to the union of the zba, zbb and zbs
extensions which were defined almost 3 years earlier. Rather than require
new assembler, we can just match the extension name manually and translate
it into its constituent parts.
---
 libavutil/riscv/asm.S | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/libavutil/riscv/asm.S b/libavutil/riscv/asm.S
index 78e9defbd4..0c29680d84 100644
--- a/libavutil/riscv/asm.S
+++ b/libavutil/riscv/asm.S
@@ -38,7 +38,12 @@
 
         .macro  archadd ext=, more:vararg
             .ifnb   \ext
-                .option arch, +\ext
+                .ifc    \ext, b
+                # B was defined later, is known to fewer assemblers.
+                archadd zba, zbb, zbs
+                .else
+                    .option arch, +\ext
+                .endif
                 archadd \more
             .endif
         .endm
-- 
2.45.2



More information about the ffmpeg-devel mailing list