-
Notifications
You must be signed in to change notification settings - Fork 7
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
feat: Constant-folding of integer and logic operations #1009
Merged
Merged
Changes from all commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
9c96a58
Rename function.
cqc-alec 449b235
Move function and make public.
cqc-alec 751d374
Define convenience method to get a pair of input values.
cqc-alec 2f4899f
Fix signature of divmod operations (output typerow not tuple).
cqc-alec 824e404
Define const-folders for iwiden_u and iwiden_s.
cqc-alec d5a57dc
Define const folders for inarrow_u and inarrow_s.
cqc-alec 7996833
Define const folder for not.
cqc-alec 4fb6a1f
Refactor IntOpType to store an arbitrary vector of log-widths.
cqc-alec 57151d0
Fix signatures of itobool and ifrombool.
cqc-alec 4a34abb
Define const folders for remaining integer operations and add some te…
cqc-alec fc6083f
Extend test (panics because of #996 ).
cqc-alec 02f4592
Temporarily mark test as "should panic".
cqc-alec 57fa958
Refactor.
cqc-alec cace68a
Fix inot folding.
cqc-alec e68a422
Move `Folder` into `extension::const_fold`.
cqc-alec daf78d6
Add tests for all integer const-folding functions.
cqc-alec 4917d92
Remove a lot of unneeded `into()`.
cqc-alec f067549
Fix const folder for `not`.
cqc-alec 9f3f1bd
Add test for const-folding `not`.
cqc-alec cd34aa9
Use a better name.
cqc-alec 197aec5
Use better names.
cqc-alec befb826
Move assert_fully_folded() into crate::utils::test.
cqc-alec 8a96f2e
Move integer const-folding tests to a more suitable place.
cqc-alec df16791
Improve test coverage for idivmod_s.
cqc-alec ec39e69
Merge branch 'main' into constfoldint
cqc-alec e43d84a
Rename file to avoid clippy warning.
cqc-alec c6bf5c7
Merge branch 'main' into constfoldint
cqc-alec 3b326bd
Merge branch 'main' into constfoldint
cqc-alec bc41bfd
use new Into<TypeArg> impls
cqc-alec a6feddd
Remove redundant inner module.
cqc-alec 0efe5a4
Rename file.
cqc-alec File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 think all these tests should be moved to a new file src/std_extensions/arithmetic/int_ops/const_fold/test.rs`
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.
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.
You have a redundant
mod test
inside the new file. See my PR