Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 899d00c4aa72e7c1f6784b77b35ef39ee2541b1f
https://github.com/WebKit/WebKit/commit/899d00c4aa72e7c1f6784b77b35ef39ee2541b1f
Author: Yusuke Suzuki <[email protected]>
Date: 2026-03-09 (Mon, 09 Mar 2026)
Changed paths:
A JSTests/microbenchmarks/double-mod-positive-integers.js
A JSTests/stress/double-mod-fast-path.js
M Source/JavaScriptCore/b3/B3LowerMacros.cpp
M Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp
Log Message:
-----------
[JSC] Optimize Double Mod in DFG / FTL
https://bugs.webkit.org/show_bug.cgi?id=309487
rdar://172067665
Reviewed by Justin Michaud.
This patch adds V8's optimization[1] with a bit preferring Int32.
We use DoubleToInt32 / Int32ToDouble to detect integer since we can use
roundTowardZeroInt32Double in ARM64 if possible.
We check that the both inputs are positive integers, and then we compute
the result with div + mul + sub instead of calling fmod function.
ToT Patched
double-mod-positive-integers 90.2875+-0.2361 ^
31.7667+-0.5875 ^ definitely 2.8422x faster
[1]: https://chromium-review.googlesource.com/c/v8/v8/+/7594997
Test: JSTests/stress/double-mod-fast-path.js
* JSTests/microbenchmarks/double-mod-positive-integers.js: Added.
(doMod):
* JSTests/stress/double-mod-fast-path.js: Added.
(doMod):
(testLargeValues):
* Source/JavaScriptCore/b3/B3LowerMacros.cpp:
* Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp:
Canonical link: https://commits.webkit.org/308940@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications