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

[RTGTest] Add store instructions #8118

Open
wants to merge 1 commit into
base: maerhart-rtgtest-arithmetic-instructions
Choose a base branch
from

Conversation

maerhart
Copy link
Member

Should we support labels as operands to store instructions? (and consequently also load instructions)

Assemblers typically only support them as replacements for both the immediate AND the base register. Otherwise, the label address needs to be small enough to fit in the immediate or the assembler inserts additional instructions to load the label in a register to compute the offset (I think most assemblers just error out here, e.g., GAS does). So lw ra, data is fine but lw ra, data(zero) is not.

Not supporting them would mean we must manually insert the additional instructions to move a label value into a register and add it to the base register. The front-end could provide a utility function for that. It wouldn't lead to performance-optimal binary but we don't care about runtime performance anyway.

@maerhart maerhart added the RTG Involving the `rtg` dialect label Jan 23, 2025
@maerhart maerhart requested review from youngar and darthscsi January 23, 2025 11:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
RTG Involving the `rtg` dialect
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant