-
Notifications
You must be signed in to change notification settings - Fork 172
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
Simplify Zicsr AST #645
base: master
Are you sure you want to change the base?
Simplify Zicsr AST #645
Conversation
Ah I understand the motivation now. In order to avoid losing the
|
I am... reasonably certain we haven't lost any information and that I haven't changed semantics. Rather than pass in a union and conditionally call |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the split into two separate AST clauses here but I think this changes the behaviour to no longer be correct.
This required splitting many of the AST constructors.
Zicsr instructions can take an immediate or a register index for their source operand. Don't pun in the AST using a boolean to distinguish, and instead use two constructors in the AST scattered union.
e46e077
to
35eb511
Compare
Split out from and sitting atop #617, the last commit here is the salient one. This transforms a
bool * regidx
under oneast
data constructor into twoast
data constructors, allowing us to stop punning betweenregidx
andbits(5)
. This will be significant in light of #617 for supporting the E extension, whereregidx
will be (isomorphic to)bits(4)
; see #646.