Commit 575babc4 authored by Clemens Backes's avatar Clemens Backes Committed by V8 LUCI CQ

[codegen][x64] Emit shorter code for a 32-bit and

If the immediate is a 32-bit value, we can just write the lower half of
the target register, the upper half will automatically be zero-extended.

R=tebbi@chromium.org

Bug: v8:10005
Change-Id: Ib3c54c9f6ac2434c7345c507529298233d6b7d6f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3563565Reviewed-by: 's avatarTobias Tebbi <tebbi@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79758}
parent b57bb622
......@@ -67,7 +67,11 @@ void SharedTurboAssembler::And(Register dst, Immediate src) {
#if V8_TARGET_ARCH_IA32
and_(dst, src);
#elif V8_TARGET_ARCH_X64
if (is_uint32(src.value())) {
andl(dst, src);
} else {
andq(dst, src);
}
#else
#error Unsupported target architecture.
#endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment