[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
Fri Nov 7 01:31:12 PST 2025


================
@@ -2590,6 +2590,26 @@ X86TargetLowering::X86TargetLowering(const X86TargetMachine &TM,
     setOperationAction(ISD::STRICT_UINT_TO_FP, MVT::i128, Custom);
   }
 
+  if (Subtarget.hasAVX512()) {
+    for (MVT VT : { MVT::f32, MVT::f64, MVT::v16f32, MVT::v8f64})
+      setOperationAction(ISD::FLDEXP, VT, Custom);
+    
+    if (Subtarget.hasVLX()) {
+      for (MVT VT : { MVT::v4f32, MVT::v2f64, MVT::v8f32, MVT::v4f64 }) 
+        setOperationAction(ISD::FLDEXP, VT, Custom);
----------------
RKSimon wrote:

We might be better off allowing these on non-VLX targets and just widening (with zero) in the upper elements to 512-bits

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


More information about the llvm-commits mailing list