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

Rich assembly instruction syntax #1522

Open
chriseth opened this issue Jul 2, 2024 · 0 comments
Open

Rich assembly instruction syntax #1522

chriseth opened this issue Jul 2, 2024 · 0 comments

Comments

@chriseth
Copy link
Member

chriseth commented Jul 2, 2024

With registers-in-memory, the generated assembly instruction list is not too readable any more:

shl 12, 13, 20, 4

While it used to be

a4 = shl(a12 + 13, a20)

People have to know which arguments in the instruction do what, also which instructions are used as constants and which instructions are used as register indices.

This proposal allows the instructions to use a richer syntax in the sense that instructions do not always have to use , as the separator between arguments. It could look like the following:

/// declaration:
instr shl "a" X + Y, "a" Z -> "a" W { ... }

/// use:
shl a12 + 13, a20 -> a4

The compiler would check the correct use of separators for each instruction but not assign any meaning to the separators.

The downside is that this conflicts a little with the use of arbitrary expressions for instruction arguments, but I have the feeling we don't use that for instructions that use registers-in-memory.

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

No branches or pull requests

1 participant