Skip to content

Commit 622d689

Browse files
committed
[RISCV] Revise RISCVInstPrinter::printVTypeI to not assume there are 3 invalid vtype bits.
Instead of checking [10:8]. Check for non-zero in 8 and above. Addresses a post-commit comment from @jrtc27 in D114581.
1 parent 51dc466 commit 622d689

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

llvm/lib/Target/RISCV/MCTargetDesc/RISCVInstPrinter.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,9 +171,9 @@ void RISCVInstPrinter::printVTypeI(const MCInst *MI, unsigned OpNo,
171171
const MCSubtargetInfo &STI, raw_ostream &O) {
172172
unsigned Imm = MI->getOperand(OpNo).getImm();
173173
// Print the raw immediate for reserved values: vlmul[2:0]=4, vsew[2:0]=0b1xx,
174-
// or non-zero bits 8/9/10.
174+
// or non-zero in bits 8 and above.
175175
if (RISCVVType::getVLMUL(Imm) == RISCVII::VLMUL::LMUL_RESERVED ||
176-
RISCVVType::getSEW(Imm) > 64 || (Imm & 0x700) != 0) {
176+
RISCVVType::getSEW(Imm) > 64 || (Imm >> 8) != 0) {
177177
O << Imm;
178178
return;
179179
}

0 commit comments

Comments
 (0)