Commit 1808ba97 authored by Milad Fa's avatar Milad Fa Committed by V8 LUCI CQ

PPC: Pass is_atomic when emitting `load reverse`

The boolean value is expected to be present during code
generation.

Change-Id: I3f9bd8f3977badd7fc7c0a716858d0d46032ae95
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2963834Reviewed-by: 's avatarJunliang Yan <junyan@redhat.com>
Commit-Queue: Milad Fa <mfarazma@redhat.com>
Cr-Commit-Position: refs/heads/master@{#75157}
parent 597a9c7b
...@@ -992,9 +992,11 @@ void InstructionSelector::VisitWord64ReverseBytes(Node* node) { ...@@ -992,9 +992,11 @@ void InstructionSelector::VisitWord64ReverseBytes(Node* node) {
if (load_rep.representation() == MachineRepresentation::kWord64) { if (load_rep.representation() == MachineRepresentation::kWord64) {
Node* base = input.node()->InputAt(0); Node* base = input.node()->InputAt(0);
Node* offset = input.node()->InputAt(1); Node* offset = input.node()->InputAt(1);
bool is_atomic = (node->opcode() == IrOpcode::kWord32AtomicLoad ||
node->opcode() == IrOpcode::kWord64AtomicLoad);
Emit(kPPC_LoadByteRev64 | AddressingModeField::encode(kMode_MRR), Emit(kPPC_LoadByteRev64 | AddressingModeField::encode(kMode_MRR),
g.DefineAsRegister(node), g.UseRegister(base), g.DefineAsRegister(node), g.UseRegister(base), g.UseRegister(offset),
g.UseRegister(offset)); g.UseImmediate(is_atomic));
return; return;
} }
} }
...@@ -1004,16 +1006,17 @@ void InstructionSelector::VisitWord64ReverseBytes(Node* node) { ...@@ -1004,16 +1006,17 @@ void InstructionSelector::VisitWord64ReverseBytes(Node* node) {
void InstructionSelector::VisitWord32ReverseBytes(Node* node) { void InstructionSelector::VisitWord32ReverseBytes(Node* node) {
PPCOperandGenerator g(this); PPCOperandGenerator g(this);
NodeMatcher input(node->InputAt(0)); NodeMatcher input(node->InputAt(0));
if (CanCover(node, input.node()) && input.IsLoad()) { if (CanCover(node, input.node()) && input.IsLoad()) {
LoadRepresentation load_rep = LoadRepresentationOf(input.node()->op()); LoadRepresentation load_rep = LoadRepresentationOf(input.node()->op());
if (load_rep.representation() == MachineRepresentation::kWord32) { if (load_rep.representation() == MachineRepresentation::kWord32) {
Node* base = input.node()->InputAt(0); Node* base = input.node()->InputAt(0);
Node* offset = input.node()->InputAt(1); Node* offset = input.node()->InputAt(1);
bool is_atomic = (node->opcode() == IrOpcode::kWord32AtomicLoad ||
node->opcode() == IrOpcode::kWord64AtomicLoad);
Emit(kPPC_LoadByteRev32 | AddressingModeField::encode(kMode_MRR), Emit(kPPC_LoadByteRev32 | AddressingModeField::encode(kMode_MRR),
g.DefineAsRegister(node), g.UseRegister(base), g.DefineAsRegister(node), g.UseRegister(base), g.UseRegister(offset),
g.UseRegister(offset)); g.UseImmediate(is_atomic));
return; return;
} }
} }
......
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