[llvm] [llubi] Initial support for floating-point numbers (PR #188453)

Yingwei Zheng via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 1 12:06:28 PDT 2026


================
@@ -767,6 +925,50 @@ class InstExecutor : public InstVisitor<InstExecutor, void> {
     });
   }
 
+  void visitFAdd(BinaryOperator &I) {
+    visitFPBinOp(I, [](const APFloat &LHS, const APFloat &RHS) -> AnyValue {
+      APFloat Res = LHS;
+      Res.add(RHS, APFloat::rmNearestTiesToEven);
----------------
dtcxzyw wrote:

Insert a check to ensure we are under the default floating-point environment (TBH it is a bit weird that fadd may cause immediate UB...).


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


More information about the llvm-commits mailing list