[RISCV] Simpify operand index calculation in createMIROperandComment [nfc]
This commit is contained in:
parent
ac05bc0524
commit
cc45687e1c
|
@ -1504,18 +1504,11 @@ std::string RISCVInstrInfo::createMIROperandComment(
|
|||
OpIdx == 2) {
|
||||
unsigned Imm = MI.getOperand(OpIdx).getImm();
|
||||
RISCVVType::printVType(Imm, OS);
|
||||
} else if (RISCVII::hasSEWOp(TSFlags)) {
|
||||
unsigned NumOperands = MI.getNumExplicitOperands();
|
||||
bool HasPolicy = RISCVII::hasVecPolicyOp(TSFlags);
|
||||
|
||||
// The SEW operand is before any policy operand.
|
||||
if (OpIdx != NumOperands - HasPolicy - 1)
|
||||
return std::string();
|
||||
|
||||
} else if (RISCVII::hasSEWOp(TSFlags) &&
|
||||
OpIdx == RISCVII::getSEWOpNum(MI.getDesc())) {
|
||||
unsigned Log2SEW = MI.getOperand(OpIdx).getImm();
|
||||
unsigned SEW = Log2SEW ? 1 << Log2SEW : 8;
|
||||
assert(RISCVVType::isValidSEW(SEW) && "Unexpected SEW");
|
||||
|
||||
OS << "e" << SEW;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue