================
@@ -12177,6 +12194,44 @@ SDValue
RISCVTargetLowering::LowerINTRINSIC_WO_CHAIN(SDValue Op,
return DAG.getNode(ISD::INTRINSIC_WO_CHAIN, DL, MVT::i32, AbdsumauId, Lo,
Rs1Hi, Rs2Hi);
}
+ case Intrinsic::riscv_pmulh:
+ case Intrinsic::riscv_pmulhr:
+ case Intrinsic::riscv_pmulhu:
+ case Intrinsic::riscv_pmulhru:
+ case Intrinsic::riscv_pmulhsu:
+ case Intrinsic::riscv_pmulhrsu: {
+ EVT VT = Op.getValueType();
+ unsigned Opc = getRVPMulHighOpcode(IntNo);
+
+ // RV32 has no single instruction for 64-bit packed multiply high. Split
+ // v4i16 into two v2i16 packed operations, and split v2i32 into scalar i32
+ // operations so isel can use MULH*.
+ if (!Subtarget.is64Bit() && VT == MVT::v4i16) {
+ auto [Rs1Lo, Rs1Hi] = DAG.SplitVector(Op.getOperand(1), DL);
+ auto [Rs2Lo, Rs2Hi] = DAG.SplitVector(Op.getOperand(2), DL);
+ SDValue Id = Op.getOperand(0);
+ SDValue Lo = DAG.getNode(ISD::INTRINSIC_WO_CHAIN, DL, MVT::v2i16, Id,
----------------
topperc wrote:
Can we directly create MULHU/MULHS etc. nodes here?
https://github.com/llvm/llvm-project/pull/211223
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits