This repository has been archived by the owner on Aug 20, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 177
Conversation
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
seldridge
approved these changes
Mar 13, 2021
Previously, concatenating two SInts where one is of zero-width would return the non-zero-width SInt. This is incorrect because the output of Cat should be of type UInt. Now the ZeroWidth transform will introduce a cast when removing a Cat when the argument type is non-UInt.
jackkoenig
force-pushed
the
fix-zero-width-sint-cat
branch
from
March 14, 2021 02:25
48d7ab5
to
936ff42
Compare
jackkoenig
added
the
Please Merge
Accepted PRs that are ready to be merged. Useful when waiting on CI.
label
Mar 14, 2021
mergify bot
pushed a commit
that referenced
this pull request
Mar 14, 2021
Previously, concatenating two SInts where one is of zero-width would return the non-zero-width SInt. This is incorrect because the output of Cat should be of type UInt. Now the ZeroWidth transform will introduce a cast when removing a Cat when the argument type is non-UInt. (cherry picked from commit fd55c51) # Conflicts: # src/main/scala/firrtl/passes/ZeroWidth.scala
mergify bot
pushed a commit
that referenced
this pull request
Mar 14, 2021
Previously, concatenating two SInts where one is of zero-width would return the non-zero-width SInt. This is incorrect because the output of Cat should be of type UInt. Now the ZeroWidth transform will introduce a cast when removing a Cat when the argument type is non-UInt. (cherry picked from commit fd55c51) # Conflicts: # src/main/scala/firrtl/passes/ZeroWidth.scala
mergify bot
pushed a commit
that referenced
this pull request
Mar 14, 2021
Previously, concatenating two SInts where one is of zero-width would return the non-zero-width SInt. This is incorrect because the output of Cat should be of type UInt. Now the ZeroWidth transform will introduce a cast when removing a Cat when the argument type is non-UInt. (cherry picked from commit fd55c51)
mergify
bot
added
the
Backported
This PR has been backported to marked stable branch
label
Mar 14, 2021
mergify bot
added a commit
that referenced
this pull request
Mar 14, 2021
Previously, concatenating two SInts where one is of zero-width would return the non-zero-width SInt. This is incorrect because the output of Cat should be of type UInt. Now the ZeroWidth transform will introduce a cast when removing a Cat when the argument type is non-UInt. (cherry picked from commit fd55c51) Co-authored-by: Jack Koenig <koenig@sifive.com>
mergify bot
added a commit
that referenced
this pull request
Mar 14, 2021
* Fix cat of zero-width SInt (#2116) Previously, concatenating two SInts where one is of zero-width would return the non-zero-width SInt. This is incorrect because the output of Cat should be of type UInt. Now the ZeroWidth transform will introduce a cast when removing a Cat when the argument type is non-UInt. (cherry picked from commit fd55c51) # Conflicts: # src/main/scala/firrtl/passes/ZeroWidth.scala * Fix merge conflicts Co-authored-by: Jack Koenig <koenig@sifive.com>
mergify bot
added a commit
that referenced
this pull request
Mar 14, 2021
* Fix cat of zero-width SInt (#2116) Previously, concatenating two SInts where one is of zero-width would return the non-zero-width SInt. This is incorrect because the output of Cat should be of type UInt. Now the ZeroWidth transform will introduce a cast when removing a Cat when the argument type is non-UInt. (cherry picked from commit fd55c51) # Conflicts: # src/main/scala/firrtl/passes/ZeroWidth.scala * Fix merge conflicts Co-authored-by: Jack Koenig <koenig@sifive.com>
# for free
to subscribe to this conversation on GitHub.
Already have an account?
#.
Labels
Backported
This PR has been backported to marked stable branch
Please Merge
Accepted PRs that are ready to be merged. Useful when waiting on CI.
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.
Previously, concatenating two SInts where one is of zero-width would
return the non-zero-width SInt. This is incorrect because the output of
Cat should be of type UInt. Now the ZeroWidth transform will introduce a
cast when removing a Cat when the argument type is non-UInt.
Fixes #2096
h/t @drom for finding the issue and h/t @seldridge for identifying the cause.
For the input in #2096 we don't actually emit the expected behavior because we also constant propagate the register, so the result is:
Contributor Checklist
Type of Improvement
API Impact
No impact
Backend Code Generation Impact
No impact
Desired Merge Strategy
Release Notes
Fix bug in zero-width handling when the type of an SInt concatenated with a zero-width SInt could be incorrectly interpreted as an SInt (instead of a UInt) resulting in incorrect constant propagation.
Reviewer Checklist (only modified by reviewer)
Please Merge
?