[clang] [llvm] [ARM] enable FENV_ACCESS pragma support for hard-float targets (PR #137101)

Erik Enikeev via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 27 17:14:28 PST 2025


================
@@ -614,16 +614,25 @@ ARMTargetLowering::ARMTargetLowering(const TargetMachine &TM_,
       for (auto Op : {ISD::STRICT_FADD, ISD::STRICT_FSUB, ISD::STRICT_FMUL,
                       ISD::STRICT_FDIV, ISD::STRICT_FMA, ISD::STRICT_FSQRT})
         setOperationAction(Op, MVT::f64, Legal);
+      
+      setOperationAction(ISD::STRICT_FP_ROUND, MVT::f32, Legal);
+      setOperationAction(ISD::STRICT_FP_EXTEND, MVT::f64, Legal);
----------------
Varnike wrote:

1. Corrected for  `fpext f16->f64` case

according to checks in `LowerFP_EXTEND`:
```
  assert((!Subtarget->hasFP64() || !Subtarget->hasFPARMv8Base()) &&
         "With both FP DP and 16, any FP conversion is legal!");
```
if both features are enabled we can mark it Legal and mark Custom otherwise.

3. For `f128->f32` case `fptrunc` will be softened anyway, since f128 is not legal.

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


More information about the llvm-commits mailing list