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

Side by Side Diff: src/compiler/mips/instruction-selector-mips.cc

Issue 1583323004: [turbofan] Add the TruncateFloat32ToInt32 operator to turbofan. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fixed a small bug Created 4 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
« no previous file with comments | « src/compiler/machine-operator.cc ('k') | src/compiler/mips64/instruction-selector-mips64.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/base/adapters.h" 5 #include "src/base/adapters.h"
6 #include "src/base/bits.h" 6 #include "src/base/bits.h"
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 495 matching lines...) Expand 10 before | Expand all | Expand 10 after
506 void InstructionSelector::VisitChangeInt32ToFloat64(Node* node) { 506 void InstructionSelector::VisitChangeInt32ToFloat64(Node* node) {
507 VisitRR(this, kMipsCvtDW, node); 507 VisitRR(this, kMipsCvtDW, node);
508 } 508 }
509 509
510 510
511 void InstructionSelector::VisitChangeUint32ToFloat64(Node* node) { 511 void InstructionSelector::VisitChangeUint32ToFloat64(Node* node) {
512 VisitRR(this, kMipsCvtDUw, node); 512 VisitRR(this, kMipsCvtDUw, node);
513 } 513 }
514 514
515 515
516 void InstructionSelector::VisitTruncateFloat32ToInt32(Node* node) {
517 VisitRR(this, kMipsTruncWS, node);
518 }
519
520
516 void InstructionSelector::VisitChangeFloat64ToInt32(Node* node) { 521 void InstructionSelector::VisitChangeFloat64ToInt32(Node* node) {
517 MipsOperandGenerator g(this); 522 MipsOperandGenerator g(this);
518 Node* value = node->InputAt(0); 523 Node* value = node->InputAt(0);
519 // Match ChangeFloat64ToInt32(Float64Round##OP) to corresponding instruction 524 // Match ChangeFloat64ToInt32(Float64Round##OP) to corresponding instruction
520 // which does rounding and conversion to integer format. 525 // which does rounding and conversion to integer format.
521 if (CanCover(node, value)) { 526 if (CanCover(node, value)) {
522 switch (value->opcode()) { 527 switch (value->opcode()) {
523 case IrOpcode::kFloat64RoundDown: 528 case IrOpcode::kFloat64RoundDown:
524 Emit(kMipsFloorWD, g.DefineAsRegister(node), 529 Emit(kMipsFloorWD, g.DefineAsRegister(node),
525 g.UseRegister(value->InputAt(0))); 530 g.UseRegister(value->InputAt(0)));
(...skipping 801 matching lines...) Expand 10 before | Expand all | Expand 10 after
1327 MachineOperatorBuilder::kFloat32Max | 1332 MachineOperatorBuilder::kFloat32Max |
1328 MachineOperatorBuilder::kFloat32RoundDown | 1333 MachineOperatorBuilder::kFloat32RoundDown |
1329 MachineOperatorBuilder::kFloat32RoundUp | 1334 MachineOperatorBuilder::kFloat32RoundUp |
1330 MachineOperatorBuilder::kFloat32RoundTruncate | 1335 MachineOperatorBuilder::kFloat32RoundTruncate |
1331 MachineOperatorBuilder::kFloat32RoundTiesEven; 1336 MachineOperatorBuilder::kFloat32RoundTiesEven;
1332 } 1337 }
1333 1338
1334 } // namespace compiler 1339 } // namespace compiler
1335 } // namespace internal 1340 } // namespace internal
1336 } // namespace v8 1341 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/machine-operator.cc ('k') | src/compiler/mips64/instruction-selector-mips64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698