[webkit-changes] [WebKit/WebKit] 3ee7e4: Emit logical right-shift for unsigned div in BBQ JIT
Commit Queue
noreply at github.com
Mon Feb 19 16:41:39 PST 2024
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 3ee7e4fc30fd0bbaef2065502b5d7998960d9fbf
https://github.com/WebKit/WebKit/commit/3ee7e4fc30fd0bbaef2065502b5d7998960d9fbf
Author: Marcus Plutowski <marcus_plutowski at apple.com>
Date: 2024-02-19 (Mon, 19 Feb 2024)
Changed paths:
A JSTests/wasm/stress/unsigned-integer-division.js
M Source/JavaScriptCore/wasm/WasmBBQJIT64.h
Log Message:
-----------
Emit logical right-shift for unsigned div in BBQ JIT
https://bugs.webkit.org/show_bug.cgi?id=269729
rdar://120840889
Reviewed by Justin Michaud.
Previously, the function BBQ::emitModOrDiv would unconditionally emit
an arithmetic right-shift in cases where the lhs was a power of two.
This produces the correct result when the sign bit is 0 (i.e. the lhs,
interpreted as a signed 64-bit integer, is positive) but an incorrect
one when the sign bit is 1: specifically, it would compute a signed
division instead.
By checking the sign of the division taking place and emitting a logical
shift when the operation is unsigned, we get the correct result.
* JSTests/wasm/stress/i64divu-sign-maintanance.js: Added.
(async test):
* Source/JavaScriptCore/wasm/WasmBBQJIT64.h:
(JSC::Wasm::BBQJITImpl::BBQJIT::emitModOrDiv):
Canonical link: https://commits.webkit.org/275011@main
To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications
More information about the webkit-changes
mailing list