[llvm] [RISCV][VLOPT] Add support for widening integer mul-add instructions (PR #112219)
Michael Maitland via llvm-commits
llvm-commits at lists.llvm.org
Tue Oct 15 17:09:26 PDT 2024
================
@@ -419,18 +431,7 @@ static OperandInfo getOperandInfo(const MachineInstr &MI,
case RISCV::VWADD_WV:
case RISCV::VWADD_WX:
case RISCV::VWSUB_WV:
- case RISCV::VWSUB_WX:
- // Vector Widening Integer Multiply-Add Instructions
- // Destination EEW=2*SEW and EMUL=2*LMUL. Source EEW=SEW and EMUL=LMUL.
- // Even though the add is a 2*SEW addition, the operands of the add are the
- // Dest which is 2*SEW and the result of the multiply which is 2*SEW.
- case RISCV::VWMACCU_VV:
- case RISCV::VWMACCU_VX:
- case RISCV::VWMACC_VV:
- case RISCV::VWMACC_VX:
- case RISCV::VWMACCSU_VV:
- case RISCV::VWMACCSU_VX:
- case RISCV::VWMACCUS_VX: {
+ case RISCV::VWSUB_WX: {
bool IsOp1 = HasPassthru ? MO.getOperandNo() == 2 : MO.getOperandNo() == 1;
----------------
michaelmaitland wrote:
>From IntrinsicsRISCV.td:
```
// UnMasked Widening Vector Multiply-Add operations, its first operand can not be undef.
// Input: (vector_in, vector_in/scalar, vector_in, vl, policy)
class RISCVTernaryWideUnMasked
```
According to this, it always has a passthru, although I'm not sure it is actually enforced. I think that moving the instructions to where they are now in getOperandInfo is the right move. Are you suggesting this patch needs to take a different approach?
https://github.com/llvm/llvm-project/pull/112219
More information about the llvm-commits
mailing list