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

Side by Side Diff: test/unittests/compiler/change-lowering-unittest.cc

Issue 840953003: [turbofan] Correctify representation changes to bit. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: std::isnan Created 5 years, 11 months 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/code-stubs.h" 5 #include "src/code-stubs.h"
6 #include "src/compiler/change-lowering.h" 6 #include "src/compiler/change-lowering.h"
7 #include "src/compiler/js-graph.h" 7 #include "src/compiler/js-graph.h"
8 #include "src/compiler/linkage.h" 8 #include "src/compiler/linkage.h"
9 #include "src/compiler/node-properties-inl.h" 9 #include "src/compiler/node-properties-inl.h"
10 #include "src/compiler/simplified-operator.h" 10 #include "src/compiler/simplified-operator.h"
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 IsSelect(static_cast<MachineType>(kTypeBool | kRepTagged), val, 125 IsSelect(static_cast<MachineType>(kTypeBool | kRepTagged), val,
126 IsTrueConstant(), IsFalseConstant())); 126 IsTrueConstant(), IsFalseConstant()));
127 } 127 }
128 128
129 129
130 TARGET_TEST_P(ChangeLoweringCommonTest, ChangeBoolToBit) { 130 TARGET_TEST_P(ChangeLoweringCommonTest, ChangeBoolToBit) {
131 Node* val = Parameter(0); 131 Node* val = Parameter(0);
132 Node* node = graph()->NewNode(simplified()->ChangeBoolToBit(), val); 132 Node* node = graph()->NewNode(simplified()->ChangeBoolToBit(), val);
133 Reduction reduction = Reduce(node); 133 Reduction reduction = Reduce(node);
134 ASSERT_TRUE(reduction.Changed()); 134 ASSERT_TRUE(reduction.Changed());
135 EXPECT_THAT(reduction.replacement(), IsWordEqual(val, IsTrueConstant()));
136 }
135 137
136 EXPECT_THAT(reduction.replacement(), IsWordEqual(val, IsTrueConstant())); 138
139 TARGET_TEST_P(ChangeLoweringCommonTest, ChangeWord32ToBit) {
140 Node* val = Parameter(0);
141 Node* node = graph()->NewNode(simplified()->ChangeWord32ToBit(), val);
142 Reduction reduction = Reduce(node);
143 ASSERT_TRUE(reduction.Changed());
144 EXPECT_THAT(reduction.replacement(),
145 IsWord32Equal(IsWord32Equal(val, IsInt32Constant(0)),
146 IsInt32Constant(0)));
147 }
148
149
150 TARGET_TEST_P(ChangeLoweringCommonTest, ChangeWord64ToBit) {
151 Node* val = Parameter(0);
152 Node* node = graph()->NewNode(simplified()->ChangeWord64ToBit(), val);
153 Reduction reduction = Reduce(node);
154 ASSERT_TRUE(reduction.Changed());
155 EXPECT_THAT(reduction.replacement(),
156 IsWord32Equal(IsWord64Equal(val, IsInt64Constant(0)),
157 IsInt32Constant(0)));
137 } 158 }
138 159
139 160
140 TARGET_TEST_P(ChangeLoweringCommonTest, ChangeFloat64ToTagged) { 161 TARGET_TEST_P(ChangeLoweringCommonTest, ChangeFloat64ToTagged) {
141 Node* val = Parameter(0); 162 Node* val = Parameter(0);
142 Node* node = graph()->NewNode(simplified()->ChangeFloat64ToTagged(), val); 163 Node* node = graph()->NewNode(simplified()->ChangeFloat64ToTagged(), val);
143 Reduction reduction = Reduce(node); 164 Reduction reduction = Reduce(node);
144 ASSERT_TRUE(reduction.Changed()); 165 ASSERT_TRUE(reduction.Changed());
145 166
146 Node* finish = reduction.replacement(); 167 Node* finish = reduction.replacement();
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after
454 IsIfTrue(AllOf(CaptureEq(&branch), 475 IsIfTrue(AllOf(CaptureEq(&branch),
455 IsBranch(IsUint32LessThanOrEqual( 476 IsBranch(IsUint32LessThanOrEqual(
456 val, IsInt32Constant(SmiMaxValue())), 477 val, IsInt32Constant(SmiMaxValue())),
457 graph()->start()))), 478 graph()->start()))),
458 AllOf(CaptureEq(&if_false), IsIfFalse(CaptureEq(&branch)))))); 479 AllOf(CaptureEq(&if_false), IsIfFalse(CaptureEq(&branch))))));
459 } 480 }
460 481
461 } // namespace compiler 482 } // namespace compiler
462 } // namespace internal 483 } // namespace internal
463 } // namespace v8 484 } // namespace v8
OLDNEW
« no previous file with comments | « test/mjsunit/compiler/regress-bit-number-constant.js ('k') | test/unittests/compiler/simplified-operator-reducer-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698