Fix expectations of lowering tests.
authortitzer@chromium.org <titzer@chromium.org>
Wed, 27 Aug 2014 14:47:50 +0000 (14:47 +0000)
committertitzer@chromium.org <titzer@chromium.org>
Wed, 27 Aug 2014 14:47:50 +0000 (14:47 +0000)
R=mstarzinger@chromium.org
BUG=

Review URL: https://codereview.chromium.org/513803002

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@23462 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

src/compiler/simplified-operator-reducer.cc
test/compiler-unittests/change-lowering-unittest.cc
test/compiler-unittests/graph-unittest.cc
test/compiler-unittests/graph-unittest.h
test/compiler-unittests/simplified-operator-reducer-unittest.cc

index 05c2599..2d1a002 100644 (file)
@@ -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 00a9160..4ea125a 100644 (file)
@@ -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 8dc047d..5e125b9 100644 (file)
@@ -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 b68d9db..2cb4f8e 100644 (file)
@@ -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 500e306..8902484 100644 (file)
@@ -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));
 }