Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
* [FFmpeg-devel] [PATCH] checkasm/riscv: use t0 as alternative link register
@ 2023-11-16 16:04 Rémi Denis-Courmont
  2023-11-16 16:07 ` Rémi Denis-Courmont
  0 siblings, 1 reply; 2+ messages in thread
From: Rémi Denis-Courmont @ 2023-11-16 16:04 UTC (permalink / raw)
  To: ffmpeg-devel

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

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [FFmpeg-devel] [PATCH] checkasm/riscv: use t0 as alternative link register
  2023-11-16 16:04 [FFmpeg-devel] [PATCH] checkasm/riscv: use t0 as alternative link register Rémi Denis-Courmont
@ 2023-11-16 16:07 ` Rémi Denis-Courmont
  0 siblings, 0 replies; 2+ messages in thread
From: Rémi Denis-Courmont @ 2023-11-16 16:07 UTC (permalink / raw)
  To: ffmpeg-devel

Le torstaina 16. marraskuuta 2023, 18.04.51 EET Rémi Denis-Courmont a écrit :
> 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.

Need more sleep. This is true for the link register (the destination operand), 
not the branch target (the source operand). Please ignore.

-- 
雷米‧德尼-库尔蒙
http://www.remlab.net/



_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-11-16 16:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-16 16:04 [FFmpeg-devel] [PATCH] checkasm/riscv: use t0 as alternative link register Rémi Denis-Courmont
2023-11-16 16:07 ` Rémi Denis-Courmont

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git