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

Unified Diff: test/unittests/compiler/x64/instruction-selector-x64-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
« no previous file with comments | « test/unittests/compiler/tail-call-optimization-unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/unittests/compiler/x64/instruction-selector-x64-unittest.cc
diff --git a/test/unittests/compiler/x64/instruction-selector-x64-unittest.cc b/test/unittests/compiler/x64/instruction-selector-x64-unittest.cc
index f28087c54cf9dcf7e3a8dda67fc32047e59ad636..a6b3514bc10f1abeb103408b6da1b521854c038c 100644
--- a/test/unittests/compiler/x64/instruction-selector-x64-unittest.cc
+++ b/test/unittests/compiler/x64/instruction-selector-x64-unittest.cc
@@ -15,7 +15,7 @@ namespace compiler {
TEST_F(InstructionSelectorTest, ChangeFloat32ToFloat64WithParameter) {
- StreamBuilder m(this, kMachFloat32, kMachFloat64);
+ StreamBuilder m(this, MachineType::Float32(), MachineType::Float64());
m.Return(m.ChangeFloat32ToFloat64(m.Parameter(0)));
Stream s = m.Build();
ASSERT_EQ(1U, s.size());
@@ -26,7 +26,7 @@ TEST_F(InstructionSelectorTest, ChangeFloat32ToFloat64WithParameter) {
TEST_F(InstructionSelectorTest, ChangeInt32ToInt64WithParameter) {
- StreamBuilder m(this, kMachInt64, kMachInt32);
+ StreamBuilder m(this, MachineType::Int64(), MachineType::Int32());
m.Return(m.ChangeInt32ToInt64(m.Parameter(0)));
Stream s = m.Build();
ASSERT_EQ(1U, s.size());
@@ -35,7 +35,7 @@ TEST_F(InstructionSelectorTest, ChangeInt32ToInt64WithParameter) {
TEST_F(InstructionSelectorTest, ChangeUint32ToFloat64WithParameter) {
- StreamBuilder m(this, kMachFloat64, kMachUint32);
+ StreamBuilder m(this, MachineType::Float64(), MachineType::Uint32());
m.Return(m.ChangeUint32ToFloat64(m.Parameter(0)));
Stream s = m.Build();
ASSERT_EQ(1U, s.size());
@@ -44,7 +44,7 @@ TEST_F(InstructionSelectorTest, ChangeUint32ToFloat64WithParameter) {
TEST_F(InstructionSelectorTest, ChangeUint32ToUint64WithParameter) {
- StreamBuilder m(this, kMachUint64, kMachUint32);
+ StreamBuilder m(this, MachineType::Uint64(), MachineType::Uint32());
m.Return(m.ChangeUint32ToUint64(m.Parameter(0)));
Stream s = m.Build();
ASSERT_EQ(1U, s.size());
@@ -53,7 +53,7 @@ TEST_F(InstructionSelectorTest, ChangeUint32ToUint64WithParameter) {
TEST_F(InstructionSelectorTest, TruncateFloat64ToFloat32WithParameter) {
- StreamBuilder m(this, kMachFloat64, kMachFloat32);
+ StreamBuilder m(this, MachineType::Float64(), MachineType::Float32());
m.Return(m.TruncateFloat64ToFloat32(m.Parameter(0)));
Stream s = m.Build();
ASSERT_EQ(1U, s.size());
@@ -64,7 +64,7 @@ TEST_F(InstructionSelectorTest, TruncateFloat64ToFloat32WithParameter) {
TEST_F(InstructionSelectorTest, TruncateInt64ToInt32WithParameter) {
- StreamBuilder m(this, kMachInt32, kMachInt64);
+ StreamBuilder m(this, MachineType::Int32(), MachineType::Int64());
m.Return(m.TruncateInt64ToInt32(m.Parameter(0)));
Stream s = m.Build();
ASSERT_EQ(1U, s.size());
@@ -91,16 +91,16 @@ std::ostream& operator<<(std::ostream& os, const MemoryAccess& memacc) {
static const MemoryAccess kMemoryAccesses[] = {
- {kMachInt8, kX64Movsxbl, kX64Movb},
- {kMachUint8, kX64Movzxbl, kX64Movb},
- {kMachInt16, kX64Movsxwl, kX64Movw},
- {kMachUint16, kX64Movzxwl, kX64Movw},
- {kMachInt32, kX64Movl, kX64Movl},
- {kMachUint32, kX64Movl, kX64Movl},
- {kMachInt64, kX64Movq, kX64Movq},
- {kMachUint64, kX64Movq, kX64Movq},
- {kMachFloat32, kX64Movss, kX64Movss},
- {kMachFloat64, kX64Movsd, kX64Movsd}};
+ {MachineType::Int8(), kX64Movsxbl, kX64Movb},
+ {MachineType::Uint8(), kX64Movzxbl, kX64Movb},
+ {MachineType::Int16(), kX64Movsxwl, kX64Movw},
+ {MachineType::Uint16(), kX64Movzxwl, kX64Movw},
+ {MachineType::Int32(), kX64Movl, kX64Movl},
+ {MachineType::Uint32(), kX64Movl, kX64Movl},
+ {MachineType::Int64(), kX64Movq, kX64Movq},
+ {MachineType::Uint64(), kX64Movq, kX64Movq},
+ {MachineType::Float32(), kX64Movss, kX64Movss},
+ {MachineType::Float64(), kX64Movsd, kX64Movsd}};
} // namespace
@@ -111,7 +111,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());
@@ -123,7 +124,8 @@ TEST_P(InstructionSelectorMemoryAccessTest, LoadWithParameters) {
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));
@@ -191,7 +193,8 @@ typedef InstructionSelectorTestWithParam<BinaryOperation>
TEST_P(InstructionSelectorChangeUint32ToUint64Test, ChangeUint32ToUint64) {
const BinaryOperation& bop = GetParam();
- StreamBuilder m(this, kMachUint64, kMachInt32, kMachInt32);
+ StreamBuilder m(this, MachineType::Uint64(), MachineType::Int32(),
+ MachineType::Int32());
Node* const p0 = m.Parameter(0);
Node* const p1 = m.Parameter(1);
m.Return(m.ChangeUint32ToUint64((m.*bop.constructor)(p0, p1)));
@@ -210,7 +213,7 @@ INSTANTIATE_TEST_CASE_P(InstructionSelectorTest,
TEST_F(InstructionSelectorTest, TruncateInt64ToInt32WithWord64Sar) {
- StreamBuilder m(this, kMachInt32, kMachInt64);
+ StreamBuilder m(this, MachineType::Int32(), MachineType::Int64());
Node* const p = m.Parameter(0);
Node* const t = m.TruncateInt64ToInt32(m.Word64Sar(p, m.Int64Constant(32)));
m.Return(t);
@@ -227,7 +230,7 @@ TEST_F(InstructionSelectorTest, TruncateInt64ToInt32WithWord64Sar) {
TEST_F(InstructionSelectorTest, TruncateInt64ToInt32WithWord64Shr) {
- StreamBuilder m(this, kMachInt32, kMachInt64);
+ StreamBuilder m(this, MachineType::Int32(), MachineType::Int64());
Node* const p = m.Parameter(0);
Node* const t = m.TruncateInt64ToInt32(m.Word64Shr(p, m.Int64Constant(32)));
m.Return(t);
@@ -248,7 +251,8 @@ TEST_F(InstructionSelectorTest, TruncateInt64ToInt32WithWord64Shr) {
TEST_F(InstructionSelectorTest, Int32AddWithInt32ParametersLea) {
- 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 a0 = m.Int32Add(p0, p1);
@@ -265,7 +269,7 @@ TEST_F(InstructionSelectorTest, Int32AddWithInt32ParametersLea) {
TEST_F(InstructionSelectorTest, Int32AddConstantAsLeaSingle) {
- StreamBuilder m(this, kMachInt32, kMachInt32);
+ StreamBuilder m(this, MachineType::Int32(), MachineType::Int32());
Node* const p0 = m.Parameter(0);
Node* const c0 = m.Int32Constant(15);
// If one of the add's operands is only used once, use an "leal", even though
@@ -287,7 +291,7 @@ TEST_F(InstructionSelectorTest, Int32AddConstantAsLeaSingle) {
TEST_F(InstructionSelectorTest, Int32AddConstantAsAdd) {
- StreamBuilder m(this, kMachInt32, kMachInt32);
+ StreamBuilder m(this, MachineType::Int32(), MachineType::Int32());
Node* const p0 = m.Parameter(0);
Node* const c0 = m.Int32Constant(1);
// If there is only a single use of an add's input and the immediate constant
@@ -305,7 +309,7 @@ TEST_F(InstructionSelectorTest, Int32AddConstantAsAdd) {
TEST_F(InstructionSelectorTest, Int32AddConstantAsLeaDouble) {
- StreamBuilder m(this, kMachInt32, kMachInt32);
+ StreamBuilder m(this, MachineType::Int32(), MachineType::Int32());
Node* const p0 = m.Parameter(0);
Node* const c0 = m.Int32Constant(15);
// A second use of an add's input uses lea
@@ -322,7 +326,7 @@ TEST_F(InstructionSelectorTest, Int32AddConstantAsLeaDouble) {
TEST_F(InstructionSelectorTest, Int32AddCommutedConstantAsLeaSingle) {
- StreamBuilder m(this, kMachInt32, kMachInt32);
+ StreamBuilder m(this, MachineType::Int32(), MachineType::Int32());
Node* const p0 = m.Parameter(0);
Node* const c0 = m.Int32Constant(15);
// If one of the add's operands is only used once, use an "leal", even though
@@ -343,7 +347,7 @@ TEST_F(InstructionSelectorTest, Int32AddCommutedConstantAsLeaSingle) {
TEST_F(InstructionSelectorTest, Int32AddCommutedConstantAsLeaDouble) {
- StreamBuilder m(this, kMachInt32, kMachInt32);
+ StreamBuilder m(this, MachineType::Int32(), MachineType::Int32());
Node* const p0 = m.Parameter(0);
Node* const c0 = m.Int32Constant(15);
// A second use of an add's input uses lea
@@ -361,7 +365,8 @@ TEST_F(InstructionSelectorTest, Int32AddCommutedConstantAsLeaDouble) {
TEST_F(InstructionSelectorTest, Int32AddSimpleAsAdd) {
- 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);
// If one of the add's operands is only used once, use an "leal", even though
@@ -382,7 +387,8 @@ TEST_F(InstructionSelectorTest, Int32AddSimpleAsAdd) {
TEST_F(InstructionSelectorTest, Int32AddSimpleAsLea) {
- 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);
// If all of of the add's operands are used multiple times, use an "leal".
@@ -399,7 +405,8 @@ TEST_F(InstructionSelectorTest, Int32AddSimpleAsLea) {
TEST_F(InstructionSelectorTest, Int32AddScaled2Mul) {
- 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 s0 = m.Int32Mul(p1, m.Int32Constant(2));
@@ -415,7 +422,8 @@ TEST_F(InstructionSelectorTest, Int32AddScaled2Mul) {
TEST_F(InstructionSelectorTest, Int32AddCommutedScaled2Mul) {
- 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 s0 = m.Int32Mul(p1, m.Int32Constant(2));
@@ -431,7 +439,8 @@ TEST_F(InstructionSelectorTest, Int32AddCommutedScaled2Mul) {
TEST_F(InstructionSelectorTest, Int32AddScaled2Shl) {
- 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 s0 = m.Word32Shl(p1, m.Int32Constant(1));
@@ -447,7 +456,8 @@ TEST_F(InstructionSelectorTest, Int32AddScaled2Shl) {
TEST_F(InstructionSelectorTest, Int32AddCommutedScaled2Shl) {
- 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 s0 = m.Word32Shl(p1, m.Int32Constant(1));
@@ -463,7 +473,8 @@ TEST_F(InstructionSelectorTest, Int32AddCommutedScaled2Shl) {
TEST_F(InstructionSelectorTest, Int32AddScaled4Mul) {
- 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 s0 = m.Int32Mul(p1, m.Int32Constant(4));
@@ -479,7 +490,8 @@ TEST_F(InstructionSelectorTest, Int32AddScaled4Mul) {
TEST_F(InstructionSelectorTest, Int32AddScaled4Shl) {
- 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 s0 = m.Word32Shl(p1, m.Int32Constant(2));
@@ -495,7 +507,8 @@ TEST_F(InstructionSelectorTest, Int32AddScaled4Shl) {
TEST_F(InstructionSelectorTest, Int32AddScaled8Mul) {
- 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 s0 = m.Int32Mul(p1, m.Int32Constant(8));
@@ -511,7 +524,8 @@ TEST_F(InstructionSelectorTest, Int32AddScaled8Mul) {
TEST_F(InstructionSelectorTest, Int32AddScaled8Shl) {
- 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 s0 = m.Word32Shl(p1, m.Int32Constant(3));
@@ -527,7 +541,8 @@ TEST_F(InstructionSelectorTest, Int32AddScaled8Shl) {
TEST_F(InstructionSelectorTest, Int32AddScaled2MulWithConstant) {
- 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 s0 = m.Int32Mul(p1, m.Int32Constant(2));
@@ -545,7 +560,8 @@ TEST_F(InstructionSelectorTest, Int32AddScaled2MulWithConstant) {
TEST_F(InstructionSelectorTest, Int32AddScaled2MulWithConstantShuffle1) {
- 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 s0 = m.Int32Mul(p1, m.Int32Constant(2));
@@ -563,7 +579,8 @@ TEST_F(InstructionSelectorTest, Int32AddScaled2MulWithConstantShuffle1) {
TEST_F(InstructionSelectorTest, Int32AddScaled2MulWithConstantShuffle2) {
- 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 s0 = m.Int32Mul(p1, m.Int32Constant(2));
@@ -581,7 +598,8 @@ TEST_F(InstructionSelectorTest, Int32AddScaled2MulWithConstantShuffle2) {
TEST_F(InstructionSelectorTest, Int32AddScaled2MulWithConstantShuffle3) {
- 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 s0 = m.Int32Mul(p1, m.Int32Constant(2));
@@ -599,7 +617,8 @@ TEST_F(InstructionSelectorTest, Int32AddScaled2MulWithConstantShuffle3) {
TEST_F(InstructionSelectorTest, Int32AddScaled2MulWithConstantShuffle4) {
- 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 s0 = m.Int32Mul(p1, m.Int32Constant(2));
@@ -617,7 +636,8 @@ TEST_F(InstructionSelectorTest, Int32AddScaled2MulWithConstantShuffle4) {
TEST_F(InstructionSelectorTest, Int32AddScaled2MulWithConstantShuffle5) {
- 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 s0 = m.Int32Mul(p1, m.Int32Constant(2));
@@ -635,7 +655,8 @@ TEST_F(InstructionSelectorTest, Int32AddScaled2MulWithConstantShuffle5) {
TEST_F(InstructionSelectorTest, Int32AddScaled2ShlWithConstant) {
- 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 s0 = m.Word32Shl(p1, m.Int32Constant(1));
@@ -653,7 +674,8 @@ TEST_F(InstructionSelectorTest, Int32AddScaled2ShlWithConstant) {
TEST_F(InstructionSelectorTest, Int32AddScaled4MulWithConstant) {
- 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 s0 = m.Int32Mul(p1, m.Int32Constant(4));
@@ -671,7 +693,8 @@ TEST_F(InstructionSelectorTest, Int32AddScaled4MulWithConstant) {
TEST_F(InstructionSelectorTest, Int32AddScaled4ShlWithConstant) {
- 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 s0 = m.Word32Shl(p1, m.Int32Constant(2));
@@ -689,7 +712,8 @@ TEST_F(InstructionSelectorTest, Int32AddScaled4ShlWithConstant) {
TEST_F(InstructionSelectorTest, Int32AddScaled8MulWithConstant) {
- 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 s0 = m.Int32Mul(p1, m.Int32Constant(8));
@@ -707,7 +731,8 @@ TEST_F(InstructionSelectorTest, Int32AddScaled8MulWithConstant) {
TEST_F(InstructionSelectorTest, Int32AddScaled8ShlWithConstant) {
- 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 s0 = m.Word32Shl(p1, m.Int32Constant(3));
@@ -725,7 +750,7 @@ TEST_F(InstructionSelectorTest, Int32AddScaled8ShlWithConstant) {
TEST_F(InstructionSelectorTest, Int32SubConstantAsSub) {
- StreamBuilder m(this, kMachInt32, kMachInt32);
+ StreamBuilder m(this, MachineType::Int32(), MachineType::Int32());
Node* const p0 = m.Parameter(0);
Node* const c0 = m.Int32Constant(-1);
// If there is only a single use of on of the sub's non-constant input, use a
@@ -742,7 +767,7 @@ TEST_F(InstructionSelectorTest, Int32SubConstantAsSub) {
TEST_F(InstructionSelectorTest, Int32SubConstantAsLea) {
- StreamBuilder m(this, kMachInt32, kMachInt32);
+ StreamBuilder m(this, MachineType::Int32(), MachineType::Int32());
Node* const p0 = m.Parameter(0);
Node* const c0 = m.Int32Constant(-1);
// If there are multiple uses of on of the sub's non-constant input, use a
@@ -760,7 +785,8 @@ TEST_F(InstructionSelectorTest, Int32SubConstantAsLea) {
TEST_F(InstructionSelectorTest, Int32AddScaled2Other) {
- 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);
@@ -789,7 +815,8 @@ TEST_F(InstructionSelectorTest, Int32AddScaled2Other) {
TEST_F(InstructionSelectorTest, Int32MulWithInt32MulWithParameters) {
- 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 m0 = m.Int32Mul(p0, p1);
@@ -810,7 +837,8 @@ TEST_F(InstructionSelectorTest, Int32MulWithInt32MulWithParameters) {
TEST_F(InstructionSelectorTest, Int32MulHigh) {
- 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);
@@ -830,7 +858,8 @@ TEST_F(InstructionSelectorTest, Int32MulHigh) {
TEST_F(InstructionSelectorTest, Uint32MulHigh) {
- 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);
@@ -850,7 +879,8 @@ TEST_F(InstructionSelectorTest, Uint32MulHigh) {
TEST_F(InstructionSelectorTest, Int32Mul2BecomesLea) {
- StreamBuilder m(this, kMachUint32, kMachUint32, kMachUint32);
+ StreamBuilder m(this, MachineType::Uint32(), MachineType::Uint32(),
+ MachineType::Uint32());
Node* const p0 = m.Parameter(0);
Node* const c1 = m.Int32Constant(2);
Node* const n = m.Int32Mul(p0, c1);
@@ -866,7 +896,8 @@ TEST_F(InstructionSelectorTest, Int32Mul2BecomesLea) {
TEST_F(InstructionSelectorTest, Int32Mul3BecomesLea) {
- StreamBuilder m(this, kMachUint32, kMachUint32, kMachUint32);
+ StreamBuilder m(this, MachineType::Uint32(), MachineType::Uint32(),
+ MachineType::Uint32());
Node* const p0 = m.Parameter(0);
Node* const c1 = m.Int32Constant(3);
Node* const n = m.Int32Mul(p0, c1);
@@ -882,7 +913,8 @@ TEST_F(InstructionSelectorTest, Int32Mul3BecomesLea) {
TEST_F(InstructionSelectorTest, Int32Mul4BecomesLea) {
- StreamBuilder m(this, kMachUint32, kMachUint32, kMachUint32);
+ StreamBuilder m(this, MachineType::Uint32(), MachineType::Uint32(),
+ MachineType::Uint32());
Node* const p0 = m.Parameter(0);
Node* const c1 = m.Int32Constant(4);
Node* const n = m.Int32Mul(p0, c1);
@@ -897,7 +929,8 @@ TEST_F(InstructionSelectorTest, Int32Mul4BecomesLea) {
TEST_F(InstructionSelectorTest, Int32Mul5BecomesLea) {
- StreamBuilder m(this, kMachUint32, kMachUint32, kMachUint32);
+ StreamBuilder m(this, MachineType::Uint32(), MachineType::Uint32(),
+ MachineType::Uint32());
Node* const p0 = m.Parameter(0);
Node* const c1 = m.Int32Constant(5);
Node* const n = m.Int32Mul(p0, c1);
@@ -913,7 +946,8 @@ TEST_F(InstructionSelectorTest, Int32Mul5BecomesLea) {
TEST_F(InstructionSelectorTest, Int32Mul8BecomesLea) {
- StreamBuilder m(this, kMachUint32, kMachUint32, kMachUint32);
+ StreamBuilder m(this, MachineType::Uint32(), MachineType::Uint32(),
+ MachineType::Uint32());
Node* const p0 = m.Parameter(0);
Node* const c1 = m.Int32Constant(8);
Node* const n = m.Int32Mul(p0, c1);
@@ -928,7 +962,8 @@ TEST_F(InstructionSelectorTest, Int32Mul8BecomesLea) {
TEST_F(InstructionSelectorTest, Int32Mul9BecomesLea) {
- StreamBuilder m(this, kMachUint32, kMachUint32, kMachUint32);
+ StreamBuilder m(this, MachineType::Uint32(), MachineType::Uint32(),
+ MachineType::Uint32());
Node* const p0 = m.Parameter(0);
Node* const c1 = m.Int32Constant(9);
Node* const n = m.Int32Mul(p0, c1);
@@ -948,7 +983,8 @@ TEST_F(InstructionSelectorTest, Int32Mul9BecomesLea) {
TEST_F(InstructionSelectorTest, Int32Shl1BecomesLea) {
- StreamBuilder m(this, kMachUint32, kMachUint32, kMachUint32);
+ StreamBuilder m(this, MachineType::Uint32(), MachineType::Uint32(),
+ MachineType::Uint32());
Node* const p0 = m.Parameter(0);
Node* const c1 = m.Int32Constant(1);
Node* const n = m.Word32Shl(p0, c1);
@@ -964,7 +1000,8 @@ TEST_F(InstructionSelectorTest, Int32Shl1BecomesLea) {
TEST_F(InstructionSelectorTest, Int32Shl2BecomesLea) {
- StreamBuilder m(this, kMachUint32, kMachUint32, kMachUint32);
+ StreamBuilder m(this, MachineType::Uint32(), MachineType::Uint32(),
+ MachineType::Uint32());
Node* const p0 = m.Parameter(0);
Node* const c1 = m.Int32Constant(2);
Node* const n = m.Word32Shl(p0, c1);
@@ -979,7 +1016,8 @@ TEST_F(InstructionSelectorTest, Int32Shl2BecomesLea) {
TEST_F(InstructionSelectorTest, Int32Shl4BecomesLea) {
- StreamBuilder m(this, kMachUint32, kMachUint32, kMachUint32);
+ StreamBuilder m(this, MachineType::Uint32(), MachineType::Uint32(),
+ MachineType::Uint32());
Node* const p0 = m.Parameter(0);
Node* const c1 = m.Int32Constant(3);
Node* const n = m.Word32Shl(p0, c1);
@@ -999,7 +1037,7 @@ TEST_F(InstructionSelectorTest, Int32Shl4BecomesLea) {
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);
@@ -1014,7 +1052,7 @@ TEST_F(InstructionSelectorTest, Float32Abs) {
EXPECT_EQ(kFlags_none, s[0]->flags_mode());
}
{
- 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);
@@ -1032,7 +1070,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);
@@ -1047,7 +1085,7 @@ TEST_F(InstructionSelectorTest, Float64Abs) {
EXPECT_EQ(kFlags_none, s[0]->flags_mode());
}
{
- 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);
@@ -1065,7 +1103,8 @@ TEST_F(InstructionSelectorTest, Float64Abs) {
TEST_F(InstructionSelectorTest, Float64BinopArithmetic) {
{
- StreamBuilder m(this, kMachFloat64, kMachFloat64, kMachFloat64);
+ StreamBuilder m(this, MachineType::Float64(), MachineType::Float64(),
+ MachineType::Float64());
Node* add = m.Float64Add(m.Parameter(0), m.Parameter(1));
Node* mul = m.Float64Mul(add, m.Parameter(1));
Node* sub = m.Float64Sub(mul, add);
@@ -1079,7 +1118,8 @@ TEST_F(InstructionSelectorTest, Float64BinopArithmetic) {
EXPECT_EQ(kAVXFloat64Div, s[3]->arch_opcode());
}
{
- StreamBuilder m(this, kMachFloat64, kMachFloat64, kMachFloat64);
+ StreamBuilder m(this, MachineType::Float64(), MachineType::Float64(),
+ MachineType::Float64());
Node* add = m.Float64Add(m.Parameter(0), m.Parameter(1));
Node* mul = m.Float64Mul(add, m.Parameter(1));
Node* sub = m.Float64Sub(mul, add);
@@ -1097,7 +1137,7 @@ TEST_F(InstructionSelectorTest, Float64BinopArithmetic) {
TEST_F(InstructionSelectorTest, Float32SubWithMinusZeroAndParameter) {
{
- 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);
@@ -1111,7 +1151,7 @@ TEST_F(InstructionSelectorTest, Float32SubWithMinusZeroAndParameter) {
EXPECT_EQ(kFlags_none, s[0]->flags_mode());
}
{
- 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);
@@ -1129,7 +1169,7 @@ TEST_F(InstructionSelectorTest, Float32SubWithMinusZeroAndParameter) {
TEST_F(InstructionSelectorTest, Float64SubWithMinusZeroAndParameter) {
{
- 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);
@@ -1143,7 +1183,7 @@ TEST_F(InstructionSelectorTest, Float64SubWithMinusZeroAndParameter) {
EXPECT_EQ(kFlags_none, s[0]->flags_mode());
}
{
- 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);
@@ -1164,9 +1204,9 @@ TEST_F(InstructionSelectorTest, Float64SubWithMinusZeroAndParameter) {
TEST_F(InstructionSelectorTest, Uint64LessThanWithLoadAndLoadStackPointer) {
- StreamBuilder m(this, kMachBool);
+ StreamBuilder m(this, MachineType::Bool());
Node* const sl = m.Load(
- kMachPtr,
+ MachineType::Pointer(),
m.ExternalConstant(ExternalReference::address_of_stack_limit(isolate())));
Node* const sp = m.LoadStackPointer();
Node* const n = m.Uint64LessThan(sl, sp);
@@ -1184,7 +1224,7 @@ TEST_F(InstructionSelectorTest, Uint64LessThanWithLoadAndLoadStackPointer) {
TEST_F(InstructionSelectorTest, Word64ShlWithChangeInt32ToInt64) {
TRACED_FORRANGE(int64_t, x, 32, 63) {
- StreamBuilder m(this, kMachInt64, kMachInt32);
+ StreamBuilder m(this, MachineType::Int64(), MachineType::Int32());
Node* const p0 = m.Parameter(0);
Node* const n = m.Word64Shl(m.ChangeInt32ToInt64(p0), m.Int64Constant(x));
m.Return(n);
@@ -1203,7 +1243,7 @@ TEST_F(InstructionSelectorTest, Word64ShlWithChangeInt32ToInt64) {
TEST_F(InstructionSelectorTest, Word64ShlWithChangeUint32ToUint64) {
TRACED_FORRANGE(int64_t, x, 32, 63) {
- StreamBuilder m(this, kMachInt64, kMachUint32);
+ StreamBuilder m(this, MachineType::Int64(), MachineType::Uint32());
Node* const p0 = m.Parameter(0);
Node* const n = m.Word64Shl(m.ChangeUint32ToUint64(p0), m.Int64Constant(x));
m.Return(n);
@@ -1222,7 +1262,7 @@ TEST_F(InstructionSelectorTest, Word64ShlWithChangeUint32ToUint64) {
TEST_F(InstructionSelectorTest, Word32AndWith0xff) {
{
- StreamBuilder m(this, kMachInt32, kMachInt32);
+ StreamBuilder m(this, MachineType::Int32(), MachineType::Int32());
Node* const p0 = m.Parameter(0);
Node* const n = m.Word32And(p0, m.Int32Constant(0xff));
m.Return(n);
@@ -1235,7 +1275,7 @@ TEST_F(InstructionSelectorTest, Word32AndWith0xff) {
EXPECT_EQ(s.ToVreg(n), 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 n = m.Word32And(m.Int32Constant(0xff), p0);
m.Return(n);
@@ -1252,7 +1292,7 @@ TEST_F(InstructionSelectorTest, Word32AndWith0xff) {
TEST_F(InstructionSelectorTest, Word32AndWith0xffff) {
{
- StreamBuilder m(this, kMachInt32, kMachInt32);
+ StreamBuilder m(this, MachineType::Int32(), MachineType::Int32());
Node* const p0 = m.Parameter(0);
Node* const n = m.Word32And(p0, m.Int32Constant(0xffff));
m.Return(n);
@@ -1265,7 +1305,7 @@ TEST_F(InstructionSelectorTest, Word32AndWith0xffff) {
EXPECT_EQ(s.ToVreg(n), 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 n = m.Word32And(m.Int32Constant(0xffff), p0);
m.Return(n);
@@ -1281,7 +1321,7 @@ TEST_F(InstructionSelectorTest, Word32AndWith0xffff) {
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/unittests/compiler/tail-call-optimization-unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698