From 1b444e046082b07968770791996f8d1517951a86 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Fri, 28 Aug 2026 12:33:14 -0700 Subject: [PATCH 1/2] note --- CHANGELOG.md | 2 ++ src/tools/optimization-options.h | 3 ++- test/lit/help/wasm-metadce.test | 4 ++-- test/lit/help/wasm-opt.test | 4 ++-- test/lit/help/wasm2js.test | 4 ++-- 5 files changed, 10 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e26794db203..adb5e6dd10a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,8 @@ Current Trunk - Replace the `BINARYEN_ROOT` environment variable (used by developers who are doing out-of-tree builds of binaryen) with `BINARYEN_BIN` (#9023) - Reject non-natural alignment for atomic memory operations at parse time (#8962) +- Note that fast-math mode can ignore the difference between negative zero and + zero (like clang and gcc). v132 ---- diff --git a/src/tools/optimization-options.h b/src/tools/optimization-options.h index 1e089f0b8c8..a43c92c3fe7 100644 --- a/src/tools/optimization-options.h +++ b/src/tools/optimization-options.h @@ -306,7 +306,8 @@ struct OptimizationOptions : public ToolOptions { .add( "--fast-math", "-ffm", - "Optimize floats without handling corner cases of NaNs and rounding", + "Optimize floats without handling corner cases of NaNs, rounding, and " + "negative zero", OptimizationOptionsCategory, Options::Arguments::Zero, [this](Options*, const std::string&) { passOptions.fastMath = true; }) diff --git a/test/lit/help/wasm-metadce.test b/test/lit/help/wasm-metadce.test index 5b11778ce3c..aef42e966d8 100644 --- a/test/lit/help/wasm-metadce.test +++ b/test/lit/help/wasm-metadce.test @@ -679,8 +679,8 @@ ;; CHECK-NEXT: application ;; CHECK-EMPTY: ;; CHECK-NEXT: --fast-math,-ffm Optimize floats without handling -;; CHECK-NEXT: corner cases of NaNs and -;; CHECK-NEXT: rounding +;; CHECK-NEXT: corner cases of NaNs, rounding, +;; CHECK-NEXT: and negative zero ;; CHECK-EMPTY: ;; CHECK-NEXT: --zero-filled-memory,-uim Assume that an imported memory ;; CHECK-NEXT: will be zero-initialized diff --git a/test/lit/help/wasm-opt.test b/test/lit/help/wasm-opt.test index 12add8d5783..95892a9cc86 100644 --- a/test/lit/help/wasm-opt.test +++ b/test/lit/help/wasm-opt.test @@ -715,8 +715,8 @@ ;; CHECK-NEXT: application ;; CHECK-EMPTY: ;; CHECK-NEXT: --fast-math,-ffm Optimize floats without handling -;; CHECK-NEXT: corner cases of NaNs and -;; CHECK-NEXT: rounding +;; CHECK-NEXT: corner cases of NaNs, rounding, +;; CHECK-NEXT: and negative zero ;; CHECK-EMPTY: ;; CHECK-NEXT: --zero-filled-memory,-uim Assume that an imported memory ;; CHECK-NEXT: will be zero-initialized diff --git a/test/lit/help/wasm2js.test b/test/lit/help/wasm2js.test index da53bd71492..97f04ac9a7e 100644 --- a/test/lit/help/wasm2js.test +++ b/test/lit/help/wasm2js.test @@ -643,8 +643,8 @@ ;; CHECK-NEXT: application ;; CHECK-EMPTY: ;; CHECK-NEXT: --fast-math,-ffm Optimize floats without handling -;; CHECK-NEXT: corner cases of NaNs and -;; CHECK-NEXT: rounding +;; CHECK-NEXT: corner cases of NaNs, rounding, +;; CHECK-NEXT: and negative zero ;; CHECK-EMPTY: ;; CHECK-NEXT: --zero-filled-memory,-uim Assume that an imported memory ;; CHECK-NEXT: will be zero-initialized From 8cc2d55fe999c5ec2cb6b6961fd8602f327ee60d Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Fri, 28 Aug 2026 12:35:17 -0700 Subject: [PATCH 2/2] PR --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index adb5e6dd10a..5637bb014d7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,7 +21,7 @@ Current Trunk doing out-of-tree builds of binaryen) with `BINARYEN_BIN` (#9023) - Reject non-natural alignment for atomic memory operations at parse time (#8962) - Note that fast-math mode can ignore the difference between negative zero and - zero (like clang and gcc). + zero (like clang and gcc). (#9056) v132 ----