-
Notifications
You must be signed in to change notification settings - Fork 384
[MooreToCore] Add support for moore::string_constant #7628 #7752
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
Conversation
| // CHECK: hw.constant 1415934836 | ||
| %str = moore.string_constant "Test" : i2 | ||
| // CHECK: hw.constant 0 | ||
| %str_empty = moore.string_constant "" : i128 |
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.
Maybe add the : i2 and : i128 type suffices to the CHECK lines, to make sure the conversion does the right thing.
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.
Done. Corrected types as mentioned above and added type suffixes to the CHECK lines.
52e413f to
19a4bfa
Compare
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.
LGTM besides a minor nit on the hw.constant return type 👍 Thanks a lot for doing this work!
Lower string constant ops to constant op in the hw dialect.
19a4bfa to
6e5adeb
Compare
|
Really nice! @jpinot If you want, feel free to get commit access to CIRCT to merge the PR yourself, or let me know if I should land it for you. |
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.
LGTM! 💯
Lower
StringConstantOptohw::ConstantOp. Encodes strings asAPIntwith byte-width based on string length, enabling representation of Moore string constant as bit vectors.