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

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

Issue 1504363002: [turbofan] Change TruncateFloat32ToInt64 to TryTruncateFloat32ToInt64. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Cleanup 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
« no previous file with comments | « src/compiler/mips64/code-generator-mips64.cc ('k') | src/compiler/opcodes.h » ('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 832 matching lines...) Expand 10 before | Expand all | Expand 10 after
843 } 843 }
844 VisitRR(this, kMips64TruncWD, node); 844 VisitRR(this, kMips64TruncWD, node);
845 } 845 }
846 846
847 847
848 void InstructionSelector::VisitChangeFloat64ToUint32(Node* node) { 848 void InstructionSelector::VisitChangeFloat64ToUint32(Node* node) {
849 VisitRR(this, kMips64TruncUwD, node); 849 VisitRR(this, kMips64TruncUwD, node);
850 } 850 }
851 851
852 852
853 void InstructionSelector::VisitTruncateFloat32ToInt64(Node* node) { 853 void InstructionSelector::VisitTryTruncateFloat32ToInt64(Node* node) {
854 VisitRR(this, kMips64TruncLS, node); 854 Mips64OperandGenerator g(this);
855 InstructionOperand inputs[] = {g.UseRegister(node->InputAt(0))};
856 InstructionOperand outputs[2];
857 size_t output_count = 0;
858 outputs[output_count++] = g.DefineAsRegister(node);
859
860 Node* success_output = NodeProperties::FindProjection(node, 1);
861 if (success_output) {
862 outputs[output_count++] = g.DefineAsRegister(success_output);
863 }
864
865 this->Emit(kMips64TruncLS, output_count, outputs, 1, inputs);
855 } 866 }
856 867
857 868
858 void InstructionSelector::VisitTryTruncateFloat64ToInt64(Node* node) { 869 void InstructionSelector::VisitTryTruncateFloat64ToInt64(Node* node) {
859 Mips64OperandGenerator g(this); 870 Mips64OperandGenerator g(this);
860 InstructionOperand inputs[] = {g.UseRegister(node->InputAt(0))}; 871 InstructionOperand inputs[] = {g.UseRegister(node->InputAt(0))};
861 InstructionOperand outputs[2]; 872 InstructionOperand outputs[2];
862 size_t output_count = 0; 873 size_t output_count = 0;
863 outputs[output_count++] = g.DefineAsRegister(node); 874 outputs[output_count++] = g.DefineAsRegister(node);
864 875
(...skipping 657 matching lines...) Expand 10 before | Expand all | Expand 10 after
1522 Node* const node = value->InputAt(0); 1533 Node* const node = value->InputAt(0);
1523 Node* const result = NodeProperties::FindProjection(node, 0); 1534 Node* const result = NodeProperties::FindProjection(node, 0);
1524 if (result == NULL || selector->IsDefined(result)) { 1535 if (result == NULL || selector->IsDefined(result)) {
1525 switch (node->opcode()) { 1536 switch (node->opcode()) {
1526 case IrOpcode::kInt32AddWithOverflow: 1537 case IrOpcode::kInt32AddWithOverflow:
1527 cont->OverwriteAndNegateIfEqual(kOverflow); 1538 cont->OverwriteAndNegateIfEqual(kOverflow);
1528 return VisitBinop(selector, node, kMips64Dadd, cont); 1539 return VisitBinop(selector, node, kMips64Dadd, cont);
1529 case IrOpcode::kInt32SubWithOverflow: 1540 case IrOpcode::kInt32SubWithOverflow:
1530 cont->OverwriteAndNegateIfEqual(kOverflow); 1541 cont->OverwriteAndNegateIfEqual(kOverflow);
1531 return VisitBinop(selector, node, kMips64Dsub, cont); 1542 return VisitBinop(selector, node, kMips64Dsub, cont);
1543 case IrOpcode::kTryTruncateFloat32ToInt64:
titzer 2015/12/09 11:40:35 Drop this case as per explanation on other CL.
1544 return VisitTryTruncFloat32ToInt64(selector, result);
1532 default: 1545 default:
1533 break; 1546 break;
1534 } 1547 }
1535 } 1548 }
1536 } 1549 }
1537 break; 1550 break;
1538 case IrOpcode::kWord32And: 1551 case IrOpcode::kWord32And:
1539 case IrOpcode::kWord64And: 1552 case IrOpcode::kWord64And:
1540 return VisitWordCompare(selector, value, kMips64Tst, cont, true); 1553 return VisitWordCompare(selector, value, kMips64Tst, cont, true);
1541 default: 1554 default:
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
1754 MachineOperatorBuilder::kFloat32RoundUp | 1767 MachineOperatorBuilder::kFloat32RoundUp |
1755 MachineOperatorBuilder::kFloat64RoundTruncate | 1768 MachineOperatorBuilder::kFloat64RoundTruncate |
1756 MachineOperatorBuilder::kFloat32RoundTruncate | 1769 MachineOperatorBuilder::kFloat32RoundTruncate |
1757 MachineOperatorBuilder::kFloat64RoundTiesEven | 1770 MachineOperatorBuilder::kFloat64RoundTiesEven |
1758 MachineOperatorBuilder::kFloat32RoundTiesEven; 1771 MachineOperatorBuilder::kFloat32RoundTiesEven;
1759 } 1772 }
1760 1773
1761 } // namespace compiler 1774 } // namespace compiler
1762 } // namespace internal 1775 } // namespace internal
1763 } // namespace v8 1776 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/mips64/code-generator-mips64.cc ('k') | src/compiler/opcodes.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698