From 631960134383d61bb5203d476906cdedd447d60f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Denis-Courmont?= Date: Mon, 22 Jul 2024 22:15:49 +0300 Subject: [PATCH] lavu/riscv: assembly for zicfilp LPAD This instruction, if aligned on a 4-byte boundary, defines a valid target ("landing pad") for an indirect call or jump. Since this instruction is a HINT, it is safe to assemble even if not included in the target instruction set architecture. The necessary alignment is already provided by the `func` macro. However this still lacks the ELF attribute to indicate that the zicfilp is supported in simple mode. This is left for future work as the ELF specification is not ratified as of yet. This will also nonobviously require the assembler to support zicfilp, insofar as the `tail` pseudo-instruction shall clobber T2 (instead of T1) as its temporary register. --- libavutil/riscv/asm.S | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libavutil/riscv/asm.S b/libavutil/riscv/asm.S index c5ac99b859..ec68a042d1 100644 --- a/libavutil/riscv/asm.S +++ b/libavutil/riscv/asm.S @@ -86,6 +86,12 @@ .endm .endm +#if !defined (__riscv_zicfilp) + .macro lpad lpl + auipc zero, \lpl + .endm +#endif + #if defined (__riscv_v_elen) # define RV_V_ELEN __riscv_v_elen #else