Commit 629ee772 authored by Junliang Yan's avatar Junliang Yan Committed by V8 LUCI CQ

ppc: [liftoff] implement LoadConstant

Change-Id: Ia3c703dc47744cffc3f86ec46abb341e6c37590c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2857637Reviewed-by: 's avatarMilad Fa <mfarazma@redhat.com>
Commit-Queue: Junliang Yan <junyan@redhat.com>
Cr-Commit-Position: refs/heads/master@{#74283}
parent 14bc096e
......@@ -128,7 +128,30 @@ bool LiftoffAssembler::NeedsAlignment(ValueKind kind) {
void LiftoffAssembler::LoadConstant(LiftoffRegister reg, WasmValue value,
RelocInfo::Mode rmode) {
bailout(kUnsupportedArchitecture, "LoadConstant");
switch (value.type().kind()) {
case kI32:
mov(reg.gp(), Operand(value.to_i32(), rmode));
break;
case kI64:
mov(reg.gp(), Operand(value.to_i64(), rmode));
break;
case kF32: {
UseScratchRegisterScope temps(this);
Register scratch = temps.Acquire();
mov(scratch, Operand(value.to_f32_boxed().get_scalar()));
MovIntToFloat(reg.fp(), scratch);
break;
}
case kF64: {
UseScratchRegisterScope temps(this);
Register scratch = temps.Acquire();
mov(scratch, Operand(value.to_f32_boxed().get_scalar()));
MovInt64ToDouble(reg.fp(), scratch);
break;
}
default:
UNREACHABLE();
}
}
void LiftoffAssembler::LoadInstanceFromFrame(Register dst) {
......
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