| OLD | NEW |
| 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 <algorithm> | 5 #include <algorithm> |
| 6 | 6 |
| 7 #include "src/compiler/instruction-selector-impl.h" | 7 #include "src/compiler/instruction-selector-impl.h" |
| 8 #include "src/compiler/node-matchers.h" | 8 #include "src/compiler/node-matchers.h" |
| 9 #include "src/compiler/node-properties.h" | 9 #include "src/compiler/node-properties.h" |
| 10 | 10 |
| (...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 359 | 359 |
| 360 // Shared routine for multiple binary operations. | 360 // Shared routine for multiple binary operations. |
| 361 static void VisitBinop(InstructionSelector* selector, Node* node, | 361 static void VisitBinop(InstructionSelector* selector, Node* node, |
| 362 InstructionCode opcode) { | 362 InstructionCode opcode) { |
| 363 FlagsContinuation cont; | 363 FlagsContinuation cont; |
| 364 VisitBinop(selector, node, opcode, &cont); | 364 VisitBinop(selector, node, opcode, &cont); |
| 365 } | 365 } |
| 366 | 366 |
| 367 | 367 |
| 368 void InstructionSelector::VisitWord32And(Node* node) { | 368 void InstructionSelector::VisitWord32And(Node* node) { |
| 369 VisitBinop(this, node, kX64And32); | 369 X64OperandGenerator g(this); |
| 370 Uint32BinopMatcher m(node); |
| 371 if (m.right().Is(0xff)) { |
| 372 Emit(kX64Movzxbl, g.DefineAsRegister(node), g.Use(m.left().node())); |
| 373 } else if (m.right().Is(0xffff)) { |
| 374 Emit(kX64Movzxwl, g.DefineAsRegister(node), g.Use(m.left().node())); |
| 375 } else { |
| 376 VisitBinop(this, node, kX64And32); |
| 377 } |
| 370 } | 378 } |
| 371 | 379 |
| 372 | 380 |
| 373 void InstructionSelector::VisitWord64And(Node* node) { | 381 void InstructionSelector::VisitWord64And(Node* node) { |
| 374 VisitBinop(this, node, kX64And); | 382 VisitBinop(this, node, kX64And); |
| 375 } | 383 } |
| 376 | 384 |
| 377 | 385 |
| 378 void InstructionSelector::VisitWord32Or(Node* node) { | 386 void InstructionSelector::VisitWord32Or(Node* node) { |
| 379 VisitBinop(this, node, kX64Or32); | 387 VisitBinop(this, node, kX64Or32); |
| (...skipping 997 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1377 MachineOperatorBuilder::kFloat64Ceil | | 1385 MachineOperatorBuilder::kFloat64Ceil | |
| 1378 MachineOperatorBuilder::kFloat64RoundTruncate | | 1386 MachineOperatorBuilder::kFloat64RoundTruncate | |
| 1379 MachineOperatorBuilder::kWord32ShiftIsSafe; | 1387 MachineOperatorBuilder::kWord32ShiftIsSafe; |
| 1380 } | 1388 } |
| 1381 return MachineOperatorBuilder::kNoFlags; | 1389 return MachineOperatorBuilder::kNoFlags; |
| 1382 } | 1390 } |
| 1383 | 1391 |
| 1384 } // namespace compiler | 1392 } // namespace compiler |
| 1385 } // namespace internal | 1393 } // namespace internal |
| 1386 } // namespace v8 | 1394 } // namespace v8 |
| OLD | NEW |