Skip to content

Commit 7f968e3

Browse files
committed
[RISCV] Improve BCLRITwoBitsMaskHigh SDNodeXForm. NFC
Use getZExtValue instead of getSExtValue since we are going to overwrite the sign extension on RV32. getZExtValue should be cheaper than getSExtValue. Use maskLeadingOnes to improve readability.
1 parent 2575ea6 commit 7f968e3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

llvm/lib/Target/RISCV/RISCVInstrInfoZb.td

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,9 @@ def BCLRITwoBitsMaskLow : SDNodeXForm<imm, [{
124124
}]>;
125125

126126
def BCLRITwoBitsMaskHigh : SDNodeXForm<imm, [{
127-
uint64_t I = N->getSExtValue();
127+
uint64_t I = N->getZExtValue();
128128
if (!Subtarget->is64Bit())
129-
I |= 0xffffffffull << 32;
129+
I |= maskLeadingOnes<uint64_t>(32);
130130
return CurDAG->getTargetConstant(llvm::Log2_64(~I), SDLoc(N),
131131
N->getValueType(0));
132132
}]>;

0 commit comments

Comments
 (0)