[llvm] [RISCV] Add codegen support for Zvfbfmin (PR #87911)
Jianjian Guan via llvm-commits
llvm-commits at lists.llvm.org
Wed Apr 10 07:35:27 PDT 2024
================
@@ -1080,6 +1080,21 @@ RISCVTargetLowering::RISCVTargetLowering(const TargetMachine &TM,
}
}
+ // TODO: Could we merge some code with zvfhmin?
+ if (Subtarget.hasVInstructionsBF16()) {
+ for (MVT VT : BF16VecVTs) {
+ if (!isTypeLegal(VT))
+ continue;
+ setOperationAction({ISD::FP_ROUND, ISD::FP_EXTEND}, VT, Custom);
+ setOperationAction({ISD::VP_FP_ROUND, ISD::VP_FP_EXTEND}, VT, Custom);
+ setOperationAction({ISD::CONCAT_VECTORS, ISD::INSERT_SUBVECTOR,
+ ISD::EXTRACT_SUBVECTOR, ISD::SCALAR_TO_VECTOR},
+ VT, Custom);
+ setOperationAction({ISD::LOAD, ISD::STORE}, VT, Custom);
+ // TODO: Promote to fp32.
----------------
jacquesguan wrote:
> I'm curious what SPLAT_VECTOR for F16Minimal does since the scalar FP16 type isn't guaranteed legal with F16Minimal.
I create a pr https://github.com/llvm/llvm-project/pull/88275 to add the constraint for `SPLAT_VECTOR`.
https://github.com/llvm/llvm-project/pull/87911
More information about the llvm-commits
mailing list