[llvm] [X86] Lower mathlib call ldexp into scalef when avx512 is enabled (PR #69710)
Phoebe Wang via llvm-commits
llvm-commits at lists.llvm.org
Thu Dec 14 05:18:59 PST 2023
================
@@ -31814,6 +31820,45 @@ static StringRef getInstrStrFromOpNo(const SmallVectorImpl<StringRef> &AsmStrs,
return StringRef();
}
+static SDValue LowerFLDEXP(SDValue Op, SelectionDAG &DAG) {
+ SDValue X = Op.getOperand(0);
+ EVT XScalarTy = X.getValueType();
+ SDValue Exp = Op.getOperand(1);
+
+ SDLoc DL(Op);
+ EVT XVT, ExpVT;
+ SDValue IID;
+ switch (Op.getSimpleValueType().SimpleTy) {
+ default:
+ return SDValue();
+ case MVT::f16:
+ X = DAG.getNode(ISD::FP_EXTEND, DL, MVT::f32, X);
----------------
phoebewang wrote:
Good point! LangRef doesn't give an example f16 case. Should we define it as `@llvm.ldexp.f16.i16(half, i16)`? `i32` is a too large range to be useful for FP16.
https://github.com/llvm/llvm-project/pull/69710
More information about the llvm-commits
mailing list