[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/+/1517872 Reviewed-by: Clemens Hammacher <clemensh@chromium.org> Commit-Queue: Martyn Capewell <martyn.capewell@arm.com> Cr-Commit-Position: refs/heads/master@{#60192}
This commit is contained in:
parent
0793bb8498
commit
e0d1acfe85
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user