summaryrefslogtreecommitdiff
path: root/deps/v8/src/compiler/s390/instruction-selector-s390.cc
diff options
context:
space:
mode:
Diffstat (limited to 'deps/v8/src/compiler/s390/instruction-selector-s390.cc')
-rw-r--r--deps/v8/src/compiler/s390/instruction-selector-s390.cc149
1 files changed, 33 insertions, 116 deletions
diff --git a/deps/v8/src/compiler/s390/instruction-selector-s390.cc b/deps/v8/src/compiler/s390/instruction-selector-s390.cc
index 61a335d46e..2c658880c9 100644
--- a/deps/v8/src/compiler/s390/instruction-selector-s390.cc
+++ b/deps/v8/src/compiler/s390/instruction-selector-s390.cc
@@ -101,9 +101,9 @@ class S390OperandGenerator final : public OperandGenerator {
int64_t GetImmediate(Node* node) {
if (node->opcode() == IrOpcode::kInt32Constant)
- return OpParameter<int32_t>(node);
+ return OpParameter<int32_t>(node->op());
else if (node->opcode() == IrOpcode::kInt64Constant)
- return OpParameter<int64_t>(node);
+ return OpParameter<int64_t>(node->op());
else
UNIMPLEMENTED();
return 0L;
@@ -112,9 +112,9 @@ class S390OperandGenerator final : public OperandGenerator {
bool CanBeImmediate(Node* node, OperandModes mode) {
int64_t value;
if (node->opcode() == IrOpcode::kInt32Constant)
- value = OpParameter<int32_t>(node);
+ value = OpParameter<int32_t>(node->op());
else if (node->opcode() == IrOpcode::kInt64Constant)
- value = OpParameter<int64_t>(node);
+ value = OpParameter<int64_t>(node->op());
else
return false;
return CanBeImmediate(value, mode);
@@ -271,7 +271,7 @@ bool S390OpcodeOnlySupport12BitDisp(InstructionCode op) {
ArchOpcode SelectLoadOpcode(Node* node) {
NodeMatcher m(node);
- DCHECK(m.IsLoad());
+ DCHECK(m.IsLoad() || m.IsPoisonedLoad());
LoadRepresentation load_rep = LoadRepresentationOf(node->op());
ArchOpcode opcode = kArchNop;
switch (load_rep.representation()) {
@@ -583,11 +583,6 @@ void VisitUnaryOp(InstructionSelector* selector, Node* node,
inputs[input_count++] = g.TempImmediate(!canEliminateZeroExt);
}
- if (cont->IsBranch()) {
- inputs[input_count++] = g.Label(cont->true_block());
- inputs[input_count++] = g.Label(cont->false_block());
- }
-
if (!cont->IsDeoptimize()) {
// If we can deoptimize as a result of the binop, we need to make sure
// that the deopt inputs are not overwritten by the binop result. One way
@@ -602,27 +597,13 @@ void VisitUnaryOp(InstructionSelector* selector, Node* node,
outputs[output_count++] = g.DefineSameAsFirst(node);
}
- if (cont->IsSet()) {
- outputs[output_count++] = g.DefineAsRegister(cont->result());
- }
-
DCHECK_NE(0u, input_count);
DCHECK_NE(0u, output_count);
DCHECK_GE(arraysize(inputs), input_count);
DCHECK_GE(arraysize(outputs), output_count);
- opcode = cont->Encode(opcode);
-
- if (cont->IsDeoptimize()) {
- selector->EmitDeoptimize(opcode, output_count, outputs, input_count, inputs,
- cont->kind(), cont->reason(), cont->feedback(),
- cont->frame_state());
- } else if (cont->IsTrap()) {
- inputs[input_count++] = g.UseImmediate(cont->trap_id());
- selector->Emit(opcode, output_count, outputs, input_count, inputs);
- } else {
- selector->Emit(opcode, output_count, outputs, input_count, inputs);
- }
+ selector->EmitWithContinuation(opcode, output_count, outputs, input_count,
+ inputs, cont);
}
template <class CanCombineWithLoad>
@@ -658,11 +639,6 @@ void VisitBinOp(InstructionSelector* selector, Node* node,
inputs[input_count++] = g.TempImmediate(!canEliminateZeroExt);
}
- if (cont->IsBranch()) {
- inputs[input_count++] = g.Label(cont->true_block());
- inputs[input_count++] = g.Label(cont->false_block());
- }
-
if ((operand_mode & OperandMode::kAllowDistinctOps) &&
// If we can deoptimize as a result of the binop, we need to make sure
// that the deopt inputs are not overwritten by the binop result. One way
@@ -678,27 +654,13 @@ void VisitBinOp(InstructionSelector* selector, Node* node,
outputs[output_count++] = g.DefineSameAsFirst(node);
}
- if (cont->IsSet()) {
- outputs[output_count++] = g.DefineAsRegister(cont->result());
- }
-
DCHECK_NE(0u, input_count);
DCHECK_NE(0u, output_count);
DCHECK_GE(arraysize(inputs), input_count);
DCHECK_GE(arraysize(outputs), output_count);
- opcode = cont->Encode(opcode);
-
- if (cont->IsDeoptimize()) {
- selector->EmitDeoptimize(opcode, output_count, outputs, input_count, inputs,
- cont->kind(), cont->reason(), cont->feedback(),
- cont->frame_state());
- } else if (cont->IsTrap()) {
- inputs[input_count++] = g.UseImmediate(cont->trap_id());
- selector->Emit(opcode, output_count, outputs, input_count, inputs);
- } else {
- selector->Emit(opcode, output_count, outputs, input_count, inputs);
- }
+ selector->EmitWithContinuation(opcode, output_count, outputs, input_count,
+ inputs, cont);
}
} // namespace
@@ -728,7 +690,7 @@ void InstructionSelector::VisitLoad(Node* node) {
g.GetEffectiveAddressMemoryOperand(node, inputs, &input_count);
opcode |= AddressingModeField::encode(mode);
if (node->opcode() == IrOpcode::kPoisonedLoad) {
- CHECK_EQ(load_poisoning_, LoadPoisoning::kDoPoison);
+ CHECK_EQ(poisoning_enabled_, PoisoningMitigationLevel::kOn);
opcode |= MiscField::encode(kMemoryAccessPoisoned);
}
@@ -1651,22 +1613,7 @@ namespace {
void VisitCompare(InstructionSelector* selector, InstructionCode opcode,
InstructionOperand left, InstructionOperand right,
FlagsContinuation* cont) {
- S390OperandGenerator g(selector);
- opcode = cont->Encode(opcode);
- if (cont->IsBranch()) {
- selector->Emit(opcode, g.NoOutput(), left, right,
- g.Label(cont->true_block()), g.Label(cont->false_block()));
- } else if (cont->IsDeoptimize()) {
- selector->EmitDeoptimize(opcode, g.NoOutput(), left, right, cont->kind(),
- cont->reason(), cont->feedback(),
- cont->frame_state());
- } else if (cont->IsSet()) {
- selector->Emit(opcode, g.DefineAsRegister(cont->result()), left, right);
- } else {
- DCHECK(cont->IsTrap());
- selector->Emit(opcode, g.NoOutput(), left, right,
- g.UseImmediate(cont->trap_id()));
- }
+ selector->EmitWithContinuation(opcode, left, right, cont);
}
void VisitLoadAndTest(InstructionSelector* selector, InstructionCode opcode,
@@ -1727,27 +1674,9 @@ void VisitWordCompare(InstructionSelector* selector, Node* node,
inputs[input_count++] = g.UseAnyExceptImmediate(right);
}
- opcode = cont->Encode(opcode);
- if (cont->IsBranch()) {
- inputs[input_count++] = g.Label(cont->true_block());
- inputs[input_count++] = g.Label(cont->false_block());
- } else if (cont->IsSet()) {
- outputs[output_count++] = g.DefineAsRegister(cont->result());
- } else if (cont->IsTrap()) {
- inputs[input_count++] = g.UseImmediate(cont->trap_id());
- } else {
- DCHECK(cont->IsDeoptimize());
- // nothing to do
- }
-
DCHECK(input_count <= 8 && output_count <= 1);
- if (cont->IsDeoptimize()) {
- selector->EmitDeoptimize(opcode, 0, nullptr, input_count, inputs,
- cont->kind(), cont->reason(), cont->feedback(),
- cont->frame_state());
- } else {
- selector->Emit(opcode, output_count, outputs, input_count, inputs);
- }
+ selector->EmitWithContinuation(opcode, output_count, outputs, input_count,
+ inputs, cont);
}
void VisitWord32Compare(InstructionSelector* selector, Node* node,
@@ -1832,28 +1761,9 @@ void VisitLoadAndTest(InstructionSelector* selector, InstructionCode opcode,
outputs[output_count++] = g.DefineAsRegister(value);
}
- opcode = cont->Encode(opcode);
- if (cont->IsBranch()) {
- inputs[input_count++] = g.Label(cont->true_block());
- inputs[input_count++] = g.Label(cont->false_block());
- } else if (cont->IsSet()) {
- outputs[output_count++] = g.DefineAsRegister(cont->result());
- } else if (cont->IsTrap()) {
- inputs[input_count++] = g.UseImmediate(cont->trap_id());
- } else {
- DCHECK(cont->IsDeoptimize());
- // nothing to do
- }
-
DCHECK(input_count <= 8 && output_count <= 2);
- opcode = cont->Encode(opcode);
- if (cont->IsDeoptimize()) {
- selector->EmitDeoptimize(opcode, output_count, outputs, input_count, inputs,
- cont->kind(), cont->reason(), cont->feedback(),
- cont->frame_state());
- } else {
- selector->Emit(opcode, output_count, outputs, input_count, inputs);
- }
+ selector->EmitWithContinuation(opcode, output_count, outputs, input_count,
+ inputs, cont);
}
} // namespace
@@ -2095,20 +2005,20 @@ void InstructionSelector::VisitSwitch(Node* node, const SwitchInfo& sw) {
// Emit either ArchTableSwitch or ArchLookupSwitch.
if (enable_switch_jump_table_ == kEnableSwitchJumpTable) {
static const size_t kMaxTableSwitchValueRange = 2 << 16;
- size_t table_space_cost = 4 + sw.value_range;
+ size_t table_space_cost = 4 + sw.value_range();
size_t table_time_cost = 3;
- size_t lookup_space_cost = 3 + 2 * sw.case_count;
- size_t lookup_time_cost = sw.case_count;
- if (sw.case_count > 0 &&
+ size_t lookup_space_cost = 3 + 2 * sw.case_count();
+ size_t lookup_time_cost = sw.case_count();
+ if (sw.case_count() > 0 &&
table_space_cost + 3 * table_time_cost <=
lookup_space_cost + 3 * lookup_time_cost &&
- sw.min_value > std::numeric_limits<int32_t>::min() &&
- sw.value_range <= kMaxTableSwitchValueRange) {
+ sw.min_value() > std::numeric_limits<int32_t>::min() &&
+ sw.value_range() <= kMaxTableSwitchValueRange) {
InstructionOperand index_operand = value_operand;
- if (sw.min_value) {
+ if (sw.min_value()) {
index_operand = g.TempRegister();
Emit(kS390_Lay | AddressingModeField::encode(kMode_MRI), index_operand,
- value_operand, g.TempImmediate(-sw.min_value));
+ value_operand, g.TempImmediate(-sw.min_value()));
}
#if V8_TARGET_ARCH_S390X
InstructionOperand index_operand_zero_ext = g.TempRegister();
@@ -2567,6 +2477,16 @@ void InstructionSelector::VisitF32x4Neg(Node* node) { UNIMPLEMENTED(); }
void InstructionSelector::VisitF32x4Abs(Node* node) { UNIMPLEMENTED(); }
+void InstructionSelector::VisitF32x4RecipSqrtApprox(Node* node) {
+ UNIMPLEMENTED();
+}
+
+void InstructionSelector::VisitF32x4RecipApprox(Node* node) { UNIMPLEMENTED(); }
+
+void InstructionSelector::VisitF32x4AddHoriz(Node* node) { UNIMPLEMENTED(); }
+void InstructionSelector::VisitI32x4AddHoriz(Node* node) { UNIMPLEMENTED(); }
+void InstructionSelector::VisitI16x8AddHoriz(Node* node) { UNIMPLEMENTED(); }
+
// static
MachineOperatorBuilder::Flags
InstructionSelector::SupportedMachineOperatorFlags() {
@@ -2592,9 +2512,6 @@ InstructionSelector::AlignmentRequirements() {
FullUnalignedAccessSupport();
}
-// static
-bool InstructionSelector::SupportsSpeculationPoisoning() { return true; }
-
} // namespace compiler
} // namespace internal
} // namespace v8