Add extract-over-extend simplification for partial-width extracts - #800
Open
the-mr-dave wants to merge 2 commits into
Open
Add extract-over-extend simplification for partial-width extracts#800the-mr-dave wants to merge 2 commits into
the-mr-dave wants to merge 2 commits into
Conversation
sign_extend/zero_extend only add bits above the original value, so extracting bits [hi:0] where hi falls anywhere between the original width and the full extended width always gives back a smaller extend of the original value (or the original value itself, if no padding bits survive). Co-authored-by: rvinton <rvinton@users.noreply.github.com>
Covers extract fully undoing an extend, partial reduction (extract width between the original and the fully extended width), and the two guard cases where the rule must not apply (extract of the full extended width, extract of a plain variable). Co-authored-by: rvinton <rvinton@users.noreply.github.com>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
extracting bits [hi:0] where hi falls between the original width and the
full extended width always gives back a smaller extend of the original
value (or the original value itself, if no padding bits survive).
cases (extract of the full extended width, extract of a plain variable)
that must not trigger the rule.