diff mbox series

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

Message ID 20240722184431.40853-2-remi@remlab.net
State New
Headers show
Series [FFmpeg-devel,1/9] lavu/riscv: allow any number of extensions | expand

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Rémi Denis-Courmont July 22, 2024, 6:44 p.m. UTC
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 mbox series

Patch

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