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

Side by Side Diff: test/unittests/compiler/common-operator-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 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 <limits> 5 #include <limits>
6 6
7 #include "src/compiler/common-operator.h" 7 #include "src/compiler/common-operator.h"
8 #include "src/compiler/opcodes.h" 8 #include "src/compiler/opcodes.h"
9 #include "src/compiler/operator.h" 9 #include "src/compiler/operator.h"
10 #include "src/compiler/operator-properties.h" 10 #include "src/compiler/operator-properties.h"
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after
265 EXPECT_EQ(1, op->ControlInputCount()); 265 EXPECT_EQ(1, op->ControlInputCount());
266 EXPECT_EQ(1, OperatorProperties::GetTotalInputCount(op)); 266 EXPECT_EQ(1, OperatorProperties::GetTotalInputCount(op));
267 EXPECT_EQ(0, op->ValueOutputCount()); 267 EXPECT_EQ(0, op->ValueOutputCount());
268 EXPECT_EQ(0, op->EffectOutputCount()); 268 EXPECT_EQ(0, op->EffectOutputCount());
269 EXPECT_EQ(1, op->ControlOutputCount()); 269 EXPECT_EQ(1, op->ControlOutputCount());
270 } 270 }
271 } 271 }
272 272
273 273
274 TEST_F(CommonOperatorTest, Select) { 274 TEST_F(CommonOperatorTest, Select) {
275 static const MachineType kTypes[] = { 275 static const MachineRepresentation kMachineRepresentations[] = {
276 kMachInt8, kMachUint8, kMachInt16, kMachUint16, 276 MachineRepresentation::kBit, MachineRepresentation::kWord8,
277 kMachInt32, kMachUint32, kMachInt64, kMachUint64, 277 MachineRepresentation::kWord16, MachineRepresentation::kWord32,
278 kMachFloat32, kMachFloat64, kMachAnyTagged}; 278 MachineRepresentation::kWord64, MachineRepresentation::kFloat32,
279 TRACED_FOREACH(MachineType, type, kTypes) { 279 MachineRepresentation::kFloat64, MachineRepresentation::kTagged};
280
281
282 TRACED_FOREACH(MachineRepresentation, rep, kMachineRepresentations) {
280 TRACED_FOREACH(BranchHint, hint, kBranchHints) { 283 TRACED_FOREACH(BranchHint, hint, kBranchHints) {
281 const Operator* const op = common()->Select(type, hint); 284 const Operator* const op = common()->Select(rep, hint);
282 EXPECT_EQ(IrOpcode::kSelect, op->opcode()); 285 EXPECT_EQ(IrOpcode::kSelect, op->opcode());
283 EXPECT_EQ(Operator::kPure, op->properties()); 286 EXPECT_EQ(Operator::kPure, op->properties());
284 EXPECT_EQ(type, SelectParametersOf(op).type()); 287 EXPECT_EQ(rep, SelectParametersOf(op).representation());
285 EXPECT_EQ(hint, SelectParametersOf(op).hint()); 288 EXPECT_EQ(hint, SelectParametersOf(op).hint());
286 EXPECT_EQ(3, op->ValueInputCount()); 289 EXPECT_EQ(3, op->ValueInputCount());
287 EXPECT_EQ(0, op->EffectInputCount()); 290 EXPECT_EQ(0, op->EffectInputCount());
288 EXPECT_EQ(0, op->ControlInputCount()); 291 EXPECT_EQ(0, op->ControlInputCount());
289 EXPECT_EQ(3, OperatorProperties::GetTotalInputCount(op)); 292 EXPECT_EQ(3, OperatorProperties::GetTotalInputCount(op));
290 EXPECT_EQ(1, op->ValueOutputCount()); 293 EXPECT_EQ(1, op->ValueOutputCount());
291 EXPECT_EQ(0, op->EffectOutputCount()); 294 EXPECT_EQ(0, op->EffectOutputCount());
292 EXPECT_EQ(0, op->ControlOutputCount()); 295 EXPECT_EQ(0, op->ControlOutputCount());
293 } 296 }
294 } 297 }
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
374 EXPECT_EQ(1, op->EffectInputCount()); 377 EXPECT_EQ(1, op->EffectInputCount());
375 EXPECT_EQ(2, OperatorProperties::GetTotalInputCount(op)); 378 EXPECT_EQ(2, OperatorProperties::GetTotalInputCount(op));
376 EXPECT_EQ(0, op->ControlOutputCount()); 379 EXPECT_EQ(0, op->ControlOutputCount());
377 EXPECT_EQ(1, op->EffectOutputCount()); 380 EXPECT_EQ(1, op->EffectOutputCount());
378 EXPECT_EQ(1, op->ValueOutputCount()); 381 EXPECT_EQ(1, op->ValueOutputCount());
379 } 382 }
380 383
381 } // namespace compiler 384 } // namespace compiler
382 } // namespace internal 385 } // namespace internal
383 } // namespace v8 386 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698