Reland "[cleanup] Add operator parameter accessor for S8x16Shuffle"

This is a reland of 7e7c1b10d5

Original change's description:
> [cleanup] Add operator parameter accessor for S8x16Shuffle
>
> Bug: v8:7517, v8:9183
> Change-Id: Ic9beade6893b81aaa77f9c634cbeb7444260907b
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/973375
> Auto-Submit: Sigurd Schneider <sigurds@chromium.org>
> Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
> Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#62177}

TBR=tebbi@chromium.org

Bug: v8:7517, v8:9183
Change-Id: Ia72d73416b2d6b8e7e2fba97cfce39e4ab387a08
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1660610
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62186}
This commit is contained in:
Sigurd Schneider 2019-06-14 15:51:19 +02:00 committed by Commit Bot
parent b9342b7b5f
commit 9bb5bd2abf
4 changed files with 10 additions and 2 deletions

View File

@ -2965,7 +2965,7 @@ void InstructionSelector::CanonicalizeShuffle(bool inputs_equal,
void InstructionSelector::CanonicalizeShuffle(Node* node, uint8_t* shuffle, void InstructionSelector::CanonicalizeShuffle(Node* node, uint8_t* shuffle,
bool* is_swizzle) { bool* is_swizzle) {
// Get raw shuffle indices. // Get raw shuffle indices.
memcpy(shuffle, OpParameter<uint8_t*>(node->op()), kSimd128Size); memcpy(shuffle, S8x16ShuffleOf(node->op()), kSimd128Size);
bool needs_swap; bool needs_swap;
bool inputs_equal = GetVirtualRegister(node->InputAt(0)) == bool inputs_equal = GetVirtualRegister(node->InputAt(0)) ==
GetVirtualRegister(node->InputAt(1)); GetVirtualRegister(node->InputAt(1));

View File

@ -1301,6 +1301,11 @@ const Operator* MachineOperatorBuilder::S8x16Shuffle(
2, 0, 0, 1, 0, 0, array); 2, 0, 0, 1, 0, 0, array);
} }
const uint8_t* S8x16ShuffleOf(Operator const* op) {
DCHECK_EQ(IrOpcode::kS8x16Shuffle, op->opcode());
return OpParameter<uint8_t*>(op);
}
#undef PURE_BINARY_OP_LIST_32 #undef PURE_BINARY_OP_LIST_32
#undef PURE_BINARY_OP_LIST_64 #undef PURE_BINARY_OP_LIST_64
#undef MACHINE_PURE_OP_LIST #undef MACHINE_PURE_OP_LIST

View File

@ -112,6 +112,9 @@ MachineRepresentation AtomicStoreRepresentationOf(Operator const* op)
MachineType AtomicOpType(Operator const* op) V8_WARN_UNUSED_RESULT; MachineType AtomicOpType(Operator const* op) V8_WARN_UNUSED_RESULT;
V8_EXPORT_PRIVATE const uint8_t* S8x16ShuffleOf(Operator const* op)
V8_WARN_UNUSED_RESULT;
// Interface for building machine-level operators. These operators are // Interface for building machine-level operators. These operators are
// machine-level but machine-independent and thus define a language suitable // machine-level but machine-independent and thus define a language suitable
// for generating code to run on architectures such as ia32, x64, arm, etc. // for generating code to run on architectures such as ia32, x64, arm, etc.

View File

@ -1347,7 +1347,7 @@ void SimdScalarLowering::LowerNode(Node* node) {
} }
case IrOpcode::kS8x16Shuffle: { case IrOpcode::kS8x16Shuffle: {
DCHECK_EQ(2, node->InputCount()); DCHECK_EQ(2, node->InputCount());
const uint8_t* shuffle = OpParameter<uint8_t*>(node->op()); const uint8_t* shuffle = S8x16ShuffleOf(node->op());
Node** rep_left = GetReplacementsWithType(node->InputAt(0), rep_type); Node** rep_left = GetReplacementsWithType(node->InputAt(0), rep_type);
Node** rep_right = GetReplacementsWithType(node->InputAt(1), rep_type); Node** rep_right = GetReplacementsWithType(node->InputAt(1), rep_type);
Node** rep_node = zone()->NewArray<Node*>(16); Node** rep_node = zone()->NewArray<Node*>(16);