Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: b5819712d9f5b5ef54b649b04d5ad1aebb4aed01
https://github.com/WebKit/WebKit/commit/b5819712d9f5b5ef54b649b04d5ad1aebb4aed01
Author: Mikhail R. Gadelha <[email protected]>
Date: 2025-11-24 (Mon, 24 Nov 2025)
Changed paths:
M Source/JavaScriptCore/assembler/MacroAssemblerARM64.h
M Source/JavaScriptCore/assembler/MacroAssemblerARMv7.h
M Source/JavaScriptCore/wasm/WasmBBQJIT.cpp
M Source/JavaScriptCore/wasm/WasmBBQJIT.h
M Source/JavaScriptCore/wasm/WasmBBQJIT32_64.cpp
M Source/JavaScriptCore/wasm/WasmBBQJIT64.cpp
Log Message:
-----------
[JSC] Improve BBQ's rotate and shift implementations
https://bugs.webkit.org/show_bug.cgi?id=302406
Reviewed by Yusuke Suzuki.
This PR is mostly focused on improving the rotate and shift implementations for
ARMv7, but also includes small thcanges to 64-bit arm which I'll describe
below.
For 32-bit:
- Implemented rotateLeft64, rotateRight64, lshift64, urshift64, rshift64:
similar to some fp functions (e.g., truncateDoubleToUint64) we need to pass 2
scratches to implement the algorithms. One benefit of moving the shift
operations to the backend is that we have an extra scratch (r12), so things
are
slightly easier to implement.
- Removed lshiftUnchecked(), rshiftUnchecked(), urshiftUnchecked() since we can
access the instructions directly.
- Implemented several optimizations for shift and rotate: we see a .5%
reduction in code size in JetStream3's tfjs-wasm.js.
- The rotate algorithm should now be safe to run when registers overlap, which
was causing a crash in JetStream3's tfjs-wasm.js.
For 64-bit arm:
- Implemented rotateLeft32 and rotateLeft64: this allows us to unify both
x86_64 and ARM64 code paths.
* Source/JavaScriptCore/assembler/MacroAssemblerARM64.h:
(JSC::MacroAssemblerARM64::rotateLeft32):
(JSC::MacroAssemblerARM64::rotateLeft64):
* Source/JavaScriptCore/assembler/MacroAssemblerARMv7.h:
(JSC::MacroAssemblerARMv7::rotateLeft64):
(JSC::MacroAssemblerARMv7::rotateRight64):
(JSC::MacroAssemblerARMv7::lshift64):
(JSC::MacroAssemblerARMv7::urshift64):
(JSC::MacroAssemblerARMv7::rshift64):
(JSC::MacroAssemblerARMv7::lshiftUnchecked): Deleted.
(JSC::MacroAssemblerARMv7::rshiftUnchecked): Deleted.
(JSC::MacroAssemblerARMv7::urshiftUnchecked): Deleted.
* Source/JavaScriptCore/wasm/WasmBBQJIT.cpp:
(JSC::Wasm::BBQJITImpl::BBQJIT::addI32Rotl):
* Source/JavaScriptCore/wasm/WasmBBQJIT.h:
* Source/JavaScriptCore/wasm/WasmBBQJIT32_64.cpp:
(JSC::Wasm::BBQJITImpl::BBQJIT::addI64Shl):
(JSC::Wasm::BBQJITImpl::BBQJIT::addI64ShrS):
(JSC::Wasm::BBQJITImpl::BBQJIT::addI64ShrU):
(JSC::Wasm::BBQJITImpl::BBQJIT::addI64Rotl):
(JSC::Wasm::BBQJITImpl::BBQJIT::addI64Rotr):
(JSC::Wasm::BBQJITImpl::BBQJIT::rotI64Helper): Deleted.
* Source/JavaScriptCore/wasm/WasmBBQJIT64.cpp:
(JSC::Wasm::BBQJITImpl::BBQJIT::addI64Rotl):
Canonical link: https://commits.webkit.org/303502@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications