Skip to content

Commit

Permalink
Update lib/Dialect/FIRRTL/Import/FIRParser.cpp
Browse files Browse the repository at this point in the history
Co-authored-by: Schuyler Eldridge <schuyler.eldridge@sifive.com>
  • Loading branch information
jackkoenig and seldridge authored Feb 15, 2024
1 parent 96c2f69 commit c667e0c
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions lib/Dialect/FIRRTL/Import/FIRParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2290,13 +2290,8 @@ ParseResult FIRStmtParser::parsePrimExp(Value &result) {
case FIRToken::lp_shr:
// For FIRRTL versions earlier than 4.0.0, insert pad(_, 1) around any
// unsigned shr This ensures the minimum width is 1 (but can be greater)
if (version < FIRVersion(4, 0, 0)) {
auto resultType = result.getType();
if (type_isa<UIntType>(resultType)) {
auto pad = builder.create<PadPrimOp>(result, 1);
result = pad;
}
}
if (version < FIRVersion(4, 0, 0) && type_isa<UIntType>(result.getType()))
result = builder.create<PadPrimOp>(result, 1);
break;
}
return success();
Expand Down

0 comments on commit c667e0c

Please sign in to comment.