Commit 500defa5 authored by Milad Fa's avatar Milad Fa Committed by V8 LUCI CQ

PPC [liftoff]: Avoid overwriting offset register during fp load

Change-Id: I2abc916894b84aad5794e4a69979ca8683644806
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3289933
Commit-Queue: Milad Fa <mfarazma@redhat.com>
Reviewed-by: 's avatarJunliang Yan <junyan@redhat.com>
Cr-Commit-Position: refs/heads/main@{#77990}
parent 31e20c03
......@@ -410,14 +410,32 @@ void LiftoffAssembler::Load(LiftoffRegister dst, Register src_addr,
break;
case LoadType::kF32Load:
if (is_load_mem) {
LoadF32LE(dst.fp(), src_op, r0, ip);
// `ip` could be used as offset_reg.
Register scratch = ip;
if (offset_reg == ip) {
scratch = GetRegisterThatIsNotOneOf(src_addr);
push(scratch);
}
LoadF32LE(dst.fp(), src_op, r0, scratch);
if (offset_reg == ip) {
pop(scratch);
}
} else {
LoadF32(dst.fp(), src_op, r0);
}
break;
case LoadType::kF64Load:
if (is_load_mem) {
// `ip` could be used as offset_reg.
Register scratch = ip;
if (offset_reg == ip) {
scratch = GetRegisterThatIsNotOneOf(src_addr);
push(scratch);
}
LoadF64LE(dst.fp(), src_op, r0, ip);
if (offset_reg == ip) {
pop(scratch);
}
} else {
LoadF64(dst.fp(), src_op, r0);
}
......
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