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

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

Issue 2170343002: [turbofan] Change Float64Max/Float64Min to JavaScript semantics. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: mips/mips64 ports. Created 4 years, 5 months 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
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 6
7 #include "src/arm64/frames-arm64.h" 7 #include "src/arm64/frames-arm64.h"
8 #include "src/arm64/macro-assembler-arm64.h" 8 #include "src/arm64/macro-assembler-arm64.h"
9 #include "src/ast/scopes.h" 9 #include "src/ast/scopes.h"
10 #include "src/compiler/code-generator-impl.h" 10 #include "src/compiler/code-generator-impl.h"
(...skipping 1296 matching lines...) Expand 10 before | Expand all | Expand 10 after
1307 i.InputFloat32Register(1)); 1307 i.InputFloat32Register(1));
1308 break; 1308 break;
1309 case kArm64Float32Mul: 1309 case kArm64Float32Mul:
1310 __ Fmul(i.OutputFloat32Register(), i.InputFloat32Register(0), 1310 __ Fmul(i.OutputFloat32Register(), i.InputFloat32Register(0),
1311 i.InputFloat32Register(1)); 1311 i.InputFloat32Register(1));
1312 break; 1312 break;
1313 case kArm64Float32Div: 1313 case kArm64Float32Div:
1314 __ Fdiv(i.OutputFloat32Register(), i.InputFloat32Register(0), 1314 __ Fdiv(i.OutputFloat32Register(), i.InputFloat32Register(0),
1315 i.InputFloat32Register(1)); 1315 i.InputFloat32Register(1));
1316 break; 1316 break;
1317 case kArm64Float32Max:
1318 // (b < a) ? a : b
1319 __ Fcmp(i.InputFloat32Register(1), i.InputFloat32Register(0));
1320 __ Fcsel(i.OutputFloat32Register(), i.InputFloat32Register(0),
1321 i.InputFloat32Register(1), lo);
1322 break;
1323 case kArm64Float32Min:
1324 // (a < b) ? a : b
1325 __ Fcmp(i.InputFloat32Register(0), i.InputFloat32Register(1));
1326 __ Fcsel(i.OutputFloat32Register(), i.InputFloat32Register(0),
1327 i.InputFloat32Register(1), lo);
1328 break;
1329 case kArm64Float32Abs: 1317 case kArm64Float32Abs:
1330 __ Fabs(i.OutputFloat32Register(), i.InputFloat32Register(0)); 1318 __ Fabs(i.OutputFloat32Register(), i.InputFloat32Register(0));
1331 break; 1319 break;
1332 case kArm64Float32Neg: 1320 case kArm64Float32Neg:
1333 __ Fneg(i.OutputFloat32Register(), i.InputFloat32Register(0)); 1321 __ Fneg(i.OutputFloat32Register(), i.InputFloat32Register(0));
1334 break; 1322 break;
1335 case kArm64Float32Sqrt: 1323 case kArm64Float32Sqrt:
1336 __ Fsqrt(i.OutputFloat32Register(), i.InputFloat32Register(0)); 1324 __ Fsqrt(i.OutputFloat32Register(), i.InputFloat32Register(0));
1337 break; 1325 break;
1338 case kArm64Float64Cmp: 1326 case kArm64Float64Cmp:
(...skipping 26 matching lines...) Expand all
1365 // TODO(dcarney): implement directly. See note in lithium-codegen-arm64.cc 1353 // TODO(dcarney): implement directly. See note in lithium-codegen-arm64.cc
1366 FrameScope scope(masm(), StackFrame::MANUAL); 1354 FrameScope scope(masm(), StackFrame::MANUAL);
1367 DCHECK(d0.is(i.InputDoubleRegister(0))); 1355 DCHECK(d0.is(i.InputDoubleRegister(0)));
1368 DCHECK(d1.is(i.InputDoubleRegister(1))); 1356 DCHECK(d1.is(i.InputDoubleRegister(1)));
1369 DCHECK(d0.is(i.OutputDoubleRegister())); 1357 DCHECK(d0.is(i.OutputDoubleRegister()));
1370 // TODO(dcarney): make sure this saves all relevant registers. 1358 // TODO(dcarney): make sure this saves all relevant registers.
1371 __ CallCFunction(ExternalReference::mod_two_doubles_operation(isolate()), 1359 __ CallCFunction(ExternalReference::mod_two_doubles_operation(isolate()),
1372 0, 2); 1360 0, 2);
1373 break; 1361 break;
1374 } 1362 }
1375 case kArm64Float64Max: 1363 case kArm64Float64Max: {
1376 // (b < a) ? a : b 1364 __ Fmax(i.OutputDoubleRegister(), i.InputDoubleRegister(0),
1377 __ Fcmp(i.InputDoubleRegister(1), i.InputDoubleRegister(0)); 1365 i.InputDoubleRegister(1));
1378 __ Fcsel(i.OutputDoubleRegister(), i.InputDoubleRegister(0),
1379 i.InputDoubleRegister(1), lo);
1380 break; 1366 break;
1381 case kArm64Float64Min: 1367 }
1382 // (a < b) ? a : b 1368 case kArm64Float64Min: {
1383 __ Fcmp(i.InputDoubleRegister(0), i.InputDoubleRegister(1)); 1369 __ Fmin(i.OutputDoubleRegister(), i.InputDoubleRegister(0),
1384 __ Fcsel(i.OutputDoubleRegister(), i.InputDoubleRegister(0), 1370 i.InputDoubleRegister(1));
1385 i.InputDoubleRegister(1), lo);
1386 break; 1371 break;
1372 }
1387 case kArm64Float64Abs: 1373 case kArm64Float64Abs:
1388 __ Fabs(i.OutputDoubleRegister(), i.InputDoubleRegister(0)); 1374 __ Fabs(i.OutputDoubleRegister(), i.InputDoubleRegister(0));
1389 break; 1375 break;
1390 case kArm64Float64Neg: 1376 case kArm64Float64Neg:
1391 __ Fneg(i.OutputDoubleRegister(), i.InputDoubleRegister(0)); 1377 __ Fneg(i.OutputDoubleRegister(), i.InputDoubleRegister(0));
1392 break; 1378 break;
1393 case kArm64Float64Sqrt: 1379 case kArm64Float64Sqrt:
1394 __ Fsqrt(i.OutputDoubleRegister(), i.InputDoubleRegister(0)); 1380 __ Fsqrt(i.OutputDoubleRegister(), i.InputDoubleRegister(0));
1395 break; 1381 break;
1396 case kArm64Float32ToFloat64: 1382 case kArm64Float32ToFloat64:
(...skipping 686 matching lines...) Expand 10 before | Expand all | Expand 10 after
2083 padding_size -= kInstructionSize; 2069 padding_size -= kInstructionSize;
2084 } 2070 }
2085 } 2071 }
2086 } 2072 }
2087 2073
2088 #undef __ 2074 #undef __
2089 2075
2090 } // namespace compiler 2076 } // namespace compiler
2091 } // namespace internal 2077 } // namespace internal
2092 } // namespace v8 2078 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/arm/instruction-selector-arm.cc ('k') | src/compiler/arm64/instruction-codes-arm64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698