Skip to content
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

Fix function_prologue example #22

Merged
merged 1 commit into from
Feb 14, 2025
Merged

Fix function_prologue example #22

merged 1 commit into from
Feb 14, 2025

Conversation

fmayer
Copy link
Contributor

@fmayer fmayer commented Feb 11, 2025

We don't need to (x)or the tag into the sp. That makes returning from
the function harder, and serves no benefit because we add the tag
separately into each of the objects anyway.

@fmayer fmayer marked this pull request as draft February 11, 2025 20:52
@fmayer fmayer marked this pull request as ready for review February 11, 2025 21:02
@fmayer
Copy link
Contributor Author

fmayer commented Feb 11, 2025

@deepak0414

@cmuellner
Copy link
Contributor

It would be great if the example also showed that the tag needs to be set (with SETTAG).
Otherwise, this example produces tagged pointers without tagged memory.

I propose to move the example into an appendix (like many other specifications have done) and make it more complete (what is needed in the epilogue if the prologue tags pointers and memory?)

Further, using OR to set a pointer tag only works, if there is a guarantee that the pointer, that is being tagged, is not tagged yet. In the example a comment like "# We assume that SP holds a non-tagged pointer" might be sufficient.

@fmayer fmayer force-pushed the patch-1 branch 2 times, most recently from c708d8c to c066c6d Compare February 14, 2025 23:23
@fmayer
Copy link
Contributor Author

fmayer commented Feb 14, 2025

It would be great if the example also showed that the tag needs to be set (with SETTAG). Otherwise, this example produces tagged pointers without tagged memory.

I propose to move the example into an appendix (like many other specifications have done) and make it more complete (what is needed in the epilogue if the prologue tags pointers and memory?)

Further, using OR to set a pointer tag only works, if there is a guarantee that the pointer, that is being tagged, is not tagged yet. In the example a comment like "# We assume that SP holds a non-tagged pointer" might be sufficient.

Thanks for the comment, done.

We don't need to (x)or the tag into the sp. That makes returning from
the function harder, and serves no benefit because we add the tag
separately into each of the objects anyway.

Signed-off-by: Florian Mayer <[email protected]>
@deepak0414 deepak0414 merged commit 2937c2d into riscv:main Feb 14, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants