[FFmpeg-devel] [PATCH] checkasm/riscv: use t0 as alternative link register

Rémi Denis-Courmont remi at remlab.net
Thu Nov 16 18:04:51 EET 2023


The unprivileged ISA specification says that either RA or T0 should be
used for this purpose. Other registers may confuse the return address
prediction stack.
---
 tests/checkasm/riscv/checkasm.S | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/tests/checkasm/riscv/checkasm.S b/tests/checkasm/riscv/checkasm.S
index 73ca85f344..b902ab1043 100644
--- a/tests/checkasm/riscv/checkasm.S
+++ b/tests/checkasm/riscv/checkasm.S
@@ -123,10 +123,10 @@ func checkasm_get_wrapper, v
 
         /* Call the tested function */
         la.tls.ie t0, checked_func
-        add     t0, tp, t0
-        ld      t1, (t0)
-        sd      zero, (t0)
-        jalr    t1
+        add     t1, tp, t0
+        ld      t0, (t1)
+        sd      zero, (t1)
+        jalr    t0
 
         /* Check special register values */
         la.tls.ie t0, saved_regs
-- 
2.42.0



More information about the ffmpeg-devel mailing list