[clang] Implementation of '#pragma STDC FENV_ROUND' (PR #89617)

Joshua Cranmer via cfe-commits cfe-commits at lists.llvm.org
Fri May 17 12:32:27 PDT 2024


================
@@ -1232,6 +1232,14 @@ class TargetInfo : public TransferrableTargetInfo,
     return true;
   }
 
+  /// Returns true, if an operations that depends on rounding mode can be
+  /// implemented without changing FP environment. In this case the rounding
+  /// mode is encoded in the bits of implementing instruction.
----------------
jcranmer-intel wrote:

I'm not sure we actually have any (non-target-specific) IR constructs at the moment that actually implement static rounding mode. The documentation for constrained intrinsics says:

> For values other than “round.dynamic” optimization passes may assume that the actual runtime rounding mode (as defined in a target-specific manner) matches the specified rounding mode, but this is not guaranteed.

It's also the case that static rounding mode may be a less-than-global decision. X86 AVX512/AVX10 has static rounding mode, which is a subtarget consideration, but even then, it's not entirely clear that they would be absolutely preferred.

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


More information about the cfe-commits mailing list