From c8ec56598a5c5c9bd52765a7d126ebb46148d24a Mon Sep 17 00:00:00 2001 From: Junliang Yan Date: Thu, 24 Jun 2021 13:11:56 -0400 Subject: [PATCH] ppc: [liftoff] implement LoadCallerFrameSlot Change-Id: Iffe01cd3b49aa8b590b4930b3ea94fb52419b83c Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2985502 Auto-Submit: Junliang Yan Reviewed-by: Milad Fa Commit-Queue: Junliang Yan Cr-Commit-Position: refs/heads/master@{#75389} --- src/wasm/baseline/ppc/liftoff-assembler-ppc.h | 35 ++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/src/wasm/baseline/ppc/liftoff-assembler-ppc.h b/src/wasm/baseline/ppc/liftoff-assembler-ppc.h index 6acb4829b0..ab48457e91 100644 --- a/src/wasm/baseline/ppc/liftoff-assembler-ppc.h +++ b/src/wasm/baseline/ppc/liftoff-assembler-ppc.h @@ -446,7 +446,40 @@ void LiftoffAssembler::AtomicFence() { sync(); } void LiftoffAssembler::LoadCallerFrameSlot(LiftoffRegister dst, uint32_t caller_slot_idx, ValueKind kind) { - bailout(kUnsupportedArchitecture, "LoadCallerFrameSlot"); + int32_t offset = (caller_slot_idx + 1) * kSystemPointerSize; + switch (kind) { + case kI32: { +#if defined(V8_TARGET_BIG_ENDIAN) + LoadS32(dst.gp(), MemOperand(fp, offset + 4), r0); + break; +#else + LoadS32(dst.gp(), MemOperand(fp, offset), r0); + break; +#endif + } + case kRef: + case kRtt: + case kOptRef: + case kRttWithDepth: + case kI64: { + LoadU64(dst.gp(), MemOperand(fp, offset), r0); + break; + } + case kF32: { + LoadF32(dst.fp(), MemOperand(fp, offset), r0); + break; + } + case kF64: { + LoadF64(dst.fp(), MemOperand(fp, offset), r0); + break; + } + case kS128: { + bailout(kSimd, "simd load"); + break; + } + default: + UNREACHABLE(); + } } void LiftoffAssembler::StoreCallerFrameSlot(LiftoffRegister src,