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

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 26 08:00:14 PDT 2026


================
@@ -187,6 +223,28 @@ class InstExecutor : public InstVisitor<InstExecutor, void> {
     });
   }
 
+  void visitFPUnOp(Instruction &I,
+                   function_ref<AnyValue(const APFloat &)> ScalarFn) {
+    FastMathFlags FMF = cast<FPMathOperator>(I).getFastMathFlags();
+    DenormalMode DenormMode = CurrentFrame->Func.getDenormalMode(
+        I.getType()->getScalarType()->getFltSemantics());
+
+    visitUnOp(I, [&](const AnyValue &Operand) -> AnyValue {
+      if (Operand.isPoison())
+        return AnyValue::poison();
+
+      // Flush input denormals
+      APFloat FInput = handleDenormal(Operand.asFloat(), DenormMode.Input);
----------------
nikic wrote:

This is incorrect: `fneg` is specified as a bitwise op, it must not flush denormals.

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


More information about the llvm-commits mailing list