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/arm/code-generator-arm.cc

Issue 1044793002: [turbofan] Add backend support for float32 operations. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Add MachineOperator unit tests. Created 5 years, 8 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/arm/macro-assembler-arm.h" 7 #include "src/arm/macro-assembler-arm.h"
8 #include "src/compiler/code-generator-impl.h" 8 #include "src/compiler/code-generator-impl.h"
9 #include "src/compiler/gap-resolver.h" 9 #include "src/compiler/gap-resolver.h"
10 #include "src/compiler/node-matchers.h" 10 #include "src/compiler/node-matchers.h"
(...skipping 491 matching lines...) Expand 10 before | Expand all | Expand 10 after
502 DCHECK_EQ(SetCC, i.OutputSBit()); 502 DCHECK_EQ(SetCC, i.OutputSBit());
503 break; 503 break;
504 case kArmTst: 504 case kArmTst:
505 __ tst(i.InputRegister(0), i.InputOperand2(1)); 505 __ tst(i.InputRegister(0), i.InputOperand2(1));
506 DCHECK_EQ(SetCC, i.OutputSBit()); 506 DCHECK_EQ(SetCC, i.OutputSBit());
507 break; 507 break;
508 case kArmTeq: 508 case kArmTeq:
509 __ teq(i.InputRegister(0), i.InputOperand2(1)); 509 __ teq(i.InputRegister(0), i.InputOperand2(1));
510 DCHECK_EQ(SetCC, i.OutputSBit()); 510 DCHECK_EQ(SetCC, i.OutputSBit());
511 break; 511 break;
512 case kArmVcmpF32:
513 if (instr->InputAt(1)->IsDoubleRegister()) {
514 __ VFPCompareAndSetFlags(i.InputFloat32Register(0),
515 i.InputFloat32Register(1));
516 } else {
517 DCHECK(instr->InputAt(1)->IsImmediate());
518 // 0.0 is the only immediate supported by vcmp instructions.
519 DCHECK(i.InputDouble(1) == 0.0);
520 __ VFPCompareAndSetFlags(i.InputFloat32Register(0), i.InputDouble(1));
521 }
522 DCHECK_EQ(SetCC, i.OutputSBit());
523 break;
524 case kArmVaddF32:
525 __ vadd(i.OutputFloat32Register(), i.InputFloat32Register(0),
526 i.InputFloat32Register(1));
527 DCHECK_EQ(LeaveCC, i.OutputSBit());
528 break;
529 case kArmVsubF32:
530 __ vsub(i.OutputFloat32Register(), i.InputFloat32Register(0),
531 i.InputFloat32Register(1));
532 DCHECK_EQ(LeaveCC, i.OutputSBit());
533 break;
534 case kArmVmulF32:
535 __ vmul(i.OutputFloat32Register(), i.InputFloat32Register(0),
536 i.InputFloat32Register(1));
537 DCHECK_EQ(LeaveCC, i.OutputSBit());
538 break;
539 case kArmVmlaF32:
540 __ vmla(i.OutputFloat32Register(), i.InputFloat32Register(1),
541 i.InputFloat32Register(2));
542 DCHECK_EQ(LeaveCC, i.OutputSBit());
543 break;
544 case kArmVmlsF32:
545 __ vmls(i.OutputFloat32Register(), i.InputFloat32Register(1),
546 i.InputFloat32Register(2));
547 DCHECK_EQ(LeaveCC, i.OutputSBit());
548 break;
549 case kArmVdivF32:
550 __ vdiv(i.OutputFloat32Register(), i.InputFloat32Register(0),
551 i.InputFloat32Register(1));
552 DCHECK_EQ(LeaveCC, i.OutputSBit());
553 break;
554 case kArmVsqrtF32:
555 __ vsqrt(i.OutputFloat32Register(), i.InputFloat32Register(0));
556 break;
557 case kArmVnegF32:
558 __ vneg(i.OutputFloat32Register(), i.InputFloat32Register(0));
559 break;
512 case kArmVcmpF64: 560 case kArmVcmpF64:
513 if (instr->InputAt(1)->IsDoubleRegister()) { 561 if (instr->InputAt(1)->IsDoubleRegister()) {
514 __ VFPCompareAndSetFlags(i.InputFloat64Register(0), 562 __ VFPCompareAndSetFlags(i.InputFloat64Register(0),
515 i.InputFloat64Register(1)); 563 i.InputFloat64Register(1));
516 } else { 564 } else {
517 DCHECK(instr->InputAt(1)->IsImmediate()); 565 DCHECK(instr->InputAt(1)->IsImmediate());
518 // 0.0 is the only immediate supported by vcmp instructions. 566 // 0.0 is the only immediate supported by vcmp instructions.
519 DCHECK(i.InputDouble(1) == 0.0); 567 DCHECK(i.InputDouble(1) == 0.0);
520 __ VFPCompareAndSetFlags(i.InputFloat64Register(0), i.InputDouble(1)); 568 __ VFPCompareAndSetFlags(i.InputFloat64Register(0), i.InputDouble(1));
521 } 569 }
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
561 __ CallCFunction(ExternalReference::mod_two_doubles_operation(isolate()), 609 __ CallCFunction(ExternalReference::mod_two_doubles_operation(isolate()),
562 0, 2); 610 0, 2);
563 // Move the result in the double result register. 611 // Move the result in the double result register.
564 __ MovFromFloatResult(i.OutputFloat64Register()); 612 __ MovFromFloatResult(i.OutputFloat64Register());
565 DCHECK_EQ(LeaveCC, i.OutputSBit()); 613 DCHECK_EQ(LeaveCC, i.OutputSBit());
566 break; 614 break;
567 } 615 }
568 case kArmVsqrtF64: 616 case kArmVsqrtF64:
569 __ vsqrt(i.OutputFloat64Register(), i.InputFloat64Register(0)); 617 __ vsqrt(i.OutputFloat64Register(), i.InputFloat64Register(0));
570 break; 618 break;
619 case kArmVnegF64:
620 __ vneg(i.OutputFloat64Register(), i.InputFloat64Register(0));
621 break;
571 case kArmVrintmF64: 622 case kArmVrintmF64:
572 __ vrintm(i.OutputFloat64Register(), i.InputFloat64Register(0)); 623 __ vrintm(i.OutputFloat64Register(), i.InputFloat64Register(0));
573 break; 624 break;
574 case kArmVrintpF64: 625 case kArmVrintpF64:
575 __ vrintp(i.OutputFloat64Register(), i.InputFloat64Register(0)); 626 __ vrintp(i.OutputFloat64Register(), i.InputFloat64Register(0));
576 break; 627 break;
577 case kArmVrintzF64: 628 case kArmVrintzF64:
578 __ vrintz(i.OutputFloat64Register(), i.InputFloat64Register(0)); 629 __ vrintz(i.OutputFloat64Register(), i.InputFloat64Register(0));
579 break; 630 break;
580 case kArmVrintaF64: 631 case kArmVrintaF64:
581 __ vrinta(i.OutputFloat64Register(), i.InputFloat64Register(0)); 632 __ vrinta(i.OutputFloat64Register(), i.InputFloat64Register(0));
582 break; 633 break;
583 case kArmVnegF64:
584 __ vneg(i.OutputFloat64Register(), i.InputFloat64Register(0));
585 break;
586 case kArmVcvtF32F64: { 634 case kArmVcvtF32F64: {
587 __ vcvt_f32_f64(i.OutputFloat32Register(), i.InputFloat64Register(0)); 635 __ vcvt_f32_f64(i.OutputFloat32Register(), i.InputFloat64Register(0));
588 DCHECK_EQ(LeaveCC, i.OutputSBit()); 636 DCHECK_EQ(LeaveCC, i.OutputSBit());
589 break; 637 break;
590 } 638 }
591 case kArmVcvtF64F32: { 639 case kArmVcvtF64F32: {
592 __ vcvt_f64_f32(i.OutputFloat64Register(), i.InputFloat32Register(0)); 640 __ vcvt_f64_f32(i.OutputFloat64Register(), i.InputFloat32Register(0));
593 DCHECK_EQ(LeaveCC, i.OutputSBit()); 641 DCHECK_EQ(LeaveCC, i.OutputSBit());
594 break; 642 break;
595 } 643 }
(...skipping 512 matching lines...) Expand 10 before | Expand all | Expand 10 after
1108 } 1156 }
1109 } 1157 }
1110 MarkLazyDeoptSite(); 1158 MarkLazyDeoptSite();
1111 } 1159 }
1112 1160
1113 #undef __ 1161 #undef __
1114 1162
1115 } // namespace compiler 1163 } // namespace compiler
1116 } // namespace internal 1164 } // namespace internal
1117 } // namespace v8 1165 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698