Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(659)

Unified Diff: test/unittests/compiler/arm/instruction-selector-arm-unittest.cc

Issue 1513543003: [turbofan] Make MachineType a pair of enums. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Moar rebase Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: test/unittests/compiler/arm/instruction-selector-arm-unittest.cc
diff --git a/test/unittests/compiler/arm/instruction-selector-arm-unittest.cc b/test/unittests/compiler/arm/instruction-selector-arm-unittest.cc
index d07743919d1134668ef134a7a696f05358cd0d82..162d82875d5d8a63655fdcb0cd34ebb715ef1fe5 100644
--- a/test/unittests/compiler/arm/instruction-selector-arm-unittest.cc
+++ b/test/unittests/compiler/arm/instruction-selector-arm-unittest.cc
@@ -52,16 +52,22 @@ std::ostream& operator<<(std::ostream& os, const FAI& fai) {
}
-const FAI kFAIs[] = {
- {&RawMachineAssembler::Float32Add, "Float32Add", kMachFloat32, kArmVaddF32},
- {&RawMachineAssembler::Float64Add, "Float64Add", kMachFloat64, kArmVaddF64},
- {&RawMachineAssembler::Float32Sub, "Float32Sub", kMachFloat32, kArmVsubF32},
- {&RawMachineAssembler::Float64Sub, "Float64Sub", kMachFloat64, kArmVsubF64},
- {&RawMachineAssembler::Float32Mul, "Float32Mul", kMachFloat32, kArmVmulF32},
- {&RawMachineAssembler::Float64Mul, "Float64Mul", kMachFloat64, kArmVmulF64},
- {&RawMachineAssembler::Float32Div, "Float32Div", kMachFloat32, kArmVdivF32},
- {&RawMachineAssembler::Float64Div, "Float64Div", kMachFloat64,
- kArmVdivF64}};
+const FAI kFAIs[] = {{&RawMachineAssembler::Float32Add, "Float32Add",
+ MachineType::Float32(), kArmVaddF32},
+ {&RawMachineAssembler::Float64Add, "Float64Add",
+ MachineType::Float64(), kArmVaddF64},
+ {&RawMachineAssembler::Float32Sub, "Float32Sub",
+ MachineType::Float32(), kArmVsubF32},
+ {&RawMachineAssembler::Float64Sub, "Float64Sub",
+ MachineType::Float64(), kArmVsubF64},
+ {&RawMachineAssembler::Float32Mul, "Float32Mul",
+ MachineType::Float32(), kArmVmulF32},
+ {&RawMachineAssembler::Float64Mul, "Float64Mul",
+ MachineType::Float64(), kArmVmulF64},
+ {&RawMachineAssembler::Float32Div, "Float32Div",
+ MachineType::Float32(), kArmVdivF32},
+ {&RawMachineAssembler::Float64Div, "Float64Div",
+ MachineType::Float64(), kArmVdivF64}};
// Data processing instructions with overflow.
@@ -141,7 +147,8 @@ typedef InstructionSelectorTestWithParam<DPI> InstructionSelectorDPITest;
TEST_P(InstructionSelectorDPITest, Parameters) {
const DPI dpi = GetParam();
- StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32);
+ StreamBuilder m(this, MachineType::Int32(), MachineType::Int32(),
+ MachineType::Int32());
m.Return((m.*dpi.constructor)(m.Parameter(0), m.Parameter(1)));
Stream s = m.Build();
ASSERT_EQ(1U, s.size());
@@ -155,7 +162,7 @@ TEST_P(InstructionSelectorDPITest, Parameters) {
TEST_P(InstructionSelectorDPITest, Immediate) {
const DPI dpi = GetParam();
TRACED_FOREACH(int32_t, imm, kImmediates) {
- StreamBuilder m(this, kMachInt32, kMachInt32);
+ StreamBuilder m(this, MachineType::Int32(), MachineType::Int32());
m.Return((m.*dpi.constructor)(m.Parameter(0), m.Int32Constant(imm)));
Stream s = m.Build();
ASSERT_EQ(1U, s.size());
@@ -166,7 +173,7 @@ TEST_P(InstructionSelectorDPITest, Immediate) {
EXPECT_EQ(1U, s[0]->OutputCount());
}
TRACED_FOREACH(int32_t, imm, kImmediates) {
- StreamBuilder m(this, kMachInt32, kMachInt32);
+ StreamBuilder m(this, MachineType::Int32(), MachineType::Int32());
m.Return((m.*dpi.constructor)(m.Int32Constant(imm), m.Parameter(0)));
Stream s = m.Build();
ASSERT_EQ(1U, s.size());
@@ -182,7 +189,8 @@ TEST_P(InstructionSelectorDPITest, Immediate) {
TEST_P(InstructionSelectorDPITest, ShiftByParameter) {
const DPI dpi = GetParam();
TRACED_FOREACH(Shift, shift, kShifts) {
- StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32, kMachInt32);
+ StreamBuilder m(this, MachineType::Int32(), MachineType::Int32(),
+ MachineType::Int32(), MachineType::Int32());
m.Return((m.*dpi.constructor)(
m.Parameter(0),
(m.*shift.constructor)(m.Parameter(1), m.Parameter(2))));
@@ -194,7 +202,8 @@ TEST_P(InstructionSelectorDPITest, ShiftByParameter) {
EXPECT_EQ(1U, s[0]->OutputCount());
}
TRACED_FOREACH(Shift, shift, kShifts) {
- StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32, kMachInt32);
+ StreamBuilder m(this, MachineType::Int32(), MachineType::Int32(),
+ MachineType::Int32(), MachineType::Int32());
m.Return((m.*dpi.constructor)(
(m.*shift.constructor)(m.Parameter(0), m.Parameter(1)),
m.Parameter(2)));
@@ -212,7 +221,8 @@ TEST_P(InstructionSelectorDPITest, ShiftByImmediate) {
const DPI dpi = GetParam();
TRACED_FOREACH(Shift, shift, kShifts) {
TRACED_FORRANGE(int32_t, imm, shift.i_low, shift.i_high) {
- StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32);
+ StreamBuilder m(this, MachineType::Int32(), MachineType::Int32(),
+ MachineType::Int32());
m.Return((m.*dpi.constructor)(
m.Parameter(0),
(m.*shift.constructor)(m.Parameter(1), m.Int32Constant(imm))));
@@ -227,7 +237,8 @@ TEST_P(InstructionSelectorDPITest, ShiftByImmediate) {
}
TRACED_FOREACH(Shift, shift, kShifts) {
TRACED_FORRANGE(int32_t, imm, shift.i_low, shift.i_high) {
- StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32);
+ StreamBuilder m(this, MachineType::Int32(), MachineType::Int32(),
+ MachineType::Int32());
m.Return((m.*dpi.constructor)(
(m.*shift.constructor)(m.Parameter(0), m.Int32Constant(imm)),
m.Parameter(1)));
@@ -245,7 +256,8 @@ TEST_P(InstructionSelectorDPITest, ShiftByImmediate) {
TEST_P(InstructionSelectorDPITest, BranchWithParameters) {
const DPI dpi = GetParam();
- StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32);
+ StreamBuilder m(this, MachineType::Int32(), MachineType::Int32(),
+ MachineType::Int32());
RawMachineLabel a, b;
m.Branch((m.*dpi.constructor)(m.Parameter(0), m.Parameter(1)), &a, &b);
m.Bind(&a);
@@ -264,7 +276,7 @@ TEST_P(InstructionSelectorDPITest, BranchWithParameters) {
TEST_P(InstructionSelectorDPITest, BranchWithImmediate) {
const DPI dpi = GetParam();
TRACED_FOREACH(int32_t, imm, kImmediates) {
- StreamBuilder m(this, kMachInt32, kMachInt32);
+ StreamBuilder m(this, MachineType::Int32(), MachineType::Int32());
RawMachineLabel a, b;
m.Branch((m.*dpi.constructor)(m.Parameter(0), m.Int32Constant(imm)), &a,
&b);
@@ -280,7 +292,7 @@ TEST_P(InstructionSelectorDPITest, BranchWithImmediate) {
EXPECT_EQ(kNotEqual, s[0]->flags_condition());
}
TRACED_FOREACH(int32_t, imm, kImmediates) {
- StreamBuilder m(this, kMachInt32, kMachInt32);
+ StreamBuilder m(this, MachineType::Int32(), MachineType::Int32());
RawMachineLabel a, b;
m.Branch((m.*dpi.constructor)(m.Int32Constant(imm), m.Parameter(0)), &a,
&b);
@@ -301,7 +313,8 @@ TEST_P(InstructionSelectorDPITest, BranchWithImmediate) {
TEST_P(InstructionSelectorDPITest, BranchWithShiftByParameter) {
const DPI dpi = GetParam();
TRACED_FOREACH(Shift, shift, kShifts) {
- StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32, kMachInt32);
+ StreamBuilder m(this, MachineType::Int32(), MachineType::Int32(),
+ MachineType::Int32(), MachineType::Int32());
RawMachineLabel a, b;
m.Branch((m.*dpi.constructor)(
m.Parameter(0),
@@ -319,7 +332,8 @@ TEST_P(InstructionSelectorDPITest, BranchWithShiftByParameter) {
EXPECT_EQ(kNotEqual, s[0]->flags_condition());
}
TRACED_FOREACH(Shift, shift, kShifts) {
- StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32, kMachInt32);
+ StreamBuilder m(this, MachineType::Int32(), MachineType::Int32(),
+ MachineType::Int32(), MachineType::Int32());
RawMachineLabel a, b;
m.Branch((m.*dpi.constructor)(
(m.*shift.constructor)(m.Parameter(0), m.Parameter(1)),
@@ -343,7 +357,8 @@ TEST_P(InstructionSelectorDPITest, BranchWithShiftByImmediate) {
const DPI dpi = GetParam();
TRACED_FOREACH(Shift, shift, kShifts) {
TRACED_FORRANGE(int32_t, imm, shift.i_low, shift.i_high) {
- StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32);
+ StreamBuilder m(this, MachineType::Int32(), MachineType::Int32(),
+ MachineType::Int32());
RawMachineLabel a, b;
m.Branch((m.*dpi.constructor)(m.Parameter(0),
(m.*shift.constructor)(
@@ -365,7 +380,8 @@ TEST_P(InstructionSelectorDPITest, BranchWithShiftByImmediate) {
}
TRACED_FOREACH(Shift, shift, kShifts) {
TRACED_FORRANGE(int32_t, imm, shift.i_low, shift.i_high) {
- StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32);
+ StreamBuilder m(this, MachineType::Int32(), MachineType::Int32(),
+ MachineType::Int32());
RawMachineLabel a, b;
m.Branch((m.*dpi.constructor)(
(m.*shift.constructor)(m.Parameter(0), m.Int32Constant(imm)),
@@ -390,7 +406,8 @@ TEST_P(InstructionSelectorDPITest, BranchWithShiftByImmediate) {
TEST_P(InstructionSelectorDPITest, BranchIfZeroWithParameters) {
const DPI dpi = GetParam();
- StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32);
+ StreamBuilder m(this, MachineType::Int32(), MachineType::Int32(),
+ MachineType::Int32());
RawMachineLabel a, b;
m.Branch(m.Word32Equal((m.*dpi.constructor)(m.Parameter(0), m.Parameter(1)),
m.Int32Constant(0)),
@@ -410,7 +427,8 @@ TEST_P(InstructionSelectorDPITest, BranchIfZeroWithParameters) {
TEST_P(InstructionSelectorDPITest, BranchIfNotZeroWithParameters) {
const DPI dpi = GetParam();
- StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32);
+ StreamBuilder m(this, MachineType::Int32(), MachineType::Int32(),
+ MachineType::Int32());
RawMachineLabel a, b;
m.Branch(
m.Word32NotEqual((m.*dpi.constructor)(m.Parameter(0), m.Parameter(1)),
@@ -432,7 +450,7 @@ TEST_P(InstructionSelectorDPITest, BranchIfNotZeroWithParameters) {
TEST_P(InstructionSelectorDPITest, BranchIfZeroWithImmediate) {
const DPI dpi = GetParam();
TRACED_FOREACH(int32_t, imm, kImmediates) {
- StreamBuilder m(this, kMachInt32, kMachInt32);
+ StreamBuilder m(this, MachineType::Int32(), MachineType::Int32());
RawMachineLabel a, b;
m.Branch(m.Word32Equal(
(m.*dpi.constructor)(m.Parameter(0), m.Int32Constant(imm)),
@@ -450,7 +468,7 @@ TEST_P(InstructionSelectorDPITest, BranchIfZeroWithImmediate) {
EXPECT_EQ(kEqual, s[0]->flags_condition());
}
TRACED_FOREACH(int32_t, imm, kImmediates) {
- StreamBuilder m(this, kMachInt32, kMachInt32);
+ StreamBuilder m(this, MachineType::Int32(), MachineType::Int32());
RawMachineLabel a, b;
m.Branch(m.Word32Equal(
(m.*dpi.constructor)(m.Int32Constant(imm), m.Parameter(0)),
@@ -473,7 +491,7 @@ TEST_P(InstructionSelectorDPITest, BranchIfZeroWithImmediate) {
TEST_P(InstructionSelectorDPITest, BranchIfNotZeroWithImmediate) {
const DPI dpi = GetParam();
TRACED_FOREACH(int32_t, imm, kImmediates) {
- StreamBuilder m(this, kMachInt32, kMachInt32);
+ StreamBuilder m(this, MachineType::Int32(), MachineType::Int32());
RawMachineLabel a, b;
m.Branch(m.Word32NotEqual(
(m.*dpi.constructor)(m.Parameter(0), m.Int32Constant(imm)),
@@ -491,7 +509,7 @@ TEST_P(InstructionSelectorDPITest, BranchIfNotZeroWithImmediate) {
EXPECT_EQ(kNotEqual, s[0]->flags_condition());
}
TRACED_FOREACH(int32_t, imm, kImmediates) {
- StreamBuilder m(this, kMachInt32, kMachInt32);
+ StreamBuilder m(this, MachineType::Int32(), MachineType::Int32());
RawMachineLabel a, b;
m.Branch(m.Word32NotEqual(
(m.*dpi.constructor)(m.Int32Constant(imm), m.Parameter(0)),
@@ -524,7 +542,8 @@ typedef InstructionSelectorTestWithParam<ODPI> InstructionSelectorODPITest;
TEST_P(InstructionSelectorODPITest, OvfWithParameters) {
const ODPI odpi = GetParam();
- StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32);
+ StreamBuilder m(this, MachineType::Int32(), MachineType::Int32(),
+ MachineType::Int32());
m.Return(
m.Projection(1, (m.*odpi.constructor)(m.Parameter(0), m.Parameter(1))));
Stream s = m.Build();
@@ -541,7 +560,7 @@ TEST_P(InstructionSelectorODPITest, OvfWithParameters) {
TEST_P(InstructionSelectorODPITest, OvfWithImmediate) {
const ODPI odpi = GetParam();
TRACED_FOREACH(int32_t, imm, kImmediates) {
- StreamBuilder m(this, kMachInt32, kMachInt32);
+ StreamBuilder m(this, MachineType::Int32(), MachineType::Int32());
m.Return(m.Projection(
1, (m.*odpi.constructor)(m.Parameter(0), m.Int32Constant(imm))));
Stream s = m.Build();
@@ -555,7 +574,7 @@ TEST_P(InstructionSelectorODPITest, OvfWithImmediate) {
EXPECT_EQ(kOverflow, s[0]->flags_condition());
}
TRACED_FOREACH(int32_t, imm, kImmediates) {
- StreamBuilder m(this, kMachInt32, kMachInt32);
+ StreamBuilder m(this, MachineType::Int32(), MachineType::Int32());
m.Return(m.Projection(
1, (m.*odpi.constructor)(m.Int32Constant(imm), m.Parameter(0))));
Stream s = m.Build();
@@ -574,7 +593,8 @@ TEST_P(InstructionSelectorODPITest, OvfWithImmediate) {
TEST_P(InstructionSelectorODPITest, OvfWithShiftByParameter) {
const ODPI odpi = GetParam();
TRACED_FOREACH(Shift, shift, kShifts) {
- StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32, kMachInt32);
+ StreamBuilder m(this, MachineType::Int32(), MachineType::Int32(),
+ MachineType::Int32(), MachineType::Int32());
m.Return(m.Projection(
1, (m.*odpi.constructor)(
m.Parameter(0),
@@ -589,7 +609,8 @@ TEST_P(InstructionSelectorODPITest, OvfWithShiftByParameter) {
EXPECT_EQ(kOverflow, s[0]->flags_condition());
}
TRACED_FOREACH(Shift, shift, kShifts) {
- StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32, kMachInt32);
+ StreamBuilder m(this, MachineType::Int32(), MachineType::Int32(),
+ MachineType::Int32(), MachineType::Int32());
m.Return(m.Projection(
1, (m.*odpi.constructor)(
(m.*shift.constructor)(m.Parameter(0), m.Parameter(1)),
@@ -610,7 +631,8 @@ TEST_P(InstructionSelectorODPITest, OvfWithShiftByImmediate) {
const ODPI odpi = GetParam();
TRACED_FOREACH(Shift, shift, kShifts) {
TRACED_FORRANGE(int32_t, imm, shift.i_low, shift.i_high) {
- StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32);
+ StreamBuilder m(this, MachineType::Int32(), MachineType::Int32(),
+ MachineType::Int32());
m.Return(m.Projection(
1, (m.*odpi.constructor)(m.Parameter(0),
(m.*shift.constructor)(
@@ -628,7 +650,8 @@ TEST_P(InstructionSelectorODPITest, OvfWithShiftByImmediate) {
}
TRACED_FOREACH(Shift, shift, kShifts) {
TRACED_FORRANGE(int32_t, imm, shift.i_low, shift.i_high) {
- StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32);
+ StreamBuilder m(this, MachineType::Int32(), MachineType::Int32(),
+ MachineType::Int32());
m.Return(m.Projection(
1, (m.*odpi.constructor)(
(m.*shift.constructor)(m.Parameter(1), m.Int32Constant(imm)),
@@ -649,7 +672,8 @@ TEST_P(InstructionSelectorODPITest, OvfWithShiftByImmediate) {
TEST_P(InstructionSelectorODPITest, ValWithParameters) {
const ODPI odpi = GetParam();
- StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32);
+ StreamBuilder m(this, MachineType::Int32(), MachineType::Int32(),
+ MachineType::Int32());
m.Return(
m.Projection(0, (m.*odpi.constructor)(m.Parameter(0), m.Parameter(1))));
Stream s = m.Build();
@@ -665,7 +689,7 @@ TEST_P(InstructionSelectorODPITest, ValWithParameters) {
TEST_P(InstructionSelectorODPITest, ValWithImmediate) {
const ODPI odpi = GetParam();
TRACED_FOREACH(int32_t, imm, kImmediates) {
- StreamBuilder m(this, kMachInt32, kMachInt32);
+ StreamBuilder m(this, MachineType::Int32(), MachineType::Int32());
m.Return(m.Projection(
0, (m.*odpi.constructor)(m.Parameter(0), m.Int32Constant(imm))));
Stream s = m.Build();
@@ -678,7 +702,7 @@ TEST_P(InstructionSelectorODPITest, ValWithImmediate) {
EXPECT_EQ(kFlags_none, s[0]->flags_mode());
}
TRACED_FOREACH(int32_t, imm, kImmediates) {
- StreamBuilder m(this, kMachInt32, kMachInt32);
+ StreamBuilder m(this, MachineType::Int32(), MachineType::Int32());
m.Return(m.Projection(
0, (m.*odpi.constructor)(m.Int32Constant(imm), m.Parameter(0))));
Stream s = m.Build();
@@ -696,7 +720,8 @@ TEST_P(InstructionSelectorODPITest, ValWithImmediate) {
TEST_P(InstructionSelectorODPITest, ValWithShiftByParameter) {
const ODPI odpi = GetParam();
TRACED_FOREACH(Shift, shift, kShifts) {
- StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32, kMachInt32);
+ StreamBuilder m(this, MachineType::Int32(), MachineType::Int32(),
+ MachineType::Int32(), MachineType::Int32());
m.Return(m.Projection(
0, (m.*odpi.constructor)(
m.Parameter(0),
@@ -710,7 +735,8 @@ TEST_P(InstructionSelectorODPITest, ValWithShiftByParameter) {
EXPECT_EQ(kFlags_none, s[0]->flags_mode());
}
TRACED_FOREACH(Shift, shift, kShifts) {
- StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32, kMachInt32);
+ StreamBuilder m(this, MachineType::Int32(), MachineType::Int32(),
+ MachineType::Int32(), MachineType::Int32());
m.Return(m.Projection(
0, (m.*odpi.constructor)(
(m.*shift.constructor)(m.Parameter(0), m.Parameter(1)),
@@ -730,7 +756,8 @@ TEST_P(InstructionSelectorODPITest, ValWithShiftByImmediate) {
const ODPI odpi = GetParam();
TRACED_FOREACH(Shift, shift, kShifts) {
TRACED_FORRANGE(int32_t, imm, shift.i_low, shift.i_high) {
- StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32);
+ StreamBuilder m(this, MachineType::Int32(), MachineType::Int32(),
+ MachineType::Int32());
m.Return(m.Projection(
0, (m.*odpi.constructor)(m.Parameter(0),
(m.*shift.constructor)(
@@ -747,7 +774,8 @@ TEST_P(InstructionSelectorODPITest, ValWithShiftByImmediate) {
}
TRACED_FOREACH(Shift, shift, kShifts) {
TRACED_FORRANGE(int32_t, imm, shift.i_low, shift.i_high) {
- StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32);
+ StreamBuilder m(this, MachineType::Int32(), MachineType::Int32(),
+ MachineType::Int32());
m.Return(m.Projection(
0, (m.*odpi.constructor)(
(m.*shift.constructor)(m.Parameter(1), m.Int32Constant(imm)),
@@ -767,7 +795,8 @@ TEST_P(InstructionSelectorODPITest, ValWithShiftByImmediate) {
TEST_P(InstructionSelectorODPITest, BothWithParameters) {
const ODPI odpi = GetParam();
- StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32);
+ StreamBuilder m(this, MachineType::Int32(), MachineType::Int32(),
+ MachineType::Int32());
Node* n = (m.*odpi.constructor)(m.Parameter(0), m.Parameter(1));
m.Return(m.Word32Equal(m.Projection(0, n), m.Projection(1, n)));
Stream s = m.Build();
@@ -784,7 +813,7 @@ TEST_P(InstructionSelectorODPITest, BothWithParameters) {
TEST_P(InstructionSelectorODPITest, BothWithImmediate) {
const ODPI odpi = GetParam();
TRACED_FOREACH(int32_t, imm, kImmediates) {
- StreamBuilder m(this, kMachInt32, kMachInt32);
+ StreamBuilder m(this, MachineType::Int32(), MachineType::Int32());
Node* n = (m.*odpi.constructor)(m.Parameter(0), m.Int32Constant(imm));
m.Return(m.Word32Equal(m.Projection(0, n), m.Projection(1, n)));
Stream s = m.Build();
@@ -798,7 +827,7 @@ TEST_P(InstructionSelectorODPITest, BothWithImmediate) {
EXPECT_EQ(kOverflow, s[0]->flags_condition());
}
TRACED_FOREACH(int32_t, imm, kImmediates) {
- StreamBuilder m(this, kMachInt32, kMachInt32);
+ StreamBuilder m(this, MachineType::Int32(), MachineType::Int32());
Node* n = (m.*odpi.constructor)(m.Int32Constant(imm), m.Parameter(0));
m.Return(m.Word32Equal(m.Projection(0, n), m.Projection(1, n)));
Stream s = m.Build();
@@ -817,7 +846,8 @@ TEST_P(InstructionSelectorODPITest, BothWithImmediate) {
TEST_P(InstructionSelectorODPITest, BothWithShiftByParameter) {
const ODPI odpi = GetParam();
TRACED_FOREACH(Shift, shift, kShifts) {
- StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32, kMachInt32);
+ StreamBuilder m(this, MachineType::Int32(), MachineType::Int32(),
+ MachineType::Int32(), MachineType::Int32());
Node* n = (m.*odpi.constructor)(
m.Parameter(0), (m.*shift.constructor)(m.Parameter(1), m.Parameter(2)));
m.Return(m.Word32Equal(m.Projection(0, n), m.Projection(1, n)));
@@ -831,7 +861,8 @@ TEST_P(InstructionSelectorODPITest, BothWithShiftByParameter) {
EXPECT_EQ(kOverflow, s[0]->flags_condition());
}
TRACED_FOREACH(Shift, shift, kShifts) {
- StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32, kMachInt32);
+ StreamBuilder m(this, MachineType::Int32(), MachineType::Int32(),
+ MachineType::Int32(), MachineType::Int32());
Node* n = (m.*odpi.constructor)(
(m.*shift.constructor)(m.Parameter(0), m.Parameter(1)), m.Parameter(2));
m.Return(m.Word32Equal(m.Projection(0, n), m.Projection(1, n)));
@@ -851,7 +882,8 @@ TEST_P(InstructionSelectorODPITest, BothWithShiftByImmediate) {
const ODPI odpi = GetParam();
TRACED_FOREACH(Shift, shift, kShifts) {
TRACED_FORRANGE(int32_t, imm, shift.i_low, shift.i_high) {
- StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32);
+ StreamBuilder m(this, MachineType::Int32(), MachineType::Int32(),
+ MachineType::Int32());
Node* n = (m.*odpi.constructor)(
m.Parameter(0),
(m.*shift.constructor)(m.Parameter(1), m.Int32Constant(imm)));
@@ -869,7 +901,8 @@ TEST_P(InstructionSelectorODPITest, BothWithShiftByImmediate) {
}
TRACED_FOREACH(Shift, shift, kShifts) {
TRACED_FORRANGE(int32_t, imm, shift.i_low, shift.i_high) {
- StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32);
+ StreamBuilder m(this, MachineType::Int32(), MachineType::Int32(),
+ MachineType::Int32());
Node* n = (m.*odpi.constructor)(
(m.*shift.constructor)(m.Parameter(0), m.Int32Constant(imm)),
m.Parameter(1));
@@ -890,7 +923,8 @@ TEST_P(InstructionSelectorODPITest, BothWithShiftByImmediate) {
TEST_P(InstructionSelectorODPITest, BranchWithParameters) {
const ODPI odpi = GetParam();
- StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32);
+ StreamBuilder m(this, MachineType::Int32(), MachineType::Int32(),
+ MachineType::Int32());
RawMachineLabel a, b;
Node* n = (m.*odpi.constructor)(m.Parameter(0), m.Parameter(1));
m.Branch(m.Projection(1, n), &a, &b);
@@ -912,7 +946,7 @@ TEST_P(InstructionSelectorODPITest, BranchWithParameters) {
TEST_P(InstructionSelectorODPITest, BranchWithImmediate) {
const ODPI odpi = GetParam();
TRACED_FOREACH(int32_t, imm, kImmediates) {
- StreamBuilder m(this, kMachInt32, kMachInt32);
+ StreamBuilder m(this, MachineType::Int32(), MachineType::Int32());
RawMachineLabel a, b;
Node* n = (m.*odpi.constructor)(m.Parameter(0), m.Int32Constant(imm));
m.Branch(m.Projection(1, n), &a, &b);
@@ -931,7 +965,7 @@ TEST_P(InstructionSelectorODPITest, BranchWithImmediate) {
EXPECT_EQ(kOverflow, s[0]->flags_condition());
}
TRACED_FOREACH(int32_t, imm, kImmediates) {
- StreamBuilder m(this, kMachInt32, kMachInt32);
+ StreamBuilder m(this, MachineType::Int32(), MachineType::Int32());
RawMachineLabel a, b;
Node* n = (m.*odpi.constructor)(m.Int32Constant(imm), m.Parameter(0));
m.Branch(m.Projection(1, n), &a, &b);
@@ -954,7 +988,8 @@ TEST_P(InstructionSelectorODPITest, BranchWithImmediate) {
TEST_P(InstructionSelectorODPITest, BranchIfZeroWithParameters) {
const ODPI odpi = GetParam();
- StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32);
+ StreamBuilder m(this, MachineType::Int32(), MachineType::Int32(),
+ MachineType::Int32());
RawMachineLabel a, b;
Node* n = (m.*odpi.constructor)(m.Parameter(0), m.Parameter(1));
m.Branch(m.Word32Equal(m.Projection(1, n), m.Int32Constant(0)), &a, &b);
@@ -975,7 +1010,8 @@ TEST_P(InstructionSelectorODPITest, BranchIfZeroWithParameters) {
TEST_P(InstructionSelectorODPITest, BranchIfNotZeroWithParameters) {
const ODPI odpi = GetParam();
- StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32);
+ StreamBuilder m(this, MachineType::Int32(), MachineType::Int32(),
+ MachineType::Int32());
RawMachineLabel a, b;
Node* n = (m.*odpi.constructor)(m.Parameter(0), m.Parameter(1));
m.Branch(m.Word32NotEqual(m.Projection(1, n), m.Int32Constant(0)), &a, &b);
@@ -1007,7 +1043,8 @@ typedef InstructionSelectorTestWithParam<Shift> InstructionSelectorShiftTest;
TEST_P(InstructionSelectorShiftTest, Parameters) {
const Shift shift = GetParam();
- StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32);
+ StreamBuilder m(this, MachineType::Int32(), MachineType::Int32(),
+ MachineType::Int32());
m.Return((m.*shift.constructor)(m.Parameter(0), m.Parameter(1)));
Stream s = m.Build();
ASSERT_EQ(1U, s.size());
@@ -1021,7 +1058,7 @@ TEST_P(InstructionSelectorShiftTest, Parameters) {
TEST_P(InstructionSelectorShiftTest, Immediate) {
const Shift shift = GetParam();
TRACED_FORRANGE(int32_t, imm, shift.i_low, shift.i_high) {
- StreamBuilder m(this, kMachInt32, kMachInt32);
+ StreamBuilder m(this, MachineType::Int32(), MachineType::Int32());
m.Return((m.*shift.constructor)(m.Parameter(0), m.Int32Constant(imm)));
Stream s = m.Build();
ASSERT_EQ(1U, s.size());
@@ -1037,7 +1074,8 @@ TEST_P(InstructionSelectorShiftTest, Immediate) {
TEST_P(InstructionSelectorShiftTest, Word32EqualWithParameter) {
const Shift shift = GetParam();
{
- StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32, kMachInt32);
+ StreamBuilder m(this, MachineType::Int32(), MachineType::Int32(),
+ MachineType::Int32(), MachineType::Int32());
m.Return(
m.Word32Equal(m.Parameter(0),
(m.*shift.constructor)(m.Parameter(1), m.Parameter(2))));
@@ -1051,7 +1089,8 @@ TEST_P(InstructionSelectorShiftTest, Word32EqualWithParameter) {
EXPECT_EQ(kEqual, s[0]->flags_condition());
}
{
- StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32, kMachInt32);
+ StreamBuilder m(this, MachineType::Int32(), MachineType::Int32(),
+ MachineType::Int32(), MachineType::Int32());
m.Return(
m.Word32Equal((m.*shift.constructor)(m.Parameter(1), m.Parameter(2)),
m.Parameter(0)));
@@ -1070,7 +1109,8 @@ TEST_P(InstructionSelectorShiftTest, Word32EqualWithParameter) {
TEST_P(InstructionSelectorShiftTest, Word32EqualWithParameterAndImmediate) {
const Shift shift = GetParam();
TRACED_FORRANGE(int32_t, imm, shift.i_low, shift.i_high) {
- StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32);
+ StreamBuilder m(this, MachineType::Int32(), MachineType::Int32(),
+ MachineType::Int32());
m.Return(m.Word32Equal(
(m.*shift.constructor)(m.Parameter(1), m.Int32Constant(imm)),
m.Parameter(0)));
@@ -1085,7 +1125,8 @@ TEST_P(InstructionSelectorShiftTest, Word32EqualWithParameterAndImmediate) {
EXPECT_EQ(kEqual, s[0]->flags_condition());
}
TRACED_FORRANGE(int32_t, imm, shift.i_low, shift.i_high) {
- StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32);
+ StreamBuilder m(this, MachineType::Int32(), MachineType::Int32(),
+ MachineType::Int32());
m.Return(m.Word32Equal(
m.Parameter(0),
(m.*shift.constructor)(m.Parameter(1), m.Int32Constant(imm))));
@@ -1104,7 +1145,8 @@ TEST_P(InstructionSelectorShiftTest, Word32EqualWithParameterAndImmediate) {
TEST_P(InstructionSelectorShiftTest, Word32EqualToZeroWithParameters) {
const Shift shift = GetParam();
- StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32);
+ StreamBuilder m(this, MachineType::Int32(), MachineType::Int32(),
+ MachineType::Int32());
m.Return(
m.Word32Equal(m.Int32Constant(0),
(m.*shift.constructor)(m.Parameter(0), m.Parameter(1))));
@@ -1122,7 +1164,8 @@ TEST_P(InstructionSelectorShiftTest, Word32EqualToZeroWithParameters) {
TEST_P(InstructionSelectorShiftTest, Word32EqualToZeroWithImmediate) {
const Shift shift = GetParam();
TRACED_FORRANGE(int32_t, imm, shift.i_low, shift.i_high) {
- StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32);
+ StreamBuilder m(this, MachineType::Int32(), MachineType::Int32(),
+ MachineType::Int32());
m.Return(m.Word32Equal(
m.Int32Constant(0),
(m.*shift.constructor)(m.Parameter(0), m.Int32Constant(imm))));
@@ -1141,7 +1184,8 @@ TEST_P(InstructionSelectorShiftTest, Word32EqualToZeroWithImmediate) {
TEST_P(InstructionSelectorShiftTest, Word32NotWithParameters) {
const Shift shift = GetParam();
- StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32);
+ StreamBuilder m(this, MachineType::Int32(), MachineType::Int32(),
+ MachineType::Int32());
m.Return(m.Word32Not((m.*shift.constructor)(m.Parameter(0), m.Parameter(1))));
Stream s = m.Build();
ASSERT_EQ(1U, s.size());
@@ -1155,7 +1199,7 @@ TEST_P(InstructionSelectorShiftTest, Word32NotWithParameters) {
TEST_P(InstructionSelectorShiftTest, Word32NotWithImmediate) {
const Shift shift = GetParam();
TRACED_FORRANGE(int32_t, imm, shift.i_low, shift.i_high) {
- StreamBuilder m(this, kMachInt32, kMachInt32);
+ StreamBuilder m(this, MachineType::Int32(), MachineType::Int32());
m.Return(m.Word32Not(
(m.*shift.constructor)(m.Parameter(0), m.Int32Constant(imm))));
Stream s = m.Build();
@@ -1171,7 +1215,8 @@ TEST_P(InstructionSelectorShiftTest, Word32NotWithImmediate) {
TEST_P(InstructionSelectorShiftTest, Word32AndWithWord32NotWithParameters) {
const Shift shift = GetParam();
- StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32, kMachInt32);
+ StreamBuilder m(this, MachineType::Int32(), MachineType::Int32(),
+ MachineType::Int32(), MachineType::Int32());
m.Return(m.Word32And(m.Parameter(0), m.Word32Not((m.*shift.constructor)(
m.Parameter(1), m.Parameter(2)))));
Stream s = m.Build();
@@ -1186,7 +1231,8 @@ TEST_P(InstructionSelectorShiftTest, Word32AndWithWord32NotWithParameters) {
TEST_P(InstructionSelectorShiftTest, Word32AndWithWord32NotWithImmediate) {
const Shift shift = GetParam();
TRACED_FORRANGE(int32_t, imm, shift.i_low, shift.i_high) {
- StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32);
+ StreamBuilder m(this, MachineType::Int32(), MachineType::Int32(),
+ MachineType::Int32());
m.Return(m.Word32And(m.Parameter(0),
m.Word32Not((m.*shift.constructor)(
m.Parameter(1), m.Int32Constant(imm)))));
@@ -1227,49 +1273,49 @@ std::ostream& operator<<(std::ostream& os, const MemoryAccess& memacc) {
const MemoryAccess kMemoryAccesses[] = {
- {kMachInt8,
+ {MachineType::Int8(),
kArmLdrsb,
kArmStrb,
&InstructionSelectorTest::Stream::IsInteger,
{-4095, -3340, -3231, -3224, -3088, -1758, -1203, -123, -117, -91, -89,
-87, -86, -82, -44, -23, -3, 0, 7, 10, 39, 52, 69, 71, 91, 92, 107, 109,
115, 124, 286, 655, 1362, 1569, 2587, 3067, 3096, 3462, 3510, 4095}},
- {kMachUint8,
+ {MachineType::Uint8(),
kArmLdrb,
kArmStrb,
&InstructionSelectorTest::Stream::IsInteger,
{-4095, -3914, -3536, -3234, -3185, -3169, -1073, -990, -859, -720, -434,
-127, -124, -122, -105, -91, -86, -64, -55, -53, -30, -10, -3, 0, 20, 28,
39, 58, 64, 73, 75, 100, 108, 121, 686, 963, 1363, 2759, 3449, 4095}},
- {kMachInt16,
+ {MachineType::Int16(),
kArmLdrsh,
kArmStrh,
&InstructionSelectorTest::Stream::IsInteger,
{-255, -251, -232, -220, -144, -138, -130, -126, -116, -115, -102, -101,
-98, -69, -59, -56, -39, -35, -23, -19, -7, 0, 22, 26, 37, 68, 83, 87, 98,
102, 108, 111, 117, 171, 195, 203, 204, 245, 246, 255}},
- {kMachUint16,
+ {MachineType::Uint16(),
kArmLdrh,
kArmStrh,
&InstructionSelectorTest::Stream::IsInteger,
{-255, -230, -201, -172, -125, -119, -118, -105, -98, -79, -54, -42, -41,
-32, -12, -11, -5, -4, 0, 5, 9, 25, 28, 51, 58, 60, 89, 104, 108, 109,
114, 116, 120, 138, 150, 161, 166, 172, 228, 255}},
- {kMachInt32,
+ {MachineType::Int32(),
kArmLdr,
kArmStr,
&InstructionSelectorTest::Stream::IsInteger,
{-4095, -1898, -1685, -1562, -1408, -1313, -344, -128, -116, -100, -92,
-80, -72, -71, -56, -25, -21, -11, -9, 0, 3, 5, 27, 28, 42, 52, 63, 88,
93, 97, 125, 846, 1037, 2102, 2403, 2597, 2632, 2997, 3935, 4095}},
- {kMachFloat32,
+ {MachineType::Float32(),
kArmVldrF32,
kArmVstrF32,
&InstructionSelectorTest::Stream::IsDouble,
{-1020, -928, -896, -772, -728, -680, -660, -488, -372, -112, -100, -92,
-84, -80, -72, -64, -60, -56, -52, -48, -36, -32, -20, -8, -4, 0, 8, 20,
24, 40, 64, 112, 204, 388, 516, 852, 856, 976, 988, 1020}},
- {kMachFloat64,
+ {MachineType::Float64(),
kArmVldrF64,
kArmVstrF64,
&InstructionSelectorTest::Stream::IsDouble,
@@ -1286,7 +1332,8 @@ typedef InstructionSelectorTestWithParam<MemoryAccess>
TEST_P(InstructionSelectorMemoryAccessTest, LoadWithParameters) {
const MemoryAccess memacc = GetParam();
- StreamBuilder m(this, memacc.type, kMachPtr, kMachInt32);
+ StreamBuilder m(this, memacc.type, MachineType::Pointer(),
+ MachineType::Int32());
m.Return(m.Load(memacc.type, m.Parameter(0), m.Parameter(1)));
Stream s = m.Build();
ASSERT_EQ(1U, s.size());
@@ -1301,7 +1348,7 @@ TEST_P(InstructionSelectorMemoryAccessTest, LoadWithParameters) {
TEST_P(InstructionSelectorMemoryAccessTest, LoadWithImmediateIndex) {
const MemoryAccess memacc = GetParam();
TRACED_FOREACH(int32_t, index, memacc.immediates) {
- StreamBuilder m(this, memacc.type, kMachPtr);
+ StreamBuilder m(this, memacc.type, MachineType::Pointer());
m.Return(m.Load(memacc.type, m.Parameter(0), m.Int32Constant(index)));
Stream s = m.Build();
ASSERT_EQ(1U, s.size());
@@ -1318,7 +1365,8 @@ TEST_P(InstructionSelectorMemoryAccessTest, LoadWithImmediateIndex) {
TEST_P(InstructionSelectorMemoryAccessTest, StoreWithParameters) {
const MemoryAccess memacc = GetParam();
- StreamBuilder m(this, kMachInt32, kMachPtr, kMachInt32, memacc.type);
+ StreamBuilder m(this, MachineType::Int32(), MachineType::Pointer(),
+ MachineType::Int32(), memacc.type);
m.Store(memacc.type, m.Parameter(0), m.Parameter(1), m.Parameter(2),
kNoWriteBarrier);
m.Return(m.Int32Constant(0));
@@ -1334,7 +1382,8 @@ TEST_P(InstructionSelectorMemoryAccessTest, StoreWithParameters) {
TEST_P(InstructionSelectorMemoryAccessTest, StoreWithImmediateIndex) {
const MemoryAccess memacc = GetParam();
TRACED_FOREACH(int32_t, index, memacc.immediates) {
- StreamBuilder m(this, kMachInt32, kMachPtr, memacc.type);
+ StreamBuilder m(this, MachineType::Int32(), MachineType::Pointer(),
+ memacc.type);
m.Store(memacc.type, m.Parameter(0), m.Int32Constant(index), m.Parameter(1),
kNoWriteBarrier);
m.Return(m.Int32Constant(0));
@@ -1360,7 +1409,7 @@ INSTANTIATE_TEST_CASE_P(InstructionSelectorTest,
TEST_F(InstructionSelectorTest, ChangeFloat32ToFloat64WithParameter) {
- StreamBuilder m(this, kMachFloat64, kMachFloat32);
+ StreamBuilder m(this, MachineType::Float64(), MachineType::Float32());
m.Return(m.ChangeFloat32ToFloat64(m.Parameter(0)));
Stream s = m.Build();
ASSERT_EQ(1U, s.size());
@@ -1371,7 +1420,7 @@ TEST_F(InstructionSelectorTest, ChangeFloat32ToFloat64WithParameter) {
TEST_F(InstructionSelectorTest, TruncateFloat64ToFloat32WithParameter) {
- StreamBuilder m(this, kMachFloat32, kMachFloat64);
+ StreamBuilder m(this, MachineType::Float32(), MachineType::Float64());
m.Return(m.TruncateFloat64ToFloat32(m.Parameter(0)));
Stream s = m.Build();
ASSERT_EQ(1U, s.size());
@@ -1423,7 +1472,8 @@ typedef InstructionSelectorTestWithParam<Comparison>
TEST_P(InstructionSelectorComparisonTest, Parameters) {
const Comparison& cmp = GetParam();
- StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32);
+ StreamBuilder m(this, MachineType::Int32(), MachineType::Int32(),
+ MachineType::Int32());
Node* const p0 = m.Parameter(0);
Node* const p1 = m.Parameter(1);
Node* const r = (m.*cmp.constructor)(p0, p1);
@@ -1445,7 +1495,8 @@ TEST_P(InstructionSelectorComparisonTest, Parameters) {
TEST_P(InstructionSelectorComparisonTest, Word32EqualWithZero) {
{
const Comparison& cmp = GetParam();
- StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32);
+ StreamBuilder m(this, MachineType::Int32(), MachineType::Int32(),
+ MachineType::Int32());
Node* const p0 = m.Parameter(0);
Node* const p1 = m.Parameter(1);
Node* const r =
@@ -1465,7 +1516,8 @@ TEST_P(InstructionSelectorComparisonTest, Word32EqualWithZero) {
}
{
const Comparison& cmp = GetParam();
- StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32);
+ StreamBuilder m(this, MachineType::Int32(), MachineType::Int32(),
+ MachineType::Int32());
Node* const p0 = m.Parameter(0);
Node* const p1 = m.Parameter(1);
Node* const r =
@@ -1514,7 +1566,8 @@ typedef InstructionSelectorTestWithParam<Comparison>
TEST_P(InstructionSelectorF32ComparisonTest, WithParameters) {
const Comparison& cmp = GetParam();
- StreamBuilder m(this, kMachInt32, kMachFloat32, kMachFloat32);
+ StreamBuilder m(this, MachineType::Int32(), MachineType::Float32(),
+ MachineType::Float32());
m.Return((m.*cmp.constructor)(m.Parameter(0), m.Parameter(1)));
Stream const s = m.Build();
ASSERT_EQ(1U, s.size());
@@ -1528,7 +1581,8 @@ TEST_P(InstructionSelectorF32ComparisonTest, WithParameters) {
TEST_P(InstructionSelectorF32ComparisonTest, NegatedWithParameters) {
const Comparison& cmp = GetParam();
- StreamBuilder m(this, kMachInt32, kMachFloat32, kMachFloat32);
+ StreamBuilder m(this, MachineType::Int32(), MachineType::Float32(),
+ MachineType::Float32());
m.Return(
m.WordBinaryNot((m.*cmp.constructor)(m.Parameter(0), m.Parameter(1))));
Stream const s = m.Build();
@@ -1543,7 +1597,7 @@ TEST_P(InstructionSelectorF32ComparisonTest, NegatedWithParameters) {
TEST_P(InstructionSelectorF32ComparisonTest, WithImmediateZeroOnRight) {
const Comparison& cmp = GetParam();
- StreamBuilder m(this, kMachInt32, kMachFloat32);
+ StreamBuilder m(this, MachineType::Int32(), MachineType::Float32());
m.Return((m.*cmp.constructor)(m.Parameter(0), m.Float32Constant(0.0)));
Stream const s = m.Build();
ASSERT_EQ(1U, s.size());
@@ -1558,7 +1612,7 @@ TEST_P(InstructionSelectorF32ComparisonTest, WithImmediateZeroOnRight) {
TEST_P(InstructionSelectorF32ComparisonTest, WithImmediateZeroOnLeft) {
const Comparison& cmp = GetParam();
- StreamBuilder m(this, kMachInt32, kMachFloat32);
+ StreamBuilder m(this, MachineType::Int32(), MachineType::Float32());
m.Return((m.*cmp.constructor)(m.Float32Constant(0.0f), m.Parameter(0)));
Stream const s = m.Build();
ASSERT_EQ(1U, s.size());
@@ -1595,7 +1649,8 @@ typedef InstructionSelectorTestWithParam<Comparison>
TEST_P(InstructionSelectorF64ComparisonTest, WithParameters) {
const Comparison& cmp = GetParam();
- StreamBuilder m(this, kMachInt32, kMachFloat64, kMachFloat64);
+ StreamBuilder m(this, MachineType::Int32(), MachineType::Float64(),
+ MachineType::Float64());
m.Return((m.*cmp.constructor)(m.Parameter(0), m.Parameter(1)));
Stream const s = m.Build();
ASSERT_EQ(1U, s.size());
@@ -1609,7 +1664,8 @@ TEST_P(InstructionSelectorF64ComparisonTest, WithParameters) {
TEST_P(InstructionSelectorF64ComparisonTest, NegatedWithParameters) {
const Comparison& cmp = GetParam();
- StreamBuilder m(this, kMachInt32, kMachFloat64, kMachFloat64);
+ StreamBuilder m(this, MachineType::Int32(), MachineType::Float64(),
+ MachineType::Float64());
m.Return(
m.WordBinaryNot((m.*cmp.constructor)(m.Parameter(0), m.Parameter(1))));
Stream const s = m.Build();
@@ -1624,7 +1680,7 @@ TEST_P(InstructionSelectorF64ComparisonTest, NegatedWithParameters) {
TEST_P(InstructionSelectorF64ComparisonTest, WithImmediateZeroOnRight) {
const Comparison& cmp = GetParam();
- StreamBuilder m(this, kMachInt32, kMachFloat64);
+ StreamBuilder m(this, MachineType::Int32(), MachineType::Float64());
m.Return((m.*cmp.constructor)(m.Parameter(0), m.Float64Constant(0.0)));
Stream const s = m.Build();
ASSERT_EQ(1U, s.size());
@@ -1639,7 +1695,7 @@ TEST_P(InstructionSelectorF64ComparisonTest, WithImmediateZeroOnRight) {
TEST_P(InstructionSelectorF64ComparisonTest, WithImmediateZeroOnLeft) {
const Comparison& cmp = GetParam();
- StreamBuilder m(this, kMachInt32, kMachFloat64);
+ StreamBuilder m(this, MachineType::Int32(), MachineType::Float64());
m.Return((m.*cmp.constructor)(m.Float64Constant(0.0), m.Parameter(0)));
Stream const s = m.Build();
ASSERT_EQ(1U, s.size());
@@ -1689,7 +1745,7 @@ INSTANTIATE_TEST_CASE_P(InstructionSelectorTest, InstructionSelectorFAITest,
TEST_F(InstructionSelectorTest, Float32Abs) {
- StreamBuilder m(this, kMachFloat32, kMachFloat32);
+ StreamBuilder m(this, MachineType::Float32(), MachineType::Float32());
Node* const p0 = m.Parameter(0);
Node* const n = m.Float32Abs(p0);
m.Return(n);
@@ -1704,7 +1760,7 @@ TEST_F(InstructionSelectorTest, Float32Abs) {
TEST_F(InstructionSelectorTest, Float64Abs) {
- StreamBuilder m(this, kMachFloat64, kMachFloat64);
+ StreamBuilder m(this, MachineType::Float64(), MachineType::Float64());
Node* const p0 = m.Parameter(0);
Node* const n = m.Float64Abs(p0);
m.Return(n);
@@ -1720,8 +1776,8 @@ TEST_F(InstructionSelectorTest, Float64Abs) {
TEST_F(InstructionSelectorTest, Float32AddWithFloat32Mul) {
{
- StreamBuilder m(this, kMachFloat32, kMachFloat32, kMachFloat32,
- kMachFloat32);
+ StreamBuilder m(this, MachineType::Float32(), MachineType::Float32(),
+ MachineType::Float32(), MachineType::Float32());
Node* const p0 = m.Parameter(0);
Node* const p1 = m.Parameter(1);
Node* const p2 = m.Parameter(2);
@@ -1741,8 +1797,8 @@ TEST_F(InstructionSelectorTest, Float32AddWithFloat32Mul) {
EXPECT_EQ(kFlags_none, s[0]->flags_mode());
}
{
- StreamBuilder m(this, kMachFloat32, kMachFloat32, kMachFloat32,
- kMachFloat32);
+ StreamBuilder m(this, MachineType::Float32(), MachineType::Float32(),
+ MachineType::Float32(), MachineType::Float32());
Node* const p0 = m.Parameter(0);
Node* const p1 = m.Parameter(1);
Node* const p2 = m.Parameter(2);
@@ -1766,8 +1822,8 @@ TEST_F(InstructionSelectorTest, Float32AddWithFloat32Mul) {
TEST_F(InstructionSelectorTest, Float64AddWithFloat64Mul) {
{
- StreamBuilder m(this, kMachFloat64, kMachFloat64, kMachFloat64,
- kMachFloat64);
+ StreamBuilder m(this, MachineType::Float64(), MachineType::Float64(),
+ MachineType::Float64(), MachineType::Float64());
Node* const p0 = m.Parameter(0);
Node* const p1 = m.Parameter(1);
Node* const p2 = m.Parameter(2);
@@ -1787,8 +1843,8 @@ TEST_F(InstructionSelectorTest, Float64AddWithFloat64Mul) {
EXPECT_EQ(kFlags_none, s[0]->flags_mode());
}
{
- StreamBuilder m(this, kMachFloat64, kMachFloat64, kMachFloat64,
- kMachFloat64);
+ StreamBuilder m(this, MachineType::Float64(), MachineType::Float64(),
+ MachineType::Float64(), MachineType::Float64());
Node* const p0 = m.Parameter(0);
Node* const p1 = m.Parameter(1);
Node* const p2 = m.Parameter(2);
@@ -1811,7 +1867,7 @@ TEST_F(InstructionSelectorTest, Float64AddWithFloat64Mul) {
TEST_F(InstructionSelectorTest, Float32SubWithMinusZero) {
- StreamBuilder m(this, kMachFloat32, kMachFloat32);
+ StreamBuilder m(this, MachineType::Float32(), MachineType::Float32());
Node* const p0 = m.Parameter(0);
Node* const n = m.Float32Sub(m.Float32Constant(-0.0f), p0);
m.Return(n);
@@ -1826,7 +1882,7 @@ TEST_F(InstructionSelectorTest, Float32SubWithMinusZero) {
TEST_F(InstructionSelectorTest, Float64SubWithMinusZero) {
- StreamBuilder m(this, kMachFloat64, kMachFloat64);
+ StreamBuilder m(this, MachineType::Float64(), MachineType::Float64());
Node* const p0 = m.Parameter(0);
Node* const n = m.Float64Sub(m.Float64Constant(-0.0), p0);
m.Return(n);
@@ -1841,7 +1897,8 @@ TEST_F(InstructionSelectorTest, Float64SubWithMinusZero) {
TEST_F(InstructionSelectorTest, Float32SubWithFloat32Mul) {
- StreamBuilder m(this, kMachFloat32, kMachFloat32, kMachFloat32, kMachFloat32);
+ StreamBuilder m(this, MachineType::Float32(), MachineType::Float32(),
+ MachineType::Float32(), MachineType::Float32());
Node* const p0 = m.Parameter(0);
Node* const p1 = m.Parameter(1);
Node* const p2 = m.Parameter(2);
@@ -1862,7 +1919,8 @@ TEST_F(InstructionSelectorTest, Float32SubWithFloat32Mul) {
TEST_F(InstructionSelectorTest, Float64SubWithFloat64Mul) {
- StreamBuilder m(this, kMachFloat64, kMachFloat64, kMachFloat64, kMachFloat64);
+ StreamBuilder m(this, MachineType::Float64(), MachineType::Float64(),
+ MachineType::Float64(), MachineType::Float64());
Node* const p0 = m.Parameter(0);
Node* const p1 = m.Parameter(1);
Node* const p2 = m.Parameter(2);
@@ -1883,7 +1941,7 @@ TEST_F(InstructionSelectorTest, Float64SubWithFloat64Mul) {
TEST_F(InstructionSelectorTest, Float32Sqrt) {
- StreamBuilder m(this, kMachFloat32, kMachFloat32);
+ StreamBuilder m(this, MachineType::Float32(), MachineType::Float32());
Node* const p0 = m.Parameter(0);
Node* const n = m.Float32Sqrt(p0);
m.Return(n);
@@ -1899,7 +1957,7 @@ TEST_F(InstructionSelectorTest, Float32Sqrt) {
TEST_F(InstructionSelectorTest, Float64Sqrt) {
- StreamBuilder m(this, kMachFloat64, kMachFloat64);
+ StreamBuilder m(this, MachineType::Float64(), MachineType::Float64());
Node* const p0 = m.Parameter(0);
Node* const n = m.Float64Sqrt(p0);
m.Return(n);
@@ -1920,7 +1978,8 @@ TEST_F(InstructionSelectorTest, Float64Sqrt) {
TEST_F(InstructionSelectorTest, Int32AddWithInt32Mul) {
{
- StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32, kMachInt32);
+ StreamBuilder m(this, MachineType::Int32(), MachineType::Int32(),
+ MachineType::Int32(), MachineType::Int32());
Node* const p0 = m.Parameter(0);
Node* const p1 = m.Parameter(1);
Node* const p2 = m.Parameter(2);
@@ -1937,7 +1996,8 @@ TEST_F(InstructionSelectorTest, Int32AddWithInt32Mul) {
EXPECT_EQ(s.ToVreg(n), s.ToVreg(s[0]->Output()));
}
{
- StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32, kMachInt32);
+ StreamBuilder m(this, MachineType::Int32(), MachineType::Int32(),
+ MachineType::Int32(), MachineType::Int32());
Node* const p0 = m.Parameter(0);
Node* const p1 = m.Parameter(1);
Node* const p2 = m.Parameter(2);
@@ -1958,7 +2018,8 @@ TEST_F(InstructionSelectorTest, Int32AddWithInt32Mul) {
TEST_F(InstructionSelectorTest, Int32AddWithInt32MulHigh) {
{
- StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32, kMachInt32);
+ StreamBuilder m(this, MachineType::Int32(), MachineType::Int32(),
+ MachineType::Int32(), MachineType::Int32());
Node* const p0 = m.Parameter(0);
Node* const p1 = m.Parameter(1);
Node* const p2 = m.Parameter(2);
@@ -1975,7 +2036,8 @@ TEST_F(InstructionSelectorTest, Int32AddWithInt32MulHigh) {
EXPECT_EQ(s.ToVreg(n), s.ToVreg(s[0]->Output()));
}
{
- StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32, kMachInt32);
+ StreamBuilder m(this, MachineType::Int32(), MachineType::Int32(),
+ MachineType::Int32(), MachineType::Int32());
Node* const p0 = m.Parameter(0);
Node* const p1 = m.Parameter(1);
Node* const p2 = m.Parameter(2);
@@ -1996,7 +2058,8 @@ TEST_F(InstructionSelectorTest, Int32AddWithInt32MulHigh) {
TEST_F(InstructionSelectorTest, Int32AddWithWord32And) {
{
- StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32);
+ StreamBuilder m(this, MachineType::Int32(), MachineType::Int32(),
+ MachineType::Int32());
Node* const p0 = m.Parameter(0);
Node* const p1 = m.Parameter(1);
Node* const r = m.Int32Add(m.Word32And(p0, m.Int32Constant(0xff)), p1);
@@ -2012,7 +2075,8 @@ TEST_F(InstructionSelectorTest, Int32AddWithWord32And) {
EXPECT_EQ(s.ToVreg(r), s.ToVreg(s[0]->Output()));
}
{
- StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32);
+ StreamBuilder m(this, MachineType::Int32(), MachineType::Int32(),
+ MachineType::Int32());
Node* const p0 = m.Parameter(0);
Node* const p1 = m.Parameter(1);
Node* const r = m.Int32Add(p1, m.Word32And(p0, m.Int32Constant(0xff)));
@@ -2028,7 +2092,8 @@ TEST_F(InstructionSelectorTest, Int32AddWithWord32And) {
EXPECT_EQ(s.ToVreg(r), s.ToVreg(s[0]->Output()));
}
{
- StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32);
+ StreamBuilder m(this, MachineType::Int32(), MachineType::Int32(),
+ MachineType::Int32());
Node* const p0 = m.Parameter(0);
Node* const p1 = m.Parameter(1);
Node* const r = m.Int32Add(m.Word32And(p0, m.Int32Constant(0xffff)), p1);
@@ -2044,7 +2109,8 @@ TEST_F(InstructionSelectorTest, Int32AddWithWord32And) {
EXPECT_EQ(s.ToVreg(r), s.ToVreg(s[0]->Output()));
}
{
- StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32);
+ StreamBuilder m(this, MachineType::Int32(), MachineType::Int32(),
+ MachineType::Int32());
Node* const p0 = m.Parameter(0);
Node* const p1 = m.Parameter(1);
Node* const r = m.Int32Add(p1, m.Word32And(p0, m.Int32Constant(0xffff)));
@@ -2064,7 +2130,8 @@ TEST_F(InstructionSelectorTest, Int32AddWithWord32And) {
TEST_F(InstructionSelectorTest, Int32AddWithWord32SarWithWord32Shl) {
{
- StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32);
+ StreamBuilder m(this, MachineType::Int32(), MachineType::Int32(),
+ MachineType::Int32());
Node* const p0 = m.Parameter(0);
Node* const p1 = m.Parameter(1);
Node* const r = m.Int32Add(
@@ -2082,7 +2149,8 @@ TEST_F(InstructionSelectorTest, Int32AddWithWord32SarWithWord32Shl) {
EXPECT_EQ(s.ToVreg(r), s.ToVreg(s[0]->Output()));
}
{
- StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32);
+ StreamBuilder m(this, MachineType::Int32(), MachineType::Int32(),
+ MachineType::Int32());
Node* const p0 = m.Parameter(0);
Node* const p1 = m.Parameter(1);
Node* const r = m.Int32Add(
@@ -2100,7 +2168,8 @@ TEST_F(InstructionSelectorTest, Int32AddWithWord32SarWithWord32Shl) {
EXPECT_EQ(s.ToVreg(r), s.ToVreg(s[0]->Output()));
}
{
- StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32);
+ StreamBuilder m(this, MachineType::Int32(), MachineType::Int32(),
+ MachineType::Int32());
Node* const p0 = m.Parameter(0);
Node* const p1 = m.Parameter(1);
Node* const r = m.Int32Add(
@@ -2118,7 +2187,8 @@ TEST_F(InstructionSelectorTest, Int32AddWithWord32SarWithWord32Shl) {
EXPECT_EQ(s.ToVreg(r), s.ToVreg(s[0]->Output()));
}
{
- StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32);
+ StreamBuilder m(this, MachineType::Int32(), MachineType::Int32(),
+ MachineType::Int32());
Node* const p0 = m.Parameter(0);
Node* const p1 = m.Parameter(1);
Node* const r = m.Int32Add(
@@ -2139,7 +2209,8 @@ TEST_F(InstructionSelectorTest, Int32AddWithWord32SarWithWord32Shl) {
TEST_F(InstructionSelectorTest, Int32SubWithInt32Mul) {
- StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32, kMachInt32);
+ StreamBuilder m(this, MachineType::Int32(), MachineType::Int32(),
+ MachineType::Int32(), MachineType::Int32());
m.Return(
m.Int32Sub(m.Parameter(0), m.Int32Mul(m.Parameter(1), m.Parameter(2))));
Stream s = m.Build();
@@ -2153,7 +2224,8 @@ TEST_F(InstructionSelectorTest, Int32SubWithInt32Mul) {
TEST_F(InstructionSelectorTest, Int32SubWithInt32MulForMLS) {
- StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32, kMachInt32);
+ StreamBuilder m(this, MachineType::Int32(), MachineType::Int32(),
+ MachineType::Int32(), MachineType::Int32());
m.Return(
m.Int32Sub(m.Parameter(0), m.Int32Mul(m.Parameter(1), m.Parameter(2))));
Stream s = m.Build(MLS);
@@ -2165,7 +2237,8 @@ TEST_F(InstructionSelectorTest, Int32SubWithInt32MulForMLS) {
TEST_F(InstructionSelectorTest, Int32DivWithParameters) {
- StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32);
+ StreamBuilder m(this, MachineType::Int32(), MachineType::Int32(),
+ MachineType::Int32());
m.Return(m.Int32Div(m.Parameter(0), m.Parameter(1)));
Stream s = m.Build();
ASSERT_EQ(4U, s.size());
@@ -2185,7 +2258,8 @@ TEST_F(InstructionSelectorTest, Int32DivWithParameters) {
TEST_F(InstructionSelectorTest, Int32DivWithParametersForSUDIV) {
- StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32);
+ StreamBuilder m(this, MachineType::Int32(), MachineType::Int32(),
+ MachineType::Int32());
m.Return(m.Int32Div(m.Parameter(0), m.Parameter(1)));
Stream s = m.Build(SUDIV);
ASSERT_EQ(1U, s.size());
@@ -2194,7 +2268,8 @@ TEST_F(InstructionSelectorTest, Int32DivWithParametersForSUDIV) {
TEST_F(InstructionSelectorTest, Int32ModWithParameters) {
- StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32);
+ StreamBuilder m(this, MachineType::Int32(), MachineType::Int32(),
+ MachineType::Int32());
m.Return(m.Int32Mod(m.Parameter(0), m.Parameter(1)));
Stream s = m.Build();
ASSERT_EQ(6U, s.size());
@@ -2224,7 +2299,8 @@ TEST_F(InstructionSelectorTest, Int32ModWithParameters) {
TEST_F(InstructionSelectorTest, Int32ModWithParametersForSUDIV) {
- StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32);
+ StreamBuilder m(this, MachineType::Int32(), MachineType::Int32(),
+ MachineType::Int32());
m.Return(m.Int32Mod(m.Parameter(0), m.Parameter(1)));
Stream s = m.Build(SUDIV);
ASSERT_EQ(3U, s.size());
@@ -2245,7 +2321,8 @@ TEST_F(InstructionSelectorTest, Int32ModWithParametersForSUDIV) {
TEST_F(InstructionSelectorTest, Int32ModWithParametersForSUDIVAndMLS) {
- StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32);
+ StreamBuilder m(this, MachineType::Int32(), MachineType::Int32(),
+ MachineType::Int32());
m.Return(m.Int32Mod(m.Parameter(0), m.Parameter(1)));
Stream s = m.Build(MLS, SUDIV);
ASSERT_EQ(2U, s.size());
@@ -2262,7 +2339,8 @@ TEST_F(InstructionSelectorTest, Int32ModWithParametersForSUDIVAndMLS) {
TEST_F(InstructionSelectorTest, Int32MulWithParameters) {
- StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32);
+ StreamBuilder m(this, MachineType::Int32(), MachineType::Int32(),
+ MachineType::Int32());
m.Return(m.Int32Mul(m.Parameter(0), m.Parameter(1)));
Stream s = m.Build();
ASSERT_EQ(1U, s.size());
@@ -2275,7 +2353,7 @@ TEST_F(InstructionSelectorTest, Int32MulWithParameters) {
TEST_F(InstructionSelectorTest, Int32MulWithImmediate) {
// x * (2^k + 1) -> x + (x >> k)
TRACED_FORRANGE(int32_t, k, 1, 30) {
- StreamBuilder m(this, kMachInt32, kMachInt32);
+ StreamBuilder m(this, MachineType::Int32(), MachineType::Int32());
m.Return(m.Int32Mul(m.Parameter(0), m.Int32Constant((1 << k) + 1)));
Stream s = m.Build();
ASSERT_EQ(1U, s.size());
@@ -2288,7 +2366,7 @@ TEST_F(InstructionSelectorTest, Int32MulWithImmediate) {
}
// x * (2^k - 1) -> -x + (x >> k)
TRACED_FORRANGE(int32_t, k, 3, 30) {
- StreamBuilder m(this, kMachInt32, kMachInt32);
+ StreamBuilder m(this, MachineType::Int32(), MachineType::Int32());
m.Return(m.Int32Mul(m.Parameter(0), m.Int32Constant((1 << k) - 1)));
Stream s = m.Build();
ASSERT_EQ(1U, s.size());
@@ -2301,7 +2379,7 @@ TEST_F(InstructionSelectorTest, Int32MulWithImmediate) {
}
// (2^k + 1) * x -> x + (x >> k)
TRACED_FORRANGE(int32_t, k, 1, 30) {
- StreamBuilder m(this, kMachInt32, kMachInt32);
+ StreamBuilder m(this, MachineType::Int32(), MachineType::Int32());
m.Return(m.Int32Mul(m.Int32Constant((1 << k) + 1), m.Parameter(0)));
Stream s = m.Build();
ASSERT_EQ(1U, s.size());
@@ -2314,7 +2392,7 @@ TEST_F(InstructionSelectorTest, Int32MulWithImmediate) {
}
// x * (2^k - 1) -> -x + (x >> k)
TRACED_FORRANGE(int32_t, k, 3, 30) {
- StreamBuilder m(this, kMachInt32, kMachInt32);
+ StreamBuilder m(this, MachineType::Int32(), MachineType::Int32());
m.Return(m.Int32Mul(m.Int32Constant((1 << k) - 1), m.Parameter(0)));
Stream s = m.Build();
ASSERT_EQ(1U, s.size());
@@ -2329,7 +2407,8 @@ TEST_F(InstructionSelectorTest, Int32MulWithImmediate) {
TEST_F(InstructionSelectorTest, Int32MulHighWithParameters) {
- StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32);
+ StreamBuilder m(this, MachineType::Int32(), MachineType::Int32(),
+ MachineType::Int32());
Node* const p0 = m.Parameter(0);
Node* const p1 = m.Parameter(1);
Node* const n = m.Int32MulHigh(p0, p1);
@@ -2346,7 +2425,8 @@ TEST_F(InstructionSelectorTest, Int32MulHighWithParameters) {
TEST_F(InstructionSelectorTest, Uint32MulHighWithParameters) {
- StreamBuilder m(this, kMachUint32, kMachUint32, kMachUint32);
+ StreamBuilder m(this, MachineType::Uint32(), MachineType::Uint32(),
+ MachineType::Uint32());
Node* const p0 = m.Parameter(0);
Node* const p1 = m.Parameter(1);
Node* const n = m.Uint32MulHigh(p0, p1);
@@ -2363,7 +2443,8 @@ TEST_F(InstructionSelectorTest, Uint32MulHighWithParameters) {
TEST_F(InstructionSelectorTest, Uint32DivWithParameters) {
- StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32);
+ StreamBuilder m(this, MachineType::Int32(), MachineType::Int32(),
+ MachineType::Int32());
m.Return(m.Uint32Div(m.Parameter(0), m.Parameter(1)));
Stream s = m.Build();
ASSERT_EQ(4U, s.size());
@@ -2383,7 +2464,8 @@ TEST_F(InstructionSelectorTest, Uint32DivWithParameters) {
TEST_F(InstructionSelectorTest, Uint32DivWithParametersForSUDIV) {
- StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32);
+ StreamBuilder m(this, MachineType::Int32(), MachineType::Int32(),
+ MachineType::Int32());
m.Return(m.Uint32Div(m.Parameter(0), m.Parameter(1)));
Stream s = m.Build(SUDIV);
ASSERT_EQ(1U, s.size());
@@ -2392,7 +2474,8 @@ TEST_F(InstructionSelectorTest, Uint32DivWithParametersForSUDIV) {
TEST_F(InstructionSelectorTest, Uint32ModWithParameters) {
- StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32);
+ StreamBuilder m(this, MachineType::Int32(), MachineType::Int32(),
+ MachineType::Int32());
m.Return(m.Uint32Mod(m.Parameter(0), m.Parameter(1)));
Stream s = m.Build();
ASSERT_EQ(6U, s.size());
@@ -2422,7 +2505,8 @@ TEST_F(InstructionSelectorTest, Uint32ModWithParameters) {
TEST_F(InstructionSelectorTest, Uint32ModWithParametersForSUDIV) {
- StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32);
+ StreamBuilder m(this, MachineType::Int32(), MachineType::Int32(),
+ MachineType::Int32());
m.Return(m.Uint32Mod(m.Parameter(0), m.Parameter(1)));
Stream s = m.Build(SUDIV);
ASSERT_EQ(3U, s.size());
@@ -2443,7 +2527,8 @@ TEST_F(InstructionSelectorTest, Uint32ModWithParametersForSUDIV) {
TEST_F(InstructionSelectorTest, Uint32ModWithParametersForSUDIVAndMLS) {
- StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32);
+ StreamBuilder m(this, MachineType::Int32(), MachineType::Int32(),
+ MachineType::Int32());
m.Return(m.Uint32Mod(m.Parameter(0), m.Parameter(1)));
Stream s = m.Build(MLS, SUDIV);
ASSERT_EQ(2U, s.size());
@@ -2461,7 +2546,7 @@ TEST_F(InstructionSelectorTest, Uint32ModWithParametersForSUDIVAndMLS) {
TEST_F(InstructionSelectorTest, Word32AndWithUbfxImmediateForARMv7) {
TRACED_FORRANGE(int32_t, width, 1, 32) {
- StreamBuilder m(this, kMachInt32, kMachInt32);
+ StreamBuilder m(this, MachineType::Int32(), MachineType::Int32());
m.Return(m.Word32And(m.Parameter(0),
m.Int32Constant(0xffffffffu >> (32 - width))));
Stream s = m.Build(ARMv7);
@@ -2472,7 +2557,7 @@ TEST_F(InstructionSelectorTest, Word32AndWithUbfxImmediateForARMv7) {
EXPECT_EQ(width, s.ToInt32(s[0]->InputAt(2)));
}
TRACED_FORRANGE(int32_t, width, 1, 32) {
- StreamBuilder m(this, kMachInt32, kMachInt32);
+ StreamBuilder m(this, MachineType::Int32(), MachineType::Int32());
m.Return(m.Word32And(m.Int32Constant(0xffffffffu >> (32 - width)),
m.Parameter(0)));
Stream s = m.Build(ARMv7);
@@ -2488,7 +2573,7 @@ TEST_F(InstructionSelectorTest, Word32AndWithUbfxImmediateForARMv7) {
TEST_F(InstructionSelectorTest, Word32AndWithBfcImmediateForARMv7) {
TRACED_FORRANGE(int32_t, lsb, 0, 31) {
TRACED_FORRANGE(int32_t, width, 9, (32 - lsb) - 1) {
- StreamBuilder m(this, kMachInt32, kMachInt32);
+ StreamBuilder m(this, MachineType::Int32(), MachineType::Int32());
m.Return(m.Word32And(
m.Parameter(0),
m.Int32Constant(~((0xffffffffu >> (32 - width)) << lsb))));
@@ -2505,7 +2590,7 @@ TEST_F(InstructionSelectorTest, Word32AndWithBfcImmediateForARMv7) {
}
TRACED_FORRANGE(int32_t, lsb, 0, 31) {
TRACED_FORRANGE(int32_t, width, 9, (32 - lsb) - 1) {
- StreamBuilder m(this, kMachInt32, kMachInt32);
+ StreamBuilder m(this, MachineType::Int32(), MachineType::Int32());
m.Return(
m.Word32And(m.Int32Constant(~((0xffffffffu >> (32 - width)) << lsb)),
m.Parameter(0)));
@@ -2525,7 +2610,7 @@ TEST_F(InstructionSelectorTest, Word32AndWithBfcImmediateForARMv7) {
TEST_F(InstructionSelectorTest, Word32AndWith0xffff) {
{
- StreamBuilder m(this, kMachInt32, kMachInt32);
+ StreamBuilder m(this, MachineType::Int32(), MachineType::Int32());
Node* const p0 = m.Parameter(0);
Node* const r = m.Word32And(p0, m.Int32Constant(0xffff));
m.Return(r);
@@ -2539,7 +2624,7 @@ TEST_F(InstructionSelectorTest, Word32AndWith0xffff) {
EXPECT_EQ(s.ToVreg(r), s.ToVreg(s[0]->Output()));
}
{
- StreamBuilder m(this, kMachInt32, kMachInt32);
+ StreamBuilder m(this, MachineType::Int32(), MachineType::Int32());
Node* const p0 = m.Parameter(0);
Node* const r = m.Word32And(m.Int32Constant(0xffff), p0);
m.Return(r);
@@ -2557,7 +2642,7 @@ TEST_F(InstructionSelectorTest, Word32AndWith0xffff) {
TEST_F(InstructionSelectorTest, Word32SarWithWord32Shl) {
{
- StreamBuilder m(this, kMachInt32, kMachInt32);
+ StreamBuilder m(this, MachineType::Int32(), MachineType::Int32());
Node* const p0 = m.Parameter(0);
Node* const r =
m.Word32Sar(m.Word32Shl(p0, m.Int32Constant(24)), m.Int32Constant(24));
@@ -2572,7 +2657,7 @@ TEST_F(InstructionSelectorTest, Word32SarWithWord32Shl) {
EXPECT_EQ(s.ToVreg(r), s.ToVreg(s[0]->Output()));
}
{
- StreamBuilder m(this, kMachInt32, kMachInt32);
+ StreamBuilder m(this, MachineType::Int32(), MachineType::Int32());
Node* const p0 = m.Parameter(0);
Node* const r =
m.Word32Sar(m.Word32Shl(p0, m.Int32Constant(16)), m.Int32Constant(16));
@@ -2596,7 +2681,7 @@ TEST_F(InstructionSelectorTest, Word32ShrWithWord32AndWithImmediateForARMv7) {
if (max > static_cast<uint32_t>(kMaxInt)) max -= 1;
uint32_t jnk = rng()->NextInt(max);
uint32_t msk = ((0xffffffffu >> (32 - width)) << lsb) | jnk;
- StreamBuilder m(this, kMachInt32, kMachInt32);
+ StreamBuilder m(this, MachineType::Int32(), MachineType::Int32());
m.Return(m.Word32Shr(m.Word32And(m.Parameter(0), m.Int32Constant(msk)),
m.Int32Constant(lsb)));
Stream s = m.Build(ARMv7);
@@ -2613,7 +2698,7 @@ TEST_F(InstructionSelectorTest, Word32ShrWithWord32AndWithImmediateForARMv7) {
if (max > static_cast<uint32_t>(kMaxInt)) max -= 1;
uint32_t jnk = rng()->NextInt(max);
uint32_t msk = ((0xffffffffu >> (32 - width)) << lsb) | jnk;
- StreamBuilder m(this, kMachInt32, kMachInt32);
+ StreamBuilder m(this, MachineType::Int32(), MachineType::Int32());
m.Return(m.Word32Shr(m.Word32And(m.Int32Constant(msk), m.Parameter(0)),
m.Int32Constant(lsb)));
Stream s = m.Build(ARMv7);
@@ -2629,7 +2714,8 @@ TEST_F(InstructionSelectorTest, Word32ShrWithWord32AndWithImmediateForARMv7) {
TEST_F(InstructionSelectorTest, Word32AndWithWord32Not) {
{
- StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32);
+ StreamBuilder m(this, MachineType::Int32(), MachineType::Int32(),
+ MachineType::Int32());
m.Return(m.Word32And(m.Parameter(0), m.Word32Not(m.Parameter(1))));
Stream s = m.Build();
ASSERT_EQ(1U, s.size());
@@ -2639,7 +2725,8 @@ TEST_F(InstructionSelectorTest, Word32AndWithWord32Not) {
EXPECT_EQ(1U, s[0]->OutputCount());
}
{
- StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32);
+ StreamBuilder m(this, MachineType::Int32(), MachineType::Int32(),
+ MachineType::Int32());
m.Return(m.Word32And(m.Word32Not(m.Parameter(0)), m.Parameter(1)));
Stream s = m.Build();
ASSERT_EQ(1U, s.size());
@@ -2652,7 +2739,8 @@ TEST_F(InstructionSelectorTest, Word32AndWithWord32Not) {
TEST_F(InstructionSelectorTest, Word32EqualWithParameters) {
- StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32);
+ StreamBuilder m(this, MachineType::Int32(), MachineType::Int32(),
+ MachineType::Int32());
m.Return(m.Word32Equal(m.Parameter(0), m.Parameter(1)));
Stream s = m.Build();
ASSERT_EQ(1U, s.size());
@@ -2668,7 +2756,7 @@ TEST_F(InstructionSelectorTest, Word32EqualWithParameters) {
TEST_F(InstructionSelectorTest, Word32EqualWithImmediate) {
TRACED_FOREACH(int32_t, imm, kImmediates) {
if (imm == 0) continue;
- StreamBuilder m(this, kMachInt32, kMachInt32);
+ StreamBuilder m(this, MachineType::Int32(), MachineType::Int32());
m.Return(m.Word32Equal(m.Parameter(0), m.Int32Constant(imm)));
Stream s = m.Build();
ASSERT_EQ(1U, s.size());
@@ -2682,7 +2770,7 @@ TEST_F(InstructionSelectorTest, Word32EqualWithImmediate) {
}
TRACED_FOREACH(int32_t, imm, kImmediates) {
if (imm == 0) continue;
- StreamBuilder m(this, kMachInt32, kMachInt32);
+ StreamBuilder m(this, MachineType::Int32(), MachineType::Int32());
m.Return(m.Word32Equal(m.Int32Constant(imm), m.Parameter(0)));
Stream s = m.Build();
ASSERT_EQ(1U, s.size());
@@ -2699,7 +2787,7 @@ TEST_F(InstructionSelectorTest, Word32EqualWithImmediate) {
TEST_F(InstructionSelectorTest, Word32EqualWithZero) {
{
- StreamBuilder m(this, kMachInt32, kMachInt32);
+ StreamBuilder m(this, MachineType::Int32(), MachineType::Int32());
m.Return(m.Word32Equal(m.Parameter(0), m.Int32Constant(0)));
Stream s = m.Build();
ASSERT_EQ(1U, s.size());
@@ -2712,7 +2800,7 @@ TEST_F(InstructionSelectorTest, Word32EqualWithZero) {
EXPECT_EQ(kEqual, s[0]->flags_condition());
}
{
- StreamBuilder m(this, kMachInt32, kMachInt32);
+ StreamBuilder m(this, MachineType::Int32(), MachineType::Int32());
m.Return(m.Word32Equal(m.Int32Constant(0), m.Parameter(0)));
Stream s = m.Build();
ASSERT_EQ(1U, s.size());
@@ -2728,7 +2816,7 @@ TEST_F(InstructionSelectorTest, Word32EqualWithZero) {
TEST_F(InstructionSelectorTest, Word32NotWithParameter) {
- StreamBuilder m(this, kMachInt32, kMachInt32);
+ StreamBuilder m(this, MachineType::Int32(), MachineType::Int32());
m.Return(m.Word32Not(m.Parameter(0)));
Stream s = m.Build();
ASSERT_EQ(1U, s.size());
@@ -2742,7 +2830,7 @@ TEST_F(InstructionSelectorTest, Word32NotWithParameter) {
TEST_F(InstructionSelectorTest, Word32AndWithWord32ShrWithImmediateForARMv7) {
TRACED_FORRANGE(int32_t, lsb, 0, 31) {
TRACED_FORRANGE(int32_t, width, 1, 32 - lsb) {
- StreamBuilder m(this, kMachInt32, kMachInt32);
+ StreamBuilder m(this, MachineType::Int32(), MachineType::Int32());
m.Return(m.Word32And(m.Word32Shr(m.Parameter(0), m.Int32Constant(lsb)),
m.Int32Constant(0xffffffffu >> (32 - width))));
Stream s = m.Build(ARMv7);
@@ -2755,7 +2843,7 @@ TEST_F(InstructionSelectorTest, Word32AndWithWord32ShrWithImmediateForARMv7) {
}
TRACED_FORRANGE(int32_t, lsb, 0, 31) {
TRACED_FORRANGE(int32_t, width, 1, 32 - lsb) {
- StreamBuilder m(this, kMachInt32, kMachInt32);
+ StreamBuilder m(this, MachineType::Int32(), MachineType::Int32());
m.Return(m.Word32And(m.Int32Constant(0xffffffffu >> (32 - width)),
m.Word32Shr(m.Parameter(0), m.Int32Constant(lsb))));
Stream s = m.Build(ARMv7);
@@ -2770,7 +2858,7 @@ TEST_F(InstructionSelectorTest, Word32AndWithWord32ShrWithImmediateForARMv7) {
TEST_F(InstructionSelectorTest, Word32Clz) {
- StreamBuilder m(this, kMachUint32, kMachUint32);
+ StreamBuilder m(this, MachineType::Uint32(), MachineType::Uint32());
Node* const p0 = m.Parameter(0);
Node* const n = m.Word32Clz(p0);
m.Return(n);
« no previous file with comments | « test/cctest/compiler/test-simplified-lowering.cc ('k') | test/unittests/compiler/arm64/instruction-selector-arm64-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698