[llvm] [llubi] Initial support for floating-point numbers (PR #188453)
Yingwei Zheng via llvm-commits
llvm-commits at lists.llvm.org
Thu Apr 9 11:07:40 PDT 2026
================
@@ -140,6 +263,45 @@ class InstExecutor : public InstVisitor<InstExecutor, void>,
});
}
+ void visitFPBinOp(
+ Instruction &I,
+ function_ref<APFloat(const APFloat &, const APFloat &)> ScalarFn) {
+ FastMathFlags FMF = cast<FPMathOperator>(I).getFastMathFlags();
+ DenormalMode DenormMode = getCurrentDenormalMode(I);
+
+ if (!Ctx.isDefaultFPEnv())
+ reportImmediateUB("Non-constrained floating-point operation assumes "
+ "default floating-point environment");
+
+ visitBinOp(I, [&](const AnyValue &LHS, const AnyValue &RHS) -> AnyValue {
+ if (LHS.isPoison() || RHS.isPoison())
+ return AnyValue::poison();
+
+ AnyValue ValidatedLHS = handleFMFFlags(LHS, FMF, true);
+ AnyValue ValidatedRHS = handleFMFFlags(RHS, FMF, false);
----------------
dtcxzyw wrote:
```suggestion
AnyValue ValidatedRHS = handleFMFFlags(RHS, FMF, /*IsInput=*/true);
```
https://github.com/llvm/llvm-project/pull/188453
More information about the llvm-commits
mailing list