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/ast/scopes.h" | 5 #include "src/ast/scopes.h" |
6 #include "src/compiler/code-generator.h" | 6 #include "src/compiler/code-generator.h" |
7 #include "src/compiler/code-generator-impl.h" | 7 #include "src/compiler/code-generator-impl.h" |
8 #include "src/compiler/gap-resolver.h" | 8 #include "src/compiler/gap-resolver.h" |
9 #include "src/compiler/node-matchers.h" | 9 #include "src/compiler/node-matchers.h" |
10 #include "src/compiler/osr.h" | 10 #include "src/compiler/osr.h" |
(...skipping 1023 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1034 break; | 1034 break; |
1035 case kMips64CvtDS: | 1035 case kMips64CvtDS: |
1036 __ cvt_d_s(i.OutputDoubleRegister(), i.InputSingleRegister(0)); | 1036 __ cvt_d_s(i.OutputDoubleRegister(), i.InputSingleRegister(0)); |
1037 break; | 1037 break; |
1038 case kMips64CvtDW: { | 1038 case kMips64CvtDW: { |
1039 FPURegister scratch = kScratchDoubleReg; | 1039 FPURegister scratch = kScratchDoubleReg; |
1040 __ mtc1(i.InputRegister(0), scratch); | 1040 __ mtc1(i.InputRegister(0), scratch); |
1041 __ cvt_d_w(i.OutputDoubleRegister(), scratch); | 1041 __ cvt_d_w(i.OutputDoubleRegister(), scratch); |
1042 break; | 1042 break; |
1043 } | 1043 } |
| 1044 case kMips64CvtSW: { |
| 1045 FPURegister scratch = kScratchDoubleReg; |
| 1046 __ mtc1(i.InputRegister(0), scratch); |
| 1047 __ cvt_s_w(i.OutputDoubleRegister(), scratch); |
| 1048 break; |
| 1049 } |
1044 case kMips64CvtSL: { | 1050 case kMips64CvtSL: { |
1045 FPURegister scratch = kScratchDoubleReg; | 1051 FPURegister scratch = kScratchDoubleReg; |
1046 __ dmtc1(i.InputRegister(0), scratch); | 1052 __ dmtc1(i.InputRegister(0), scratch); |
1047 __ cvt_s_l(i.OutputDoubleRegister(), scratch); | 1053 __ cvt_s_l(i.OutputDoubleRegister(), scratch); |
1048 break; | 1054 break; |
1049 } | 1055 } |
1050 case kMips64CvtDL: { | 1056 case kMips64CvtDL: { |
1051 FPURegister scratch = kScratchDoubleReg; | 1057 FPURegister scratch = kScratchDoubleReg; |
1052 __ dmtc1(i.InputRegister(0), scratch); | 1058 __ dmtc1(i.InputRegister(0), scratch); |
1053 __ cvt_d_l(i.OutputDoubleRegister(), scratch); | 1059 __ cvt_d_l(i.OutputDoubleRegister(), scratch); |
(...skipping 29 matching lines...) Expand all Loading... |
1083 __ mfc1(i.OutputRegister(), scratch); | 1089 __ mfc1(i.OutputRegister(), scratch); |
1084 break; | 1090 break; |
1085 } | 1091 } |
1086 case kMips64TruncWD: { | 1092 case kMips64TruncWD: { |
1087 FPURegister scratch = kScratchDoubleReg; | 1093 FPURegister scratch = kScratchDoubleReg; |
1088 // Other arches use round to zero here, so we follow. | 1094 // Other arches use round to zero here, so we follow. |
1089 __ trunc_w_d(scratch, i.InputDoubleRegister(0)); | 1095 __ trunc_w_d(scratch, i.InputDoubleRegister(0)); |
1090 __ mfc1(i.OutputRegister(), scratch); | 1096 __ mfc1(i.OutputRegister(), scratch); |
1091 break; | 1097 break; |
1092 } | 1098 } |
| 1099 case kMips64FloorWS: { |
| 1100 FPURegister scratch = kScratchDoubleReg; |
| 1101 __ floor_w_s(scratch, i.InputDoubleRegister(0)); |
| 1102 __ mfc1(i.OutputRegister(), scratch); |
| 1103 break; |
| 1104 } |
| 1105 case kMips64CeilWS: { |
| 1106 FPURegister scratch = kScratchDoubleReg; |
| 1107 __ ceil_w_s(scratch, i.InputDoubleRegister(0)); |
| 1108 __ mfc1(i.OutputRegister(), scratch); |
| 1109 break; |
| 1110 } |
| 1111 case kMips64RoundWS: { |
| 1112 FPURegister scratch = kScratchDoubleReg; |
| 1113 __ round_w_s(scratch, i.InputDoubleRegister(0)); |
| 1114 __ mfc1(i.OutputRegister(), scratch); |
| 1115 break; |
| 1116 } |
| 1117 case kMips64TruncWS: { |
| 1118 FPURegister scratch = kScratchDoubleReg; |
| 1119 __ trunc_w_s(scratch, i.InputDoubleRegister(0)); |
| 1120 __ mfc1(i.OutputRegister(), scratch); |
| 1121 break; |
| 1122 } |
1093 case kMips64TruncLS: { | 1123 case kMips64TruncLS: { |
1094 FPURegister scratch = kScratchDoubleReg; | 1124 FPURegister scratch = kScratchDoubleReg; |
1095 Register tmp_fcsr = kScratchReg; | 1125 Register tmp_fcsr = kScratchReg; |
1096 Register result = kScratchReg2; | 1126 Register result = kScratchReg2; |
1097 | 1127 |
1098 bool load_status = instr->OutputCount() > 1; | 1128 bool load_status = instr->OutputCount() > 1; |
1099 if (load_status) { | 1129 if (load_status) { |
1100 // Save FCSR. | 1130 // Save FCSR. |
1101 __ cfc1(tmp_fcsr, FCSR); | 1131 __ cfc1(tmp_fcsr, FCSR); |
1102 // Clear FPU flags. | 1132 // Clear FPU flags. |
(...skipping 783 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1886 padding_size -= v8::internal::Assembler::kInstrSize; | 1916 padding_size -= v8::internal::Assembler::kInstrSize; |
1887 } | 1917 } |
1888 } | 1918 } |
1889 } | 1919 } |
1890 | 1920 |
1891 #undef __ | 1921 #undef __ |
1892 | 1922 |
1893 } // namespace compiler | 1923 } // namespace compiler |
1894 } // namespace internal | 1924 } // namespace internal |
1895 } // namespace v8 | 1925 } // namespace v8 |
OLD | NEW |