Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: bcd47e7f3fe74e08bd65657cdf5200ddd077e46f
https://github.com/WebKit/WebKit/commit/bcd47e7f3fe74e08bd65657cdf5200ddd077e46f
Author: Keith Miller <[email protected]>
Date: 2026-04-16 (Thu, 16 Apr 2026)
Changed paths:
A JSTests/wasm/stress/wide-arithmetic.js
M Source/JavaScriptCore/assembler/MacroAssemblerARM64.h
M Source/JavaScriptCore/assembler/MacroAssemblerX86_64.h
M Source/JavaScriptCore/assembler/X86Assembler.h
M Source/JavaScriptCore/llint/InPlaceInterpreter64.asm
M Source/JavaScriptCore/offlineasm/arm64.rb
M Source/JavaScriptCore/offlineasm/instructions.rb
M Source/JavaScriptCore/offlineasm/x86.rb
M Source/JavaScriptCore/runtime/OptionsList.h
M Source/JavaScriptCore/wasm/WasmBBQJIT.cpp
M Source/JavaScriptCore/wasm/WasmBBQJIT.h
M Source/JavaScriptCore/wasm/WasmBBQJIT64.cpp
M Source/JavaScriptCore/wasm/WasmConstExprGenerator.cpp
M Source/JavaScriptCore/wasm/WasmFunctionParser.h
M Source/JavaScriptCore/wasm/WasmIPIntGenerator.cpp
M Source/JavaScriptCore/wasm/WasmOMGIRGenerator.cpp
M Source/JavaScriptCore/wasm/generateWasmOpsHeader.py
M Source/JavaScriptCore/wasm/wasm.json
Log Message:
-----------
Add wasm wide arithmetic proposal
https://bugs.webkit.org/show_bug.cgi?id=312213
rdar://174700268
Reviewed by Yusuke Suzuki.
Implement the WebAssembly wide-arithmetic proposal which adds four new
instructions behind the --useWasmWideArithmetic flag: i64.add128,
i64.sub128, i64.mul_wide_s, and i64.mul_wide_u. These operate on pairs
of i64 values to produce 128-bit results, encoded in the 0xFC prefix
space (extendedOps 19-22).
All three tiers are supported: IPInt uses new offlineasm instructions
(addqs/subqs/adcq/sbcq/smulhq/umulhq) to implement the operations
directly, BBQ uses platform-specific register-register sequences with
aliasing guards, and OMG lowers to patchpoints with appropriate register
constraints.
On x86_64, add128/sub128 use add+adc / sub+sbb pairs. mul_wide uses
single-operand mul/imul with rdx:rax output, with eax/edx clobbered
between consume and allocate to avoid conflicts with the BBQ register
allocator. On ARM64, add128/sub128 use adds+adc / subs+sbc, and
mul_wide uses umulh/smulh+mul pairs.
Also add an offset parameter to BBQJIT::topValue() so multi-result
operations can name their stack slots without manually computing the
base index. Use this in the wide arithmetic ops and in
returnValuesFromCall.
Test: JSTests/wasm/stress/wide-arithmetic.js
Canonical link: https://commits.webkit.org/311366@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications