[llvm] [X86] Lower mathlib call ldexp into scalef when avx512 is enabled (PR #166839)

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 10 02:29:34 PST 2025


================
@@ -1828,6 +1828,16 @@ X86TargetLowering::X86TargetLowering(const X86TargetMachine &TM,
       setOperationAction(ISD::FCOPYSIGN, VT, Custom);
       setOperationAction(ISD::FCANONICALIZE, VT, Custom);
     }
+
+    for (MVT VT : {MVT::f32, MVT::f64, MVT::v4f32, MVT::v2f64, MVT::v8f32,
+                   MVT::v4f64, MVT::v16f32, MVT::v8f64})
+      setOperationAction(ISD::FLDEXP, VT, Custom);
+
+    if (Subtarget.hasFP16()) {
+      for (MVT VT : {MVT::f16, MVT::v8f16, MVT::v16f16, MVT::v32f16})
----------------
RKSimon wrote:

if we're extending on non-FP16 targets - why not drop the hasFP16 requirement and add it to the default AVX512 type list above? The only tricky one will be MVT::v32f16 which will need splitting / concatenating

I've added better half-vector coverage at #167294

https://github.com/llvm/llvm-project/pull/166839


More information about the llvm-commits mailing list