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 1180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1191 } | 1191 } |
1192 case kMipsFloat64RoundTiesEven: { | 1192 case kMipsFloat64RoundTiesEven: { |
1193 ASSEMBLE_ROUND_DOUBLE_TO_DOUBLE(round); | 1193 ASSEMBLE_ROUND_DOUBLE_TO_DOUBLE(round); |
1194 break; | 1194 break; |
1195 } | 1195 } |
1196 case kMipsFloat32RoundTiesEven: { | 1196 case kMipsFloat32RoundTiesEven: { |
1197 ASSEMBLE_ROUND_FLOAT_TO_FLOAT(round); | 1197 ASSEMBLE_ROUND_FLOAT_TO_FLOAT(round); |
1198 break; | 1198 break; |
1199 } | 1199 } |
1200 case kMipsFloat64Max: { | 1200 case kMipsFloat64Max: { |
1201 // (b < a) ? a : b | 1201 Label compare_nan, done_compare; |
1202 if (IsMipsArchVariant(kMips32r6)) { | 1202 __ MaxNaNCheck_d(i.OutputDoubleRegister(), i.InputDoubleRegister(0), |
1203 __ cmp_d(OLT, i.OutputDoubleRegister(), i.InputDoubleRegister(1), | 1203 i.InputDoubleRegister(1), &compare_nan); |
1204 i.InputDoubleRegister(0)); | 1204 __ Branch(&done_compare); |
1205 __ sel_d(i.OutputDoubleRegister(), i.InputDoubleRegister(1), | 1205 __ bind(&compare_nan); |
1206 i.InputDoubleRegister(0)); | 1206 __ Move(i.OutputDoubleRegister(), |
1207 } else { | 1207 std::numeric_limits<double>::quiet_NaN()); |
1208 __ c_d(OLT, i.InputDoubleRegister(0), i.InputDoubleRegister(1)); | 1208 __ bind(&done_compare); |
1209 // Left operand is result, passthrough if false. | |
1210 __ movt_d(i.OutputDoubleRegister(), i.InputDoubleRegister(1)); | |
1211 } | |
1212 break; | 1209 break; |
1213 } | 1210 } |
1214 case kMipsFloat64Min: { | 1211 case kMipsFloat64Min: { |
1215 // (a < b) ? a : b | 1212 Label compare_nan, done_compare; |
1216 if (IsMipsArchVariant(kMips32r6)) { | 1213 __ MinNaNCheck_d(i.OutputDoubleRegister(), i.InputDoubleRegister(0), |
1217 __ cmp_d(OLT, i.OutputDoubleRegister(), i.InputDoubleRegister(0), | 1214 i.InputDoubleRegister(1), &compare_nan); |
1218 i.InputDoubleRegister(1)); | 1215 __ Branch(&done_compare); |
1219 __ sel_d(i.OutputDoubleRegister(), i.InputDoubleRegister(1), | 1216 __ bind(&compare_nan); |
1220 i.InputDoubleRegister(0)); | 1217 __ Move(i.OutputDoubleRegister(), |
1221 } else { | 1218 std::numeric_limits<double>::quiet_NaN()); |
1222 __ c_d(OLT, i.InputDoubleRegister(1), i.InputDoubleRegister(0)); | 1219 __ bind(&done_compare); |
1223 // Right operand is result, passthrough if false. | |
1224 __ movt_d(i.OutputDoubleRegister(), i.InputDoubleRegister(1)); | |
1225 } | |
1226 break; | |
1227 } | |
1228 case kMipsFloat32Max: { | |
1229 // (b < a) ? a : b | |
1230 if (IsMipsArchVariant(kMips32r6)) { | |
1231 __ cmp_s(OLT, i.OutputDoubleRegister(), i.InputDoubleRegister(1), | |
1232 i.InputDoubleRegister(0)); | |
1233 __ sel_s(i.OutputDoubleRegister(), i.InputDoubleRegister(1), | |
1234 i.InputDoubleRegister(0)); | |
1235 } else { | |
1236 __ c_s(OLT, i.InputDoubleRegister(0), i.InputDoubleRegister(1)); | |
1237 // Left operand is result, passthrough if false. | |
1238 __ movt_s(i.OutputDoubleRegister(), i.InputDoubleRegister(1)); | |
1239 } | |
1240 break; | |
1241 } | |
1242 case kMipsFloat32Min: { | |
1243 // (a < b) ? a : b | |
1244 if (IsMipsArchVariant(kMips32r6)) { | |
1245 __ cmp_s(OLT, i.OutputDoubleRegister(), i.InputDoubleRegister(0), | |
1246 i.InputDoubleRegister(1)); | |
1247 __ sel_s(i.OutputDoubleRegister(), i.InputDoubleRegister(1), | |
1248 i.InputDoubleRegister(0)); | |
1249 } else { | |
1250 __ c_s(OLT, i.InputDoubleRegister(1), i.InputDoubleRegister(0)); | |
1251 // Right operand is result, passthrough if false. | |
1252 __ movt_s(i.OutputDoubleRegister(), i.InputDoubleRegister(1)); | |
1253 } | |
1254 break; | 1220 break; |
1255 } | 1221 } |
1256 case kMipsCvtSD: { | 1222 case kMipsCvtSD: { |
1257 __ cvt_s_d(i.OutputSingleRegister(), i.InputDoubleRegister(0)); | 1223 __ cvt_s_d(i.OutputSingleRegister(), i.InputDoubleRegister(0)); |
1258 break; | 1224 break; |
1259 } | 1225 } |
1260 case kMipsCvtDS: { | 1226 case kMipsCvtDS: { |
1261 __ cvt_d_s(i.OutputDoubleRegister(), i.InputSingleRegister(0)); | 1227 __ cvt_d_s(i.OutputDoubleRegister(), i.InputSingleRegister(0)); |
1262 break; | 1228 break; |
1263 } | 1229 } |
(...skipping 936 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2200 padding_size -= v8::internal::Assembler::kInstrSize; | 2166 padding_size -= v8::internal::Assembler::kInstrSize; |
2201 } | 2167 } |
2202 } | 2168 } |
2203 } | 2169 } |
2204 | 2170 |
2205 #undef __ | 2171 #undef __ |
2206 | 2172 |
2207 } // namespace compiler | 2173 } // namespace compiler |
2208 } // namespace internal | 2174 } // namespace internal |
2209 } // namespace v8 | 2175 } // namespace v8 |
OLD | NEW |