From 9bb5bd2abf170ce5cc2c7e195aceae650e517359 Mon Sep 17 00:00:00 2001 From: Sigurd Schneider Date: Fri, 14 Jun 2019 15:51:19 +0200 Subject: [PATCH] Reland "[cleanup] Add operator parameter accessor for S8x16Shuffle" This is a reland of 7e7c1b10d5fd69f9e7aeee033bc53a3b30a4f543 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 > Reviewed-by: Tobias Tebbi > Commit-Queue: Tobias Tebbi > 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 Reviewed-by: Sigurd Schneider Cr-Commit-Position: refs/heads/master@{#62186} --- src/compiler/backend/instruction-selector.cc | 2 +- src/compiler/machine-operator.cc | 5 +++++ src/compiler/machine-operator.h | 3 +++ src/compiler/simd-scalar-lowering.cc | 2 +- 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/compiler/backend/instruction-selector.cc b/src/compiler/backend/instruction-selector.cc index ce1fdf5d9c..d7fa926854 100644 --- a/src/compiler/backend/instruction-selector.cc +++ b/src/compiler/backend/instruction-selector.cc @@ -2965,7 +2965,7 @@ void InstructionSelector::CanonicalizeShuffle(bool inputs_equal, void InstructionSelector::CanonicalizeShuffle(Node* node, uint8_t* shuffle, bool* is_swizzle) { // Get raw shuffle indices. - memcpy(shuffle, OpParameter(node->op()), kSimd128Size); + memcpy(shuffle, S8x16ShuffleOf(node->op()), kSimd128Size); bool needs_swap; bool inputs_equal = GetVirtualRegister(node->InputAt(0)) == GetVirtualRegister(node->InputAt(1)); diff --git a/src/compiler/machine-operator.cc b/src/compiler/machine-operator.cc index a1c95845a7..2fc8c9a542 100644 --- a/src/compiler/machine-operator.cc +++ b/src/compiler/machine-operator.cc @@ -1301,6 +1301,11 @@ const Operator* MachineOperatorBuilder::S8x16Shuffle( 2, 0, 0, 1, 0, 0, array); } +const uint8_t* S8x16ShuffleOf(Operator const* op) { + DCHECK_EQ(IrOpcode::kS8x16Shuffle, op->opcode()); + return OpParameter(op); +} + #undef PURE_BINARY_OP_LIST_32 #undef PURE_BINARY_OP_LIST_64 #undef MACHINE_PURE_OP_LIST diff --git a/src/compiler/machine-operator.h b/src/compiler/machine-operator.h index 95169e7b6d..ceab67decd 100644 --- a/src/compiler/machine-operator.h +++ b/src/compiler/machine-operator.h @@ -112,6 +112,9 @@ MachineRepresentation AtomicStoreRepresentationOf(Operator const* op) 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 // machine-level but machine-independent and thus define a language suitable // for generating code to run on architectures such as ia32, x64, arm, etc. diff --git a/src/compiler/simd-scalar-lowering.cc b/src/compiler/simd-scalar-lowering.cc index cab398c160..af5c6de784 100644 --- a/src/compiler/simd-scalar-lowering.cc +++ b/src/compiler/simd-scalar-lowering.cc @@ -1347,7 +1347,7 @@ void SimdScalarLowering::LowerNode(Node* node) { } case IrOpcode::kS8x16Shuffle: { DCHECK_EQ(2, node->InputCount()); - const uint8_t* shuffle = OpParameter(node->op()); + const uint8_t* shuffle = S8x16ShuffleOf(node->op()); Node** rep_left = GetReplacementsWithType(node->InputAt(0), rep_type); Node** rep_right = GetReplacementsWithType(node->InputAt(1), rep_type); Node** rep_node = zone()->NewArray(16);