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

Side by Side Diff: src/compiler/mips/code-generator-mips.cc

Issue 1419753008: MIPS: [turbofan] Properly implement Float64/32 Min/Max instructions. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Remove redundant functions. Created 5 years, 1 month 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 | « no previous file | src/compiler/mips/instruction-codes-mips.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/compiler/code-generator.h" 5 #include "src/compiler/code-generator.h"
6 #include "src/compiler/code-generator-impl.h" 6 #include "src/compiler/code-generator-impl.h"
7 #include "src/compiler/gap-resolver.h" 7 #include "src/compiler/gap-resolver.h"
8 #include "src/compiler/node-matchers.h" 8 #include "src/compiler/node-matchers.h"
9 #include "src/compiler/osr.h" 9 #include "src/compiler/osr.h"
10 #include "src/mips/macro-assembler-mips.h" 10 #include "src/mips/macro-assembler-mips.h"
(...skipping 703 matching lines...) Expand 10 before | Expand all | Expand 10 after
714 break; 714 break;
715 } 715 }
716 case kMipsFloat64RoundTruncate: { 716 case kMipsFloat64RoundTruncate: {
717 ASSEMBLE_ROUND_DOUBLE_TO_DOUBLE(trunc_l_d, Truncate); 717 ASSEMBLE_ROUND_DOUBLE_TO_DOUBLE(trunc_l_d, Truncate);
718 break; 718 break;
719 } 719 }
720 case kMipsFloat64RoundUp: { 720 case kMipsFloat64RoundUp: {
721 ASSEMBLE_ROUND_DOUBLE_TO_DOUBLE(ceil_l_d, Ceil); 721 ASSEMBLE_ROUND_DOUBLE_TO_DOUBLE(ceil_l_d, Ceil);
722 break; 722 break;
723 } 723 }
724 case kMipsFloat64Max: {
725 // (b < a) ? a : b
726 if (IsMipsArchVariant(kMips32r6)) {
727 __ cmp_d(OLT, i.OutputDoubleRegister(), i.InputDoubleRegister(1),
728 i.InputDoubleRegister(0));
729 __ sel_d(i.OutputDoubleRegister(), i.InputDoubleRegister(1),
730 i.InputDoubleRegister(0));
731 } else {
732 __ c_d(OLT, i.InputDoubleRegister(0), i.InputDoubleRegister(1));
733 // Left operand is result, passthrough if false.
734 __ movt_d(i.OutputDoubleRegister(), i.InputDoubleRegister(1));
735 }
736 break;
737 }
738 case kMipsFloat64Min: {
739 // (a < b) ? a : b
740 if (IsMipsArchVariant(kMips32r6)) {
741 __ cmp_d(OLT, i.OutputDoubleRegister(), i.InputDoubleRegister(0),
742 i.InputDoubleRegister(1));
743 __ sel_d(i.OutputDoubleRegister(), i.InputDoubleRegister(1),
744 i.InputDoubleRegister(0));
745 } else {
746 __ c_d(OLT, i.InputDoubleRegister(1), i.InputDoubleRegister(0));
747 // Right operand is result, passthrough if false.
748 __ movt_d(i.OutputDoubleRegister(), i.InputDoubleRegister(1));
749 }
750 break;
751 }
752 case kMipsFloat32Max: {
753 // (b < a) ? a : b
754 if (IsMipsArchVariant(kMips32r6)) {
755 __ cmp_s(OLT, i.OutputDoubleRegister(), i.InputDoubleRegister(1),
756 i.InputDoubleRegister(0));
757 __ sel_s(i.OutputDoubleRegister(), i.InputDoubleRegister(1),
758 i.InputDoubleRegister(0));
759 } else {
760 __ c_s(OLT, i.InputDoubleRegister(0), i.InputDoubleRegister(1));
761 // Left operand is result, passthrough if false.
762 __ movt_s(i.OutputDoubleRegister(), i.InputDoubleRegister(1));
763 }
764 break;
765 }
766 case kMipsFloat32Min: {
767 // (a < b) ? a : b
768 if (IsMipsArchVariant(kMips32r6)) {
769 __ cmp_s(OLT, i.OutputDoubleRegister(), i.InputDoubleRegister(0),
770 i.InputDoubleRegister(1));
771 __ sel_s(i.OutputDoubleRegister(), i.InputDoubleRegister(1),
772 i.InputDoubleRegister(0));
773 } else {
774 __ c_s(OLT, i.InputDoubleRegister(1), i.InputDoubleRegister(0));
775 // Right operand is result, passthrough if false.
776 __ movt_s(i.OutputDoubleRegister(), i.InputDoubleRegister(1));
777 }
778 break;
779 }
724 case kMipsCvtSD: { 780 case kMipsCvtSD: {
725 __ cvt_s_d(i.OutputSingleRegister(), i.InputDoubleRegister(0)); 781 __ cvt_s_d(i.OutputSingleRegister(), i.InputDoubleRegister(0));
726 break; 782 break;
727 } 783 }
728 case kMipsCvtDS: { 784 case kMipsCvtDS: {
729 __ cvt_d_s(i.OutputDoubleRegister(), i.InputSingleRegister(0)); 785 __ cvt_d_s(i.OutputDoubleRegister(), i.InputSingleRegister(0));
730 break; 786 break;
731 } 787 }
732 case kMipsCvtDW: { 788 case kMipsCvtDW: {
733 FPURegister scratch = kScratchDoubleReg; 789 FPURegister scratch = kScratchDoubleReg;
(...skipping 726 matching lines...) Expand 10 before | Expand all | Expand 10 after
1460 padding_size -= v8::internal::Assembler::kInstrSize; 1516 padding_size -= v8::internal::Assembler::kInstrSize;
1461 } 1517 }
1462 } 1518 }
1463 } 1519 }
1464 1520
1465 #undef __ 1521 #undef __
1466 1522
1467 } // namespace compiler 1523 } // namespace compiler
1468 } // namespace internal 1524 } // namespace internal
1469 } // namespace v8 1525 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/compiler/mips/instruction-codes-mips.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698