@@ -129,28 +129,6 @@ static raw_ostream &operator<<(raw_ostream &OS, const OperandInfo &OI) {
129129
130130namespace llvm {
131131namespace RISCVVType {
132- // / Return the RISCVII::VLMUL that is two times VLMul.
133- // / Precondition: VLMul is not LMUL_RESERVED or LMUL_8.
134- static RISCVII::VLMUL twoTimesVLMUL (RISCVII::VLMUL VLMul) {
135- switch (VLMul) {
136- case RISCVII::VLMUL::LMUL_F8:
137- return RISCVII::VLMUL::LMUL_F4;
138- case RISCVII::VLMUL::LMUL_F4:
139- return RISCVII::VLMUL::LMUL_F2;
140- case RISCVII::VLMUL::LMUL_F2:
141- return RISCVII::VLMUL::LMUL_1;
142- case RISCVII::VLMUL::LMUL_1:
143- return RISCVII::VLMUL::LMUL_2;
144- case RISCVII::VLMUL::LMUL_2:
145- return RISCVII::VLMUL::LMUL_4;
146- case RISCVII::VLMUL::LMUL_4:
147- return RISCVII::VLMUL::LMUL_8;
148- case RISCVII::VLMUL::LMUL_8:
149- default :
150- llvm_unreachable (" Could not multiply VLMul by 2" );
151- }
152- }
153-
154132// / Return EMUL = (EEW / SEW) * LMUL where EEW comes from Log2EEW and LMUL and
155133// / SEW are from the TSFlags of MI.
156134static std::pair<unsigned , bool >
@@ -559,9 +537,8 @@ static OperandInfo getOperandInfo(const MachineOperand &MO,
559537 case RISCV::VFWCVT_F_X_V:
560538 case RISCV::VFWCVT_F_F_V: {
561539 unsigned Log2EEW = IsMODef ? MILog2SEW + 1 : MILog2SEW;
562- RISCVII::VLMUL EMUL =
563- IsMODef ? RISCVVType::twoTimesVLMUL (MIVLMul) : MIVLMul;
564- return OperandInfo (EMUL, Log2EEW);
540+ return OperandInfo (RISCVVType::getEMULEqualsEEWDivSEWTimesLMUL (Log2EEW, MI),
541+ Log2EEW);
565542 }
566543
567544 // Def and Op1 uses EEW=2*SEW and EMUL=2*LMUL. Op2 uses EEW=SEW and EMUL=LMUL
@@ -581,9 +558,8 @@ static OperandInfo getOperandInfo(const MachineOperand &MO,
581558 bool IsOp1 = HasPassthru ? MO.getOperandNo () == 2 : MO.getOperandNo () == 1 ;
582559 bool TwoTimes = IsMODef || IsOp1;
583560 unsigned Log2EEW = TwoTimes ? MILog2SEW + 1 : MILog2SEW;
584- RISCVII::VLMUL EMUL =
585- TwoTimes ? RISCVVType::twoTimesVLMUL (MIVLMul) : MIVLMul;
586- return OperandInfo (EMUL, Log2EEW);
561+ return OperandInfo (RISCVVType::getEMULEqualsEEWDivSEWTimesLMUL (Log2EEW, MI),
562+ Log2EEW);
587563 }
588564
589565 // Vector Integer Extension
@@ -626,9 +602,8 @@ static OperandInfo getOperandInfo(const MachineOperand &MO,
626602 bool IsOp1 = HasPassthru ? MO.getOperandNo () == 2 : MO.getOperandNo () == 1 ;
627603 bool TwoTimes = IsOp1;
628604 unsigned Log2EEW = TwoTimes ? MILog2SEW + 1 : MILog2SEW;
629- RISCVII::VLMUL EMUL =
630- TwoTimes ? RISCVVType::twoTimesVLMUL (MIVLMul) : MIVLMul;
631- return OperandInfo (EMUL, Log2EEW);
605+ return OperandInfo (RISCVVType::getEMULEqualsEEWDivSEWTimesLMUL (Log2EEW, MI),
606+ Log2EEW);
632607 }
633608
634609 // Vector Mask Instructions
0 commit comments