Commit c6efd714 authored by Vincent Belliard's avatar Vincent Belliard Committed by Commit Bot

[arm64][Liftoff] implement LoadConstant, LoadFromInstance and FillInstanceInto

Bug: v8:6600

Change-Id: Iec1804b89ed853833596a498bb1dfc15bb16c4ce
Reviewed-on: https://chromium-review.googlesource.com/1028763
Commit-Queue: Vincent Belliard <vincent.belliard@arm.com>
Reviewed-by: 's avatarClemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52861}
parent 28e015db
...@@ -141,12 +141,34 @@ void LiftoffAssembler::FinishCode() { CheckConstPool(true, false); } ...@@ -141,12 +141,34 @@ void LiftoffAssembler::FinishCode() { CheckConstPool(true, false); }
void LiftoffAssembler::LoadConstant(LiftoffRegister reg, WasmValue value, void LiftoffAssembler::LoadConstant(LiftoffRegister reg, WasmValue value,
RelocInfo::Mode rmode) { RelocInfo::Mode rmode) {
BAILOUT("LoadConstant"); switch (value.type()) {
case kWasmI32:
Mov(reg.gp().W(), Immediate(value.to_i32(), rmode));
break;
case kWasmI64:
Mov(reg.gp().X(), Immediate(value.to_i64(), rmode));
break;
case kWasmF32:
Fmov(reg.fp().S(), value.to_f32_boxed().get_scalar());
break;
case kWasmF64:
Fmov(reg.fp().D(), value.to_f64_boxed().get_scalar());
break;
default:
UNREACHABLE();
}
} }
void LiftoffAssembler::LoadFromInstance(Register dst, uint32_t offset, void LiftoffAssembler::LoadFromInstance(Register dst, uint32_t offset,
int size) { int size) {
BAILOUT("LoadFromInstance"); DCHECK_LE(offset, kMaxInt);
Ldr(dst, liftoff::GetInstanceOperand());
DCHECK(size == 4 || size == 8);
if (size == 4) {
Ldr(dst.W(), MemOperand(dst, offset));
} else {
Ldr(dst, MemOperand(dst, offset));
}
} }
void LiftoffAssembler::SpillInstance(Register instance) { void LiftoffAssembler::SpillInstance(Register instance) {
...@@ -154,7 +176,7 @@ void LiftoffAssembler::SpillInstance(Register instance) { ...@@ -154,7 +176,7 @@ void LiftoffAssembler::SpillInstance(Register instance) {
} }
void LiftoffAssembler::FillInstanceInto(Register dst) { void LiftoffAssembler::FillInstanceInto(Register dst) {
BAILOUT("FillInstanceInto"); Ldr(dst, liftoff::GetInstanceOperand());
} }
void LiftoffAssembler::Load(LiftoffRegister dst, Register src_addr, void LiftoffAssembler::Load(LiftoffRegister dst, Register src_addr,
......
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