[clang] [clang] Use constant rounding mode for floating literals (PR #90877)
Erich Keane via cfe-commits
cfe-commits at lists.llvm.org
Fri May 3 08:00:13 PDT 2024
================
@@ -79,3 +79,16 @@ float V7 = []() -> float {
0x0.000001p0F);
}();
// CHECK: @V7 = {{.*}} float 1.000000e+00
+
+template<float V> struct L {
+ constexpr L() : value(V) {}
+ float value;
+};
+
+#pragma STDC FENV_ROUND FE_DOWNWARD
----------------
erichkeane wrote:
I meant something like:
``` template<typename T, T V> void foo() {
#pragma STDC FENV_ROUND FE_DOWNWARD
T Val = V;
// Should be: { float 0x3FB9999980000000 }
}
#pragma STDC FENV_ROUND FE_UPDWARD
foo<float, 0.1F>();
https://github.com/llvm/llvm-project/pull/90877
More information about the cfe-commits
mailing list