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

Some improvements to aarch64 pseudo-assembly #741

Merged
merged 3 commits into from
Oct 10, 2024
Merged

Conversation

hernanponcedeleon
Copy link
Owner

@hernanponcedeleon hernanponcedeleon commented Sep 20, 2024

This PR adds support for

  • return instructions
  • nop instructions
  • hexa constant
  • registers name using underscored names
  • special handling for zero registers (similar to RISCV)

It also enables some more passes for litmus code.

TODO

Copy link
Collaborator

@ThomasHaas ThomasHaas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@hernanponcedeleon
Copy link
Owner Author

I clarified with Luc about the zero registers (see herd/herdtools7#988). Memory orderings are preserved (thus we need to keep loads targeting zero registers, but use a dummy register), but there are no data/addr/ctrl dependencies. Thus, we need to replace regWriters of the form zr <- e with dummy <- e ; zr <- 0. Also, since zero registers are not necessarily initialized explicitly in litmus code, the pass adds zr <- 0 before any RegReader using zr.

@hernanponcedeleon
Copy link
Owner Author

Tested by @db7 on tests generated from real assembly. @ThomasHaas unless you have further comments I will merge

@hernanponcedeleon
Copy link
Owner Author

@ThomasHaas as we discussed, I ended up fully moving the transformation to the parsing rather than trying to add zero registers to the core language to avoid problems with all the other passes.

AFAIK the current behavior should be equivalent to herd7, e.g. this program

RISCV xzr
{
0:x6=x; 0:x8=y;
x=1; y=0;
}
 P0          ;
 lw x0,0(x6) ;
 sw x0,0(x8) ;
exists (y=0)

generates a witness where the read value is one, but the value is discarded

@ThomasHaas
Copy link
Collaborator

ThomasHaas commented Oct 4, 2024

Sounds good. I will approve once the CI is done.

EDIT: You have this TODO about the relation analysis. You should fix that before merging.

Copy link
Collaborator

@ThomasHaas ThomasHaas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@hernanponcedeleon
Copy link
Owner Author

I am waiting for @db7 to finish some testing and if there are no problems, I will merge

@db7
Copy link

db7 commented Oct 9, 2024

I am waiting for @db7 to finish some testing and if there are no problems, I will merge

The test is still running. The generation of test cases is still quite inefficient.

@hernanponcedeleon hernanponcedeleon merged commit 95fe0c3 into development Oct 10, 2024
1 check passed
ThomasHaas pushed a commit that referenced this pull request Oct 10, 2024
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