Index: test/unittests/compiler/machine-operator-unittest.cc |
diff --git a/test/unittests/compiler/machine-operator-unittest.cc b/test/unittests/compiler/machine-operator-unittest.cc |
index 41ac5c1ca5abcb247f14dda5cdc117c4ad5f2fd8..74e55174a40338fe128ab2372f55e5a04e4e64e5 100644 |
--- a/test/unittests/compiler/machine-operator-unittest.cc |
+++ b/test/unittests/compiler/machine-operator-unittest.cc |
@@ -158,6 +158,7 @@ struct PureOperator { |
const Operator* (MachineOperatorBuilder::*constructor)(); |
IrOpcode::Value opcode; |
int value_input_count; |
+ int control_input_count; |
int value_output_count; |
}; |
@@ -168,43 +169,41 @@ std::ostream& operator<<(std::ostream& os, const PureOperator& pop) { |
const PureOperator kPureOperators[] = { |
-#define PURE(Name, input_count, output_count) \ |
- { \ |
- &MachineOperatorBuilder::Name, IrOpcode::k##Name, input_count, \ |
- output_count \ |
+#define PURE(Name, value_input_count, control_input_count, value_output_count) \ |
+ { \ |
+ &MachineOperatorBuilder::Name, IrOpcode::k##Name, value_input_count, \ |
+ control_input_count, value_output_count \ |
} |
- PURE(Word32And, 2, 1), PURE(Word32Or, 2, 1), |
- PURE(Word32Xor, 2, 1), PURE(Word32Shl, 2, 1), |
- PURE(Word32Shr, 2, 1), PURE(Word32Sar, 2, 1), |
- PURE(Word32Ror, 2, 1), PURE(Word32Equal, 2, 1), |
- PURE(Word64And, 2, 1), PURE(Word64Or, 2, 1), |
- PURE(Word64Xor, 2, 1), PURE(Word64Shl, 2, 1), |
- PURE(Word64Shr, 2, 1), PURE(Word64Sar, 2, 1), |
- PURE(Word64Ror, 2, 1), PURE(Word64Equal, 2, 1), |
- PURE(Int32Add, 2, 1), PURE(Int32AddWithOverflow, 2, 2), |
- PURE(Int32Sub, 2, 1), PURE(Int32SubWithOverflow, 2, 2), |
- PURE(Int32Mul, 2, 1), PURE(Int32MulHigh, 2, 1), |
- PURE(Int32Div, 2, 1), PURE(Uint32Div, 2, 1), |
- PURE(Int32Mod, 2, 1), PURE(Uint32Mod, 2, 1), |
- PURE(Int32LessThan, 2, 1), PURE(Int32LessThanOrEqual, 2, 1), |
- PURE(Uint32LessThan, 2, 1), PURE(Uint32LessThanOrEqual, 2, 1), |
- PURE(Int64Add, 2, 1), PURE(Int64Sub, 2, 1), |
- PURE(Int64Mul, 2, 1), PURE(Int64Div, 2, 1), |
- PURE(Uint64Div, 2, 1), PURE(Int64Mod, 2, 1), |
- PURE(Uint64Mod, 2, 1), PURE(Int64LessThan, 2, 1), |
- PURE(Int64LessThanOrEqual, 2, 1), PURE(Uint64LessThan, 2, 1), |
- PURE(ChangeFloat32ToFloat64, 1, 1), PURE(ChangeFloat64ToInt32, 1, 1), |
- PURE(ChangeFloat64ToUint32, 1, 1), PURE(ChangeInt32ToInt64, 1, 1), |
- PURE(ChangeUint32ToFloat64, 1, 1), PURE(ChangeUint32ToUint64, 1, 1), |
- PURE(TruncateFloat64ToFloat32, 1, 1), PURE(TruncateFloat64ToInt32, 1, 1), |
- PURE(TruncateInt64ToInt32, 1, 1), PURE(Float64Add, 2, 1), |
- PURE(Float64Sub, 2, 1), PURE(Float64Mul, 2, 1), |
- PURE(Float64Div, 2, 1), PURE(Float64Mod, 2, 1), |
- PURE(Float64Sqrt, 1, 1), PURE(Float64Equal, 2, 1), |
- PURE(Float64LessThan, 2, 1), PURE(Float64LessThanOrEqual, 2, 1), |
- PURE(LoadStackPointer, 0, 1), PURE(Float64Floor, 1, 1), |
- PURE(Float64Ceil, 1, 1), PURE(Float64RoundTruncate, 1, 1), |
- PURE(Float64RoundTiesAway, 1, 1), |
+ PURE(Word32And, 2, 0, 1), PURE(Word32Or, 2, 0, 1), PURE(Word32Xor, 2, 0, 1), |
+ PURE(Word32Shl, 2, 0, 1), PURE(Word32Shr, 2, 0, 1), |
+ PURE(Word32Sar, 2, 0, 1), PURE(Word32Ror, 2, 0, 1), |
+ PURE(Word32Equal, 2, 0, 1), PURE(Word64And, 2, 0, 1), |
+ PURE(Word64Or, 2, 0, 1), PURE(Word64Xor, 2, 0, 1), PURE(Word64Shl, 2, 0, 1), |
+ PURE(Word64Shr, 2, 0, 1), PURE(Word64Sar, 2, 0, 1), |
+ PURE(Word64Ror, 2, 0, 1), PURE(Word64Equal, 2, 0, 1), |
+ PURE(Int32Add, 2, 0, 1), PURE(Int32AddWithOverflow, 2, 0, 2), |
+ PURE(Int32Sub, 2, 0, 1), PURE(Int32SubWithOverflow, 2, 0, 2), |
+ PURE(Int32Mul, 2, 0, 1), PURE(Int32MulHigh, 2, 0, 1), |
+ PURE(Int32Div, 2, 1, 1), PURE(Uint32Div, 2, 1, 1), PURE(Int32Mod, 2, 1, 1), |
+ PURE(Uint32Mod, 2, 1, 1), PURE(Int32LessThan, 2, 0, 1), |
+ PURE(Int32LessThanOrEqual, 2, 0, 1), PURE(Uint32LessThan, 2, 0, 1), |
+ PURE(Uint32LessThanOrEqual, 2, 0, 1), PURE(Int64Add, 2, 0, 1), |
+ PURE(Int64Sub, 2, 0, 1), PURE(Int64Mul, 2, 0, 1), PURE(Int64Div, 2, 0, 1), |
+ PURE(Uint64Div, 2, 0, 1), PURE(Int64Mod, 2, 0, 1), PURE(Uint64Mod, 2, 0, 1), |
+ PURE(Int64LessThan, 2, 0, 1), PURE(Int64LessThanOrEqual, 2, 0, 1), |
+ PURE(Uint64LessThan, 2, 0, 1), PURE(ChangeFloat32ToFloat64, 1, 0, 1), |
+ PURE(ChangeFloat64ToInt32, 1, 0, 1), PURE(ChangeFloat64ToUint32, 1, 0, 1), |
+ PURE(ChangeInt32ToInt64, 1, 0, 1), PURE(ChangeUint32ToFloat64, 1, 0, 1), |
+ PURE(ChangeUint32ToUint64, 1, 0, 1), |
+ PURE(TruncateFloat64ToFloat32, 1, 0, 1), |
+ PURE(TruncateFloat64ToInt32, 1, 0, 1), PURE(TruncateInt64ToInt32, 1, 0, 1), |
+ PURE(Float64Add, 2, 0, 1), PURE(Float64Sub, 2, 0, 1), |
+ PURE(Float64Mul, 2, 0, 1), PURE(Float64Div, 2, 0, 1), |
+ PURE(Float64Mod, 2, 0, 1), PURE(Float64Sqrt, 1, 0, 1), |
+ PURE(Float64Equal, 2, 0, 1), PURE(Float64LessThan, 2, 0, 1), |
+ PURE(Float64LessThanOrEqual, 2, 0, 1), PURE(LoadStackPointer, 0, 0, 1), |
+ PURE(Float64Floor, 1, 0, 1), PURE(Float64Ceil, 1, 0, 1), |
+ PURE(Float64RoundTruncate, 1, 0, 1), PURE(Float64RoundTiesAway, 1, 0, 1) |
#undef PURE |
}; |
@@ -229,8 +228,10 @@ TEST_P(MachinePureOperatorTest, NumberOfInputsAndOutputs) { |
EXPECT_EQ(pop.value_input_count, OperatorProperties::GetValueInputCount(op)); |
EXPECT_EQ(0, OperatorProperties::GetEffectInputCount(op)); |
- EXPECT_EQ(0, OperatorProperties::GetControlInputCount(op)); |
- EXPECT_EQ(pop.value_input_count, OperatorProperties::GetTotalInputCount(op)); |
+ EXPECT_EQ(pop.control_input_count, |
+ OperatorProperties::GetControlInputCount(op)); |
+ EXPECT_EQ(pop.value_input_count + pop.control_input_count, |
+ OperatorProperties::GetTotalInputCount(op)); |
EXPECT_EQ(pop.value_output_count, |
OperatorProperties::GetValueOutputCount(op)); |