Commit e0d1acfe authored by Joey Gouly's avatar Joey Gouly Committed by Commit Bot

[Liftoff][arm64] Use wzr/xzr for spilling zero constants

This removes a redundant "mov <reg>, #0" by spilling the zero register
directly.

Change-Id: I608f5200ee25e176f6d3279aec07c581d9f7d769
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1517872Reviewed-by: 's avatarClemens Hammacher <clemensh@chromium.org>
Commit-Queue: Martyn Capewell <martyn.capewell@arm.com>
Cr-Commit-Position: refs/heads/master@{#60192}
parent 0793bb84
......@@ -345,12 +345,20 @@ void LiftoffAssembler::Spill(uint32_t index, WasmValue value) {
CPURegister src = CPURegister::no_reg();
switch (value.type()) {
case kWasmI32:
src = temps.AcquireW();
Mov(src.W(), value.to_i32());
if (value.to_i32() == 0) {
src = wzr;
} else {
src = temps.AcquireW();
Mov(src.W(), value.to_i32());
}
break;
case kWasmI64:
src = temps.AcquireX();
Mov(src.X(), value.to_i64());
if (value.to_i64() == 0) {
src = xzr;
} else {
src = temps.AcquireX();
Mov(src.X(), value.to_i64());
}
break;
default:
// We do not track f32 and f64 constants, hence they are unreachable.
......
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