-
Notifications
You must be signed in to change notification settings - Fork 566
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
i#3544: RV64: Port test common.getretaddr to RV64 #7169
base: master
Are you sure you want to change the base?
Conversation
Port assembly in common/getretaddr.c to riscv64 and implements tailcall_with_retaddr(). Issue: DynamoRIO#3544
ret | ||
mv t0, a0 | ||
mv a0, ra | ||
jr t0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add comments here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1: comments would be useful to note details of the RISC-V ISA that readers may be unfamiliar with (like t0 is a temp reg that doesn't need to be saved, ra has the return address, ...)
ret | ||
mv t0, a0 | ||
mv a0, ra | ||
jr t0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1: comments would be useful to note details of the RISC-V ISA that readers may be unfamiliar with (like t0 is a temp reg that doesn't need to be saved, ra has the return address, ...)
mv t0, ra | ||
call next_instr | ||
next_instr: | ||
mv a0, ra |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(No action requested)
I'm a little confused by this routine that's called get_retaddr
but seems to get the retaddr of an internal call instr that points to the instr at next_instr
. I don't see how that's useful for the caller.
I guess the precise returned value is not really what the caller wants; maybe the goal is only to verify that this sequence of instrs work under DR (as noted by the "make sure dynamorio can handle this non-call" comment).
Port assembly in common/getretaddr.c to riscv64 and implements tailcall_with_retaddr().
Issue: #3544