Chromium Code Reviews| 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 "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 768 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 779 break; | 779 break; |
| 780 } | 780 } |
| 781 case kMips64Float64RoundTruncate: { | 781 case kMips64Float64RoundTruncate: { |
| 782 ASSEMBLE_ROUND_DOUBLE_TO_DOUBLE(trunc_l_d, Truncate); | 782 ASSEMBLE_ROUND_DOUBLE_TO_DOUBLE(trunc_l_d, Truncate); |
| 783 break; | 783 break; |
| 784 } | 784 } |
| 785 case kMips64Float64RoundUp: { | 785 case kMips64Float64RoundUp: { |
| 786 ASSEMBLE_ROUND_DOUBLE_TO_DOUBLE(ceil_l_d, Ceil); | 786 ASSEMBLE_ROUND_DOUBLE_TO_DOUBLE(ceil_l_d, Ceil); |
| 787 break; | 787 break; |
| 788 } | 788 } |
| 789 case kMips64Float64Max: { | |
| 790 // (b < a) ? a : b | |
| 791 if (kArchVariant == kMips64r6) { | |
|
paul.l...
2015/11/02 22:35:12
Please see comments in mips32 version, they all ap
| |
| 792 __ cmp(OLT, L, kScratchDoubleReg, i.InputDoubleRegister(0), | |
| 793 i.InputDoubleRegister(1)); | |
| 794 __ sel_d(i.OutputSingleRegister(), i.InputDoubleRegister(1), | |
| 795 kScratchDoubleReg); | |
| 796 } else { | |
| 797 __ c(OLT, D, i.InputDoubleRegister(0), i.InputDoubleRegister(1)); | |
| 798 // Left operand is result, passthrough if false. | |
| 799 __ movt_d(i.OutputSingleRegister(), i.InputDoubleRegister(1)); | |
| 800 } | |
| 801 break; | |
| 802 } | |
| 803 case kMips64Float64Min: { | |
| 804 // (a < b) ? a : b | |
| 805 if (kArchVariant == kMips64r6) { | |
| 806 __ cmp(OLT, L, kScratchDoubleReg, i.InputDoubleRegister(0), | |
| 807 i.InputDoubleRegister(1)); | |
| 808 __ sel_d(i.OutputSingleRegister(), i.InputDoubleRegister(1), | |
| 809 kScratchDoubleReg); | |
| 810 } else { | |
| 811 __ c(OLT, D, i.InputDoubleRegister(1), i.InputDoubleRegister(0)); | |
| 812 // Right operand is result, passthrough if false. | |
| 813 __ movt_d(i.OutputSingleRegister(), i.InputDoubleRegister(1)); | |
| 814 } | |
| 815 break; | |
| 816 } | |
| 817 case kMips64Float32Max: { | |
| 818 // (b < a) ? a : b | |
| 819 if (kArchVariant == kMips64r6) { | |
| 820 __ cmp(OLT, W, kScratchDoubleReg, i.InputDoubleRegister(0), | |
| 821 i.InputDoubleRegister(1)); | |
| 822 __ sel_s(i.OutputSingleRegister(), i.InputDoubleRegister(1), | |
| 823 kScratchDoubleReg); | |
| 824 } else { | |
| 825 __ c(OLT, S, i.InputDoubleRegister(0), i.InputDoubleRegister(1)); | |
| 826 // Left operand is result, passthrough if false. | |
| 827 __ movt_s(i.OutputSingleRegister(), i.InputDoubleRegister(1)); | |
| 828 } | |
| 829 break; | |
| 830 } | |
| 831 case kMips64Float32Min: { | |
| 832 // (a < b) ? a : b | |
| 833 if (kArchVariant == kMips64r6) { | |
| 834 __ cmp(OLT, W, kScratchDoubleReg, i.InputDoubleRegister(0), | |
| 835 i.InputDoubleRegister(1)); | |
| 836 __ sel_d(i.OutputSingleRegister(), i.InputDoubleRegister(1), | |
| 837 kScratchDoubleReg); | |
| 838 } else { | |
| 839 __ c(OLT, S, i.InputDoubleRegister(1), i.InputDoubleRegister(0)); | |
| 840 // Right operand is result, passthrough if false. | |
| 841 __ movt_s(i.OutputSingleRegister(), i.InputDoubleRegister(1)); | |
| 842 } | |
| 843 break; | |
| 844 } | |
| 789 case kMips64CvtSD: | 845 case kMips64CvtSD: |
| 790 __ cvt_s_d(i.OutputSingleRegister(), i.InputDoubleRegister(0)); | 846 __ cvt_s_d(i.OutputSingleRegister(), i.InputDoubleRegister(0)); |
| 791 break; | 847 break; |
| 792 case kMips64CvtDS: | 848 case kMips64CvtDS: |
| 793 __ cvt_d_s(i.OutputDoubleRegister(), i.InputSingleRegister(0)); | 849 __ cvt_d_s(i.OutputDoubleRegister(), i.InputSingleRegister(0)); |
| 794 break; | 850 break; |
| 795 case kMips64CvtDW: { | 851 case kMips64CvtDW: { |
| 796 FPURegister scratch = kScratchDoubleReg; | 852 FPURegister scratch = kScratchDoubleReg; |
| 797 __ mtc1(i.InputRegister(0), scratch); | 853 __ mtc1(i.InputRegister(0), scratch); |
| 798 __ cvt_d_w(i.OutputDoubleRegister(), scratch); | 854 __ cvt_d_w(i.OutputDoubleRegister(), scratch); |
| (...skipping 743 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1542 padding_size -= v8::internal::Assembler::kInstrSize; | 1598 padding_size -= v8::internal::Assembler::kInstrSize; |
| 1543 } | 1599 } |
| 1544 } | 1600 } |
| 1545 } | 1601 } |
| 1546 | 1602 |
| 1547 #undef __ | 1603 #undef __ |
| 1548 | 1604 |
| 1549 } // namespace compiler | 1605 } // namespace compiler |
| 1550 } // namespace internal | 1606 } // namespace internal |
| 1551 } // namespace v8 | 1607 } // namespace v8 |
| OLD | NEW |