Commit 28b93bed authored by Milad Fa's avatar Milad Fa Committed by V8 LUCI CQ

S390: check offset of `lay` during codegen

The immediate offset passed to `lay` might be bigger than the
allowed 20 bits, in which case we need to add it to the base
register manually.

Issue came up after this CL https://crrev.com/c/2904926 when
a related test case started failing as the offset was changed.

Change-Id: I9997bf0ed4e42e32ac52bbd2771bbcb13a328e64
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2983164Reviewed-by: 's avatarJunliang Yan <junyan@redhat.com>
Commit-Queue: Milad Fa <mfarazma@redhat.com>
Cr-Commit-Position: refs/heads/master@{#75341}
parent 224b659c
......@@ -2308,9 +2308,18 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
__ vst(i.InputSimd128Register(index), operand, Condition(0));
break;
}
case kS390_Lay:
__ lay(i.OutputRegister(), i.MemoryOperand());
case kS390_Lay: {
MemOperand mem = i.MemoryOperand();
if (!is_int20(mem.offset())) {
// Add directly to the base register in case the index register (rx) is
// r0.
DCHECK(is_int32(mem.offset()));
__ AddS64(ip, mem.rb(), Operand(mem.offset()));
mem = MemOperand(mem.rx(), ip);
}
__ lay(i.OutputRegister(), mem);
break;
}
case kS390_Word64AtomicExchangeUint8:
case kWord32AtomicExchangeInt8:
case kWord32AtomicExchangeUint8: {
......
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