Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 3ec66a7fd7e54ddc27c98b3c51995f5ec9a8749a
      
https://github.com/WebKit/WebKit/commit/3ec66a7fd7e54ddc27c98b3c51995f5ec9a8749a
  Author: Yusuke Suzuki <[email protected]>
  Date:   2025-11-19 (Wed, 19 Nov 2025)

  Changed paths:
    A JSTests/stress/arith-modulo-power-of-two-int32.js
    M Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp
    M Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp

  Log Message:
  -----------
  [JSC] A bit more optimizations for `n % power-of-two` in FTL
https://bugs.webkit.org/show_bug.cgi?id=302763
rdar://165021624

Reviewed by Keith Miller.

We should do a bit more optimizations for `n % power-of-two`.

1. Int32 / Int32-power-of-two (larger than 1) never generates
   non-Int32 value except for negative 0 `-1 % 1`
2. Use DFG's ArithMod optimization to FTL.

Test: JSTests/stress/arith-modulo-power-of-two-int32.js

* JSTests/stress/arith-modulo-power-of-two-int32.js: Added.
(testMod2):
(testMod4):
(testMod8):
(testMod16):
(testMod32):
(testMod64):
(testMod128):
(testMod256):
(testMod512):
(testMod1024):
(testMod2048):
(testMod4096):
(testMod65536):
(testMod1048576):
(chainedMod):
* Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp:
* Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileArithMod):

Canonical link: https://commits.webkit.org/303241@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to