Commit 0df3de18 authored by Junliang Yan's avatar Junliang Yan Committed by Commit Bot

s390x: [liftoff] implement caller frame load/store

Change-Id: I6b0aa0daab07728f5a524ecba289276c7fa33a08
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2668568Reviewed-by: 's avatarMilad Fa <mfarazma@redhat.com>
Commit-Queue: Junliang Yan <junyan@redhat.com>
Cr-Commit-Position: refs/heads/master@{#72488}
parent b5dae1e4
......@@ -455,13 +455,81 @@ void LiftoffAssembler::AtomicFence() { bailout(kAtomics, "AtomicFence"); }
void LiftoffAssembler::LoadCallerFrameSlot(LiftoffRegister dst,
uint32_t caller_slot_idx,
ValueType type) {
bailout(kUnsupportedArchitecture, "LoadCallerFrameSlot");
int32_t offset = (caller_slot_idx + 1) * 8;
switch (type.kind()) {
case ValueType::kI32: {
#if defined(V8_TARGET_BIG_ENDIAN)
LoadS32(dst.gp(), MemOperand(fp, offset + 4));
break;
#else
LoadS32(dst.gp(), MemOperand(fp, offset));
break;
#endif
}
case ValueType::kRef:
case ValueType::kRtt:
case ValueType::kOptRef:
case ValueType::kI64: {
LoadU64(dst.gp(), MemOperand(fp, offset));
break;
}
case ValueType::kF32: {
LoadF32(dst.fp(), MemOperand(fp, offset));
break;
}
case ValueType::kF64: {
LoadF64(dst.fp(), MemOperand(fp, offset));
break;
}
case ValueType::kS128: {
UseScratchRegisterScope temps(this);
Register scratch = temps.Acquire();
LoadV128(dst.fp(), MemOperand(fp, offset), scratch);
break;
}
default:
UNREACHABLE();
}
}
void LiftoffAssembler::StoreCallerFrameSlot(LiftoffRegister src,
uint32_t caller_slot_idx,
ValueType type) {
bailout(kUnsupportedArchitecture, "StoreCallerFrameSlot");
int32_t offset = (caller_slot_idx + 1) * 8;
switch (type.kind()) {
case ValueType::kI32: {
#if defined(V8_TARGET_BIG_ENDIAN)
StoreU32(src.gp(), MemOperand(fp, offset + 4));
break;
#else
StoreU32(src.gp(), MemOperand(fp, offset));
break;
#endif
}
case ValueType::kRef:
case ValueType::kRtt:
case ValueType::kOptRef:
case ValueType::kI64: {
StoreU64(src.gp(), MemOperand(fp, offset));
break;
}
case ValueType::kF32: {
StoreF32(src.fp(), MemOperand(fp, offset));
break;
}
case ValueType::kF64: {
StoreF64(src.fp(), MemOperand(fp, offset));
break;
}
case ValueType::kS128: {
UseScratchRegisterScope temps(this);
Register scratch = temps.Acquire();
StoreV128(src.fp(), MemOperand(fp, offset), scratch);
break;
}
default:
UNREACHABLE();
}
}
void LiftoffAssembler::LoadReturnStackSlot(LiftoffRegister dst, int offset,
......
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