summaryrefslogtreecommitdiff
path: root/deps/v8/src/compiler/simd-scalar-lowering.cc
diff options
context:
space:
mode:
authorMatheus Marchini <mmarchini@netflix.com>2020-03-05 10:49:19 -0800
committerMatheus Marchini <mmarchini@netflix.com>2020-03-18 16:23:22 -0700
commit2883c855e0105b51e5c8020d21458af109ffe3d4 (patch)
tree26777aad0a398e9f7755c8b65ac76827fe352a81 /deps/v8/src/compiler/simd-scalar-lowering.cc
parent5f0af2af2a67216e00fe07ccda11e889d14abfcd (diff)
downloadnode-new-2883c855e0105b51e5c8020d21458af109ffe3d4.tar.gz
deps: update V8 to 8.1.307.20
PR-URL: https://github.com/nodejs/node/pull/32116 Reviewed-By: Michaƫl Zasso <targos@protonmail.com> Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Diffstat (limited to 'deps/v8/src/compiler/simd-scalar-lowering.cc')
-rw-r--r--deps/v8/src/compiler/simd-scalar-lowering.cc46
1 files changed, 30 insertions, 16 deletions
diff --git a/deps/v8/src/compiler/simd-scalar-lowering.cc b/deps/v8/src/compiler/simd-scalar-lowering.cc
index 2781cc248f..9d13bbfa98 100644
--- a/deps/v8/src/compiler/simd-scalar-lowering.cc
+++ b/deps/v8/src/compiler/simd-scalar-lowering.cc
@@ -153,7 +153,8 @@ void SimdScalarLowering::LowerGraph() {
#define FOREACH_INT16X8_OPCODE(V) \
V(I16x8Splat) \
- V(I16x8ExtractLane) \
+ V(I16x8ExtractLaneU) \
+ V(I16x8ExtractLaneS) \
V(I16x8ReplaceLane) \
V(I16x8SConvertI8x16Low) \
V(I16x8SConvertI8x16High) \
@@ -186,7 +187,8 @@ void SimdScalarLowering::LowerGraph() {
#define FOREACH_INT8X16_OPCODE(V) \
V(I8x16Splat) \
- V(I8x16ExtractLane) \
+ V(I8x16ExtractLaneU) \
+ V(I8x16ExtractLaneS) \
V(I8x16ReplaceLane) \
V(I8x16SConvertI16x8) \
V(I8x16Neg) \
@@ -779,11 +781,9 @@ void SimdScalarLowering::LowerPack(Node* node, SimdType input_rep_type,
DCHECK_EQ(2, node->InputCount());
Node** rep_left = GetReplacementsWithType(node->InputAt(0), input_rep_type);
Node** rep_right = GetReplacementsWithType(node->InputAt(1), input_rep_type);
- const Operator* less_op =
- is_signed ? machine()->Int32LessThan() : machine()->Uint32LessThan();
+ const Operator* less_op = machine()->Int32LessThan();
Node* min = nullptr;
Node* max = nullptr;
- int32_t shift_val = 0;
MachineRepresentation phi_rep;
if (output_rep_type == SimdType::kInt16x8) {
DCHECK(input_rep_type == SimdType::kInt32x4);
@@ -791,8 +791,8 @@ void SimdScalarLowering::LowerPack(Node* node, SimdType input_rep_type,
min = mcgraph_->Int32Constant(std::numeric_limits<int16_t>::min());
max = mcgraph_->Int32Constant(std::numeric_limits<int16_t>::max());
} else {
+ min = mcgraph_->Int32Constant(std::numeric_limits<uint16_t>::min());
max = mcgraph_->Uint32Constant(std::numeric_limits<uint16_t>::max());
- shift_val = kShift16;
}
phi_rep = MachineRepresentation::kWord16;
} else {
@@ -802,8 +802,8 @@ void SimdScalarLowering::LowerPack(Node* node, SimdType input_rep_type,
min = mcgraph_->Int32Constant(std::numeric_limits<int8_t>::min());
max = mcgraph_->Int32Constant(std::numeric_limits<int8_t>::max());
} else {
+ min = mcgraph_->Int32Constant(std::numeric_limits<uint8_t>::min());
max = mcgraph_->Uint32Constant(std::numeric_limits<uint8_t>::max());
- shift_val = kShift8;
}
phi_rep = MachineRepresentation::kWord8;
}
@@ -815,14 +815,10 @@ void SimdScalarLowering::LowerPack(Node* node, SimdType input_rep_type,
input = rep_left[i];
else
input = rep_right[i - num_lanes / 2];
- if (is_signed) {
- Diamond d_min(graph(), common(), graph()->NewNode(less_op, input, min));
- input = d_min.Phi(phi_rep, min, input);
- }
+ Diamond d_min(graph(), common(), graph()->NewNode(less_op, input, min));
+ input = d_min.Phi(phi_rep, min, input);
Diamond d_max(graph(), common(), graph()->NewNode(less_op, max, input));
rep_node[i] = d_max.Phi(phi_rep, max, input);
- rep_node[i] =
- is_signed ? rep_node[i] : FixUpperBits(rep_node[i], shift_val);
}
ReplaceNode(node, rep_node, num_lanes);
}
@@ -1144,6 +1140,22 @@ void SimdScalarLowering::LowerNode(Node* node) {
ReplaceNode(node, rep_node, kNumLanes32);
break;
}
+ case IrOpcode::kS128AndNot: {
+ DCHECK_EQ(2, node->InputCount());
+ Node** rep_left = GetReplacementsWithType(node->InputAt(0), rep_type);
+ Node** rep_right = GetReplacementsWithType(node->InputAt(1), rep_type);
+ int num_lanes = NumLanes(rep_type);
+ Node** rep_node = zone()->NewArray<Node*>(num_lanes);
+ Node* mask = graph()->NewNode(common()->Int32Constant(0xFFFFFFFF));
+ for (int i = 0; i < num_lanes; ++i) {
+ Node* not_rep_right =
+ graph()->NewNode(machine()->Word32Xor(), rep_right[i], mask);
+ rep_node[i] = graph()->NewNode(machine()->Word32And(), rep_left[i],
+ not_rep_right);
+ }
+ ReplaceNode(node, rep_node, num_lanes);
+ break;
+ }
case IrOpcode::kI32x4SConvertF32x4: {
LowerConvertFromFloat(node, true);
break;
@@ -1288,8 +1300,10 @@ void SimdScalarLowering::LowerNode(Node* node) {
}
case IrOpcode::kI32x4ExtractLane:
case IrOpcode::kF32x4ExtractLane:
- case IrOpcode::kI16x8ExtractLane:
- case IrOpcode::kI8x16ExtractLane: {
+ case IrOpcode::kI16x8ExtractLaneU:
+ case IrOpcode::kI16x8ExtractLaneS:
+ case IrOpcode::kI8x16ExtractLaneU:
+ case IrOpcode::kI8x16ExtractLaneS: {
int32_t lane = OpParameter<int32_t>(node->op());
Node** rep_node = zone()->NewArray<Node*>(num_lanes);
rep_node[0] = GetReplacementsWithType(node->InputAt(0), rep_type)[lane];
@@ -1434,7 +1448,7 @@ void SimdScalarLowering::LowerNode(Node* node) {
}
case IrOpcode::kS8x16Shuffle: {
DCHECK_EQ(2, node->InputCount());
- const uint8_t* shuffle = S8x16ShuffleOf(node->op());
+ S8x16ShuffleParameter shuffle = S8x16ShuffleParameterOf(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<Node*>(16);