Commit a7ccf248 authored by Junliang Yan's avatar Junliang Yan Committed by Commit Bot

s390x: [liftoff] implement constant loading

Change-Id: Iec2fdaf3f180e6e59e40a558bf85a41cd96826ee
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2626464Reviewed-by: 's avatarMilad Fa <mfarazma@redhat.com>
Commit-Queue: Junliang Yan <junyan@redhat.com>
Cr-Commit-Position: refs/heads/master@{#72071}
parent d232ab89
......@@ -150,7 +150,28 @@ bool LiftoffAssembler::NeedsAlignment(ValueType type) {
void LiftoffAssembler::LoadConstant(LiftoffRegister reg, WasmValue value,
RelocInfo::Mode rmode) {
bailout(kUnsupportedArchitecture, "LoadConstant");
switch (value.type().kind()) {
case ValueType::kI32:
mov(reg.gp(), Operand(value.to_i32(), rmode));
break;
case ValueType::kI64:
mov(reg.gp(), Operand(value.to_i64(), rmode));
break;
case ValueType::kF32: {
UseScratchRegisterScope temps(this);
Register scratch = temps.Acquire();
LoadF32(reg.fp(), value.to_f32_boxed().get_scalar(), scratch);
break;
}
case ValueType::kF64: {
UseScratchRegisterScope temps(this);
Register scratch = temps.Acquire();
LoadF64(reg.fp(), value.to_f64_boxed().get_bits(), scratch);
break;
}
default:
UNREACHABLE();
}
}
void LiftoffAssembler::LoadFromInstance(Register dst, int offset, int size) {
......
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