-
Notifications
You must be signed in to change notification settings - Fork 20
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
Long semantically direct jumps #125
Comments
You are right that this issue got introduced by mistake in PR #122. We forgot about the semantically direct jumps. We should undo that PR. The |
Update in #126 |
How strong is the preference to retaining use of |
When I originally posted this, it was a strong preference for any register other than Now that |
Yes, will stick with |
I would much prefer that we not break the long-standing convention of using x6 for tail. The choice is entirely arbitrary, so it should be for the CFI spec to bend to the existing standards and conventions, not for them to bend to your wishes, unless necessary. Please reopen this issue. |
Is it possible to use x6 as label register? Is there any benefit for using x7 instead of x6 as label register? |
The choice of |
Sorry, I don't really understand your idea. |
You asked "Is there any benefit for using x7 instead of x6 as label register" |
Thank you for your elaboration. I have no opinion about to use x6 as label register now. |
I don't care that you're using x7 for the label register. I care that you're not using x6 as the tail call register, which is a long-standing convention codified in riscv-asm. |
There is a presupposition in #112 that functions/PLT entries whose address is not taken don't need landing pads, and that direct calls to a function/PLT entry can bypass the landing pad. This is currently true only for objects less than 1 MiB and only if relaxation is enabled in the code model; if relaxation is not possible, jumps become an AUIPC/JALR(rd=x0,rs1=x6) sequence and calls AUIPC/JALR(rd=x1,rs1=x1) sequence, both of which are considered indirect calls by the currently proposed ISA and therefore require landing pads despite being semantically direct.
TAIL can be changed to use (rd=x7,rs1=x7) but there is no feasible option for CALL (all NO_LP_EXPECTED JALRs have rd=x0 or rd=x7) or PLT entries that can report failure.
I think that the simplest expression that allows for both ABI and alternate(t0) returns, software-guarded jumps, and semantically direct calls with an ABI or non-ABI return address is
Requiring all CALLs outside the relaxation range to set up
x7
would cost 1085KiB in a labeled version of libQt5WebKitWidgets.so.5.212.0. This increases to 1649KiB ifx7
setup is done by the compiler and not deleteable after CALL->JAL relaxation.The text was updated successfully, but these errors were encountered: