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 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 }; | 206 }; |
207 | 207 |
208 | 208 |
209 class OutOfLineCeil final : public OutOfLineRound { | 209 class OutOfLineCeil final : public OutOfLineRound { |
210 public: | 210 public: |
211 OutOfLineCeil(CodeGenerator* gen, DoubleRegister result) | 211 OutOfLineCeil(CodeGenerator* gen, DoubleRegister result) |
212 : OutOfLineRound(gen, result) {} | 212 : OutOfLineRound(gen, result) {} |
213 }; | 213 }; |
214 | 214 |
215 | 215 |
| 216 class OutOfLineTiesEven final : public OutOfLineRound { |
| 217 public: |
| 218 OutOfLineTiesEven(CodeGenerator* gen, DoubleRegister result) |
| 219 : OutOfLineRound(gen, result) {} |
| 220 }; |
| 221 |
| 222 |
216 class OutOfLineRecordWrite final : public OutOfLineCode { | 223 class OutOfLineRecordWrite final : public OutOfLineCode { |
217 public: | 224 public: |
218 OutOfLineRecordWrite(CodeGenerator* gen, Register object, Register index, | 225 OutOfLineRecordWrite(CodeGenerator* gen, Register object, Register index, |
219 Register value, Register scratch0, Register scratch1, | 226 Register value, Register scratch0, Register scratch1, |
220 RecordWriteMode mode) | 227 RecordWriteMode mode) |
221 : OutOfLineCode(gen), | 228 : OutOfLineCode(gen), |
222 object_(object), | 229 object_(object), |
223 index_(index), | 230 index_(index), |
224 value_(value), | 231 value_(value), |
225 scratch0_(scratch0), | 232 scratch0_(scratch0), |
(...skipping 560 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
786 break; | 793 break; |
787 } | 794 } |
788 case kMipsFloat64RoundTruncate: { | 795 case kMipsFloat64RoundTruncate: { |
789 ASSEMBLE_ROUND_DOUBLE_TO_DOUBLE(trunc_l_d, Truncate); | 796 ASSEMBLE_ROUND_DOUBLE_TO_DOUBLE(trunc_l_d, Truncate); |
790 break; | 797 break; |
791 } | 798 } |
792 case kMipsFloat64RoundUp: { | 799 case kMipsFloat64RoundUp: { |
793 ASSEMBLE_ROUND_DOUBLE_TO_DOUBLE(ceil_l_d, Ceil); | 800 ASSEMBLE_ROUND_DOUBLE_TO_DOUBLE(ceil_l_d, Ceil); |
794 break; | 801 break; |
795 } | 802 } |
| 803 case kMipsFloat64RoundTiesEven: { |
| 804 ASSEMBLE_ROUND_DOUBLE_TO_DOUBLE(round_l_d, TiesEven); |
| 805 break; |
| 806 } |
796 case kMipsFloat64Max: { | 807 case kMipsFloat64Max: { |
797 // (b < a) ? a : b | 808 // (b < a) ? a : b |
798 if (IsMipsArchVariant(kMips32r6)) { | 809 if (IsMipsArchVariant(kMips32r6)) { |
799 __ cmp_d(OLT, i.OutputDoubleRegister(), i.InputDoubleRegister(1), | 810 __ cmp_d(OLT, i.OutputDoubleRegister(), i.InputDoubleRegister(1), |
800 i.InputDoubleRegister(0)); | 811 i.InputDoubleRegister(0)); |
801 __ sel_d(i.OutputDoubleRegister(), i.InputDoubleRegister(1), | 812 __ sel_d(i.OutputDoubleRegister(), i.InputDoubleRegister(1), |
802 i.InputDoubleRegister(0)); | 813 i.InputDoubleRegister(0)); |
803 } else { | 814 } else { |
804 __ c_d(OLT, i.InputDoubleRegister(0), i.InputDoubleRegister(1)); | 815 __ c_d(OLT, i.InputDoubleRegister(0), i.InputDoubleRegister(1)); |
805 // Left operand is result, passthrough if false. | 816 // Left operand is result, passthrough if false. |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
989 ASSEMBLE_CHECKED_STORE_FLOAT(Single, swc1); | 1000 ASSEMBLE_CHECKED_STORE_FLOAT(Single, swc1); |
990 break; | 1001 break; |
991 case kCheckedStoreFloat64: | 1002 case kCheckedStoreFloat64: |
992 ASSEMBLE_CHECKED_STORE_FLOAT(Double, sdc1); | 1003 ASSEMBLE_CHECKED_STORE_FLOAT(Double, sdc1); |
993 break; | 1004 break; |
994 case kCheckedLoadWord64: | 1005 case kCheckedLoadWord64: |
995 case kCheckedStoreWord64: | 1006 case kCheckedStoreWord64: |
996 UNREACHABLE(); // currently unsupported checked int64 load/store. | 1007 UNREACHABLE(); // currently unsupported checked int64 load/store. |
997 break; | 1008 break; |
998 } | 1009 } |
999 } | 1010 } // NOLINT(readability/fn_size) |
1000 | 1011 |
1001 | 1012 |
1002 #define UNSUPPORTED_COND(opcode, condition) \ | 1013 #define UNSUPPORTED_COND(opcode, condition) \ |
1003 OFStream out(stdout); \ | 1014 OFStream out(stdout); \ |
1004 out << "Unsupported " << #opcode << " condition: \"" << condition << "\""; \ | 1015 out << "Unsupported " << #opcode << " condition: \"" << condition << "\""; \ |
1005 UNIMPLEMENTED(); | 1016 UNIMPLEMENTED(); |
1006 | 1017 |
1007 static bool convertCondition(FlagsCondition condition, Condition& cc) { | 1018 static bool convertCondition(FlagsCondition condition, Condition& cc) { |
1008 switch (condition) { | 1019 switch (condition) { |
1009 case kEqual: | 1020 case kEqual: |
(...skipping 566 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1576 padding_size -= v8::internal::Assembler::kInstrSize; | 1587 padding_size -= v8::internal::Assembler::kInstrSize; |
1577 } | 1588 } |
1578 } | 1589 } |
1579 } | 1590 } |
1580 | 1591 |
1581 #undef __ | 1592 #undef __ |
1582 | 1593 |
1583 } // namespace compiler | 1594 } // namespace compiler |
1584 } // namespace internal | 1595 } // namespace internal |
1585 } // namespace v8 | 1596 } // namespace v8 |
OLD | NEW |