Reviewers: Michael Starzinger,
Description:
Fix expectations of lowering tests.
[email protected]
BUG=
Please review this at https://codereview.chromium.org/513803002/
SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge
Affected files (+10, -8 lines):
M src/compiler/simplified-operator-reducer.cc
M test/compiler-unittests/change-lowering-unittest.cc
M test/compiler-unittests/graph-unittest.h
M test/compiler-unittests/graph-unittest.cc
M test/compiler-unittests/simplified-operator-reducer-unittest.cc
Index: src/compiler/simplified-operator-reducer.cc
diff --git a/src/compiler/simplified-operator-reducer.cc
b/src/compiler/simplified-operator-reducer.cc
index
05c2599e955efb09b50dd4b782151cc305487667..2d1a002ce8a3b788887148f4643ddee0aaa10786
100644
--- a/src/compiler/simplified-operator-reducer.cc
+++ b/src/compiler/simplified-operator-reducer.cc
@@ -69,7 +69,7 @@ Reduction SimplifiedOperatorReducer::Reduce(Node* node) {
Float64Matcher m(node->InputAt(0));
if (m.HasValue()) return ReplaceInt32(DoubleToInt32(m.Value()));
if (m.IsChangeFloat64ToTagged()) {
- return Change(node, machine()->TruncateFloat64ToInt32(),
+ return Change(node, machine()->ChangeFloat64ToInt32(),
m.node()->InputAt(0));
}
if (m.IsChangeInt32ToTagged()) return Replace(m.node()->InputAt(0));
@@ -79,7 +79,7 @@ Reduction SimplifiedOperatorReducer::Reduce(Node* node) {
Float64Matcher m(node->InputAt(0));
if (m.HasValue()) return ReplaceUint32(DoubleToUint32(m.Value()));
if (m.IsChangeFloat64ToTagged()) {
- return Change(node, machine()->TruncateFloat64ToInt32(),
+ return Change(node, machine()->ChangeFloat64ToUint32(),
m.node()->InputAt(0));
}
if (m.IsChangeUint32ToTagged()) return Replace(m.node()->InputAt(0));
Index: test/compiler-unittests/change-lowering-unittest.cc
diff --git a/test/compiler-unittests/change-lowering-unittest.cc
b/test/compiler-unittests/change-lowering-unittest.cc
index
00a9160b8760a37b587816c10aa68eda0ffe4564..4ea125a5f4cd20b51b01f1d30443f4dc64ca1bfb
100644
--- a/test/compiler-unittests/change-lowering-unittest.cc
+++ b/test/compiler-unittests/change-lowering-unittest.cc
@@ -269,7 +269,7 @@ TARGET_TEST_F(ChangeLowering32Test,
ChangeTaggedToInt32) {
Capture<Node*> branch, if_true;
EXPECT_THAT(
phi,
- IsPhi(IsTruncateFloat64ToInt32(IsLoad(
+ IsPhi(IsChangeFloat64ToInt32(IsLoad(
kMachFloat64, val,
IsInt32Constant(HeapNumberValueOffset()),
IsControlEffect(CaptureEq(&if_true)))),
IsWord32Sar(val, IsInt32Constant(SmiShiftAmount())),
@@ -294,7 +294,7 @@ TARGET_TEST_F(ChangeLowering32Test,
ChangeTaggedToUint32) {
Capture<Node*> branch, if_true;
EXPECT_THAT(
phi,
- IsPhi(IsTruncateFloat64ToInt32(IsLoad(
+ IsPhi(IsChangeFloat64ToUint32(IsLoad(
kMachFloat64, val,
IsInt32Constant(HeapNumberValueOffset()),
IsControlEffect(CaptureEq(&if_true)))),
IsWord32Sar(val, IsInt32Constant(SmiShiftAmount())),
@@ -403,7 +403,7 @@ TARGET_TEST_F(ChangeLowering64Test,
ChangeTaggedToInt32) {
Capture<Node*> branch, if_true;
EXPECT_THAT(
phi,
- IsPhi(IsTruncateFloat64ToInt32(IsLoad(
+ IsPhi(IsChangeFloat64ToInt32(IsLoad(
kMachFloat64, val,
IsInt32Constant(HeapNumberValueOffset()),
IsControlEffect(CaptureEq(&if_true)))),
IsTruncateInt64ToInt32(
@@ -429,7 +429,7 @@ TARGET_TEST_F(ChangeLowering64Test,
ChangeTaggedToUint32) {
Capture<Node*> branch, if_true;
EXPECT_THAT(
phi,
- IsPhi(IsTruncateFloat64ToInt32(IsLoad(
+ IsPhi(IsChangeFloat64ToUint32(IsLoad(
kMachFloat64, val,
IsInt32Constant(HeapNumberValueOffset()),
IsControlEffect(CaptureEq(&if_true)))),
IsTruncateInt64ToInt32(
Index: test/compiler-unittests/graph-unittest.cc
diff --git a/test/compiler-unittests/graph-unittest.cc
b/test/compiler-unittests/graph-unittest.cc
index
8dc047df2ddba872c60d9a93970cb2d33cd519da..5e125b95914b11a225d694d590f62840863c85cf
100644
--- a/test/compiler-unittests/graph-unittest.cc
+++ b/test/compiler-unittests/graph-unittest.cc
@@ -744,6 +744,7 @@ IS_BINOP_MATCHER(Uint32LessThanOrEqual)
return MakeMatcher(new IsUnopMatcher(IrOpcode::k##Name,
input_matcher)); \
}
IS_UNOP_MATCHER(ChangeFloat64ToInt32)
+IS_UNOP_MATCHER(ChangeFloat64ToUint32)
IS_UNOP_MATCHER(ChangeInt32ToFloat64)
IS_UNOP_MATCHER(ChangeInt32ToInt64)
IS_UNOP_MATCHER(ChangeUint32ToFloat64)
Index: test/compiler-unittests/graph-unittest.h
diff --git a/test/compiler-unittests/graph-unittest.h
b/test/compiler-unittests/graph-unittest.h
index
b68d9dbb72770294da49876eb8632ac1115a9a8b..2cb4f8e2ec144214bbbe65b6f8bfa02cd78efef4
100644
--- a/test/compiler-unittests/graph-unittest.h
+++ b/test/compiler-unittests/graph-unittest.h
@@ -113,6 +113,7 @@ Matcher<Node*> IsInt32AddWithOverflow(const
Matcher<Node*>& lhs_matcher,
Matcher<Node*> IsUint32LessThanOrEqual(const Matcher<Node*>& lhs_matcher,
const Matcher<Node*>& rhs_matcher);
Matcher<Node*> IsChangeFloat64ToInt32(const Matcher<Node*>& input_matcher);
+Matcher<Node*> IsChangeFloat64ToUint32(const Matcher<Node*>&
input_matcher);
Matcher<Node*> IsChangeInt32ToFloat64(const Matcher<Node*>& input_matcher);
Matcher<Node*> IsChangeInt32ToInt64(const Matcher<Node*>& input_matcher);
Matcher<Node*> IsChangeUint32ToFloat64(const Matcher<Node*>&
input_matcher);
Index: test/compiler-unittests/simplified-operator-reducer-unittest.cc
diff --git
a/test/compiler-unittests/simplified-operator-reducer-unittest.cc
b/test/compiler-unittests/simplified-operator-reducer-unittest.cc
index
500e3061c7c747c088930b194a7578714219e7db..8902484c8cb05470e8c6ee3ef89cb231b21e98a8
100644
--- a/test/compiler-unittests/simplified-operator-reducer-unittest.cc
+++ b/test/compiler-unittests/simplified-operator-reducer-unittest.cc
@@ -364,7 +364,7 @@ TEST_F(SimplifiedOperatorReducerTest,
simplified()->ChangeTaggedToInt32(),
graph()->NewNode(simplified()->ChangeFloat64ToTagged(), param0)));
ASSERT_TRUE(reduction.Changed());
- EXPECT_THAT(reduction.replacement(), IsTruncateFloat64ToInt32(param0));
+ EXPECT_THAT(reduction.replacement(), IsChangeFloat64ToInt32(param0));
}
@@ -418,7 +418,7 @@ TEST_F(SimplifiedOperatorReducerTest,
simplified()->ChangeTaggedToUint32(),
graph()->NewNode(simplified()->ChangeFloat64ToTagged(), param0)));
ASSERT_TRUE(reduction.Changed());
- EXPECT_THAT(reduction.replacement(), IsTruncateFloat64ToInt32(param0));
+ EXPECT_THAT(reduction.replacement(), IsChangeFloat64ToUint32(param0));
}
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.