[clang] [CIR] Upstream floating point literal expressions (PR #129304)

Bruno Cardoso Lopes via cfe-commits cfe-commits at lists.llvm.org
Fri Feb 28 16:48:22 PST 2025


================
@@ -57,3 +57,15 @@ bool boolfunc() { return true; }
 // CHECK:   %0 = cir.const #true
 // CHECK:   cir.return %0 : !cir.bool
 // CHECK: }
+
+float floatfunc() { return 42.42f; }
+// CHECK: cir.func @floatfunc() -> !cir.float {
+// CHECK:   %0 = cir.const #cir.fp<4.242000e+01> : !cir.float
----------------
bcardosolopes wrote:

> How consistent is CIR with literal representation across platforms?

We the same as MLIR LLVM dialect those (which is MLIR's own parsing/printing), we haven't tested much past AArch64 and x86_64 so not a lot of data to say much more - we haven't had issues so far though.

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


More information about the cfe-commits mailing list