Commit 798caa85 authored by Milad Fa's avatar Milad Fa Committed by V8 LUCI CQ

S390: optimize loading of reversed bytes

This adds a check similar to Word32ReverseBytes.

Change-Id: I3a75f29ae1b9cb75dd0fda471d6d42ca21915bf9
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3009795Reviewed-by: 's avatarJunliang Yan <junyan@redhat.com>
Commit-Queue: Milad Fa <mfarazma@redhat.com>
Cr-Commit-Position: refs/heads/master@{#75591}
parent ae95f46d
......@@ -1084,6 +1084,19 @@ void InstructionSelector::VisitInt64AbsWithOverflow(Node* node) {
void InstructionSelector::VisitWord64ReverseBytes(Node* node) {
S390OperandGenerator g(this);
NodeMatcher input(node->InputAt(0));
if (CanCover(node, input.node()) && input.IsLoad()) {
LoadRepresentation load_rep = LoadRepresentationOf(input.node()->op());
if (load_rep.representation() == MachineRepresentation::kWord64) {
Node* base = input.node()->InputAt(0);
Node* offset = input.node()->InputAt(1);
Emit(kS390_LoadReverse64 | AddressingModeField::encode(kMode_MRR),
// TODO(miladfarca): one of the base and offset can be imm.
g.DefineAsRegister(node), g.UseRegister(base),
g.UseRegister(offset));
return;
}
}
Emit(kS390_LoadReverse64RR, g.DefineAsRegister(node),
g.UseRegister(node->InputAt(0)));
}
......
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