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 | 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 536 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
547 DCHECK_EQ(LeaveCC, i.OutputSBit()); | 547 DCHECK_EQ(LeaveCC, i.OutputSBit()); |
548 break; | 548 break; |
549 case kArmVdivF32: | 549 case kArmVdivF32: |
550 __ vdiv(i.OutputFloat32Register(), i.InputFloat32Register(0), | 550 __ vdiv(i.OutputFloat32Register(), i.InputFloat32Register(0), |
551 i.InputFloat32Register(1)); | 551 i.InputFloat32Register(1)); |
552 DCHECK_EQ(LeaveCC, i.OutputSBit()); | 552 DCHECK_EQ(LeaveCC, i.OutputSBit()); |
553 break; | 553 break; |
554 case kArmVsqrtF32: | 554 case kArmVsqrtF32: |
555 __ vsqrt(i.OutputFloat32Register(), i.InputFloat32Register(0)); | 555 __ vsqrt(i.OutputFloat32Register(), i.InputFloat32Register(0)); |
556 break; | 556 break; |
| 557 case kArmVabsF32: |
| 558 __ vabs(i.OutputFloat32Register(), i.InputFloat32Register(0)); |
| 559 break; |
557 case kArmVnegF32: | 560 case kArmVnegF32: |
558 __ vneg(i.OutputFloat32Register(), i.InputFloat32Register(0)); | 561 __ vneg(i.OutputFloat32Register(), i.InputFloat32Register(0)); |
559 break; | 562 break; |
560 case kArmVcmpF64: | 563 case kArmVcmpF64: |
561 if (instr->InputAt(1)->IsDoubleRegister()) { | 564 if (instr->InputAt(1)->IsDoubleRegister()) { |
562 __ VFPCompareAndSetFlags(i.InputFloat64Register(0), | 565 __ VFPCompareAndSetFlags(i.InputFloat64Register(0), |
563 i.InputFloat64Register(1)); | 566 i.InputFloat64Register(1)); |
564 } else { | 567 } else { |
565 DCHECK(instr->InputAt(1)->IsImmediate()); | 568 DCHECK(instr->InputAt(1)->IsImmediate()); |
566 // 0.0 is the only immediate supported by vcmp instructions. | 569 // 0.0 is the only immediate supported by vcmp instructions. |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
609 __ CallCFunction(ExternalReference::mod_two_doubles_operation(isolate()), | 612 __ CallCFunction(ExternalReference::mod_two_doubles_operation(isolate()), |
610 0, 2); | 613 0, 2); |
611 // Move the result in the double result register. | 614 // Move the result in the double result register. |
612 __ MovFromFloatResult(i.OutputFloat64Register()); | 615 __ MovFromFloatResult(i.OutputFloat64Register()); |
613 DCHECK_EQ(LeaveCC, i.OutputSBit()); | 616 DCHECK_EQ(LeaveCC, i.OutputSBit()); |
614 break; | 617 break; |
615 } | 618 } |
616 case kArmVsqrtF64: | 619 case kArmVsqrtF64: |
617 __ vsqrt(i.OutputFloat64Register(), i.InputFloat64Register(0)); | 620 __ vsqrt(i.OutputFloat64Register(), i.InputFloat64Register(0)); |
618 break; | 621 break; |
| 622 case kArmVabsF64: |
| 623 __ vabs(i.OutputFloat64Register(), i.InputFloat64Register(0)); |
| 624 break; |
619 case kArmVnegF64: | 625 case kArmVnegF64: |
620 __ vneg(i.OutputFloat64Register(), i.InputFloat64Register(0)); | 626 __ vneg(i.OutputFloat64Register(), i.InputFloat64Register(0)); |
621 break; | 627 break; |
622 case kArmVrintmF64: | 628 case kArmVrintmF64: |
623 __ vrintm(i.OutputFloat64Register(), i.InputFloat64Register(0)); | 629 __ vrintm(i.OutputFloat64Register(), i.InputFloat64Register(0)); |
624 break; | 630 break; |
625 case kArmVrintpF64: | 631 case kArmVrintpF64: |
626 __ vrintp(i.OutputFloat64Register(), i.InputFloat64Register(0)); | 632 __ vrintp(i.OutputFloat64Register(), i.InputFloat64Register(0)); |
627 break; | 633 break; |
628 case kArmVrintzF64: | 634 case kArmVrintzF64: |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
798 case kCheckedStoreWord32: | 804 case kCheckedStoreWord32: |
799 ASSEMBLE_CHECKED_STORE_INTEGER(str); | 805 ASSEMBLE_CHECKED_STORE_INTEGER(str); |
800 break; | 806 break; |
801 case kCheckedStoreFloat32: | 807 case kCheckedStoreFloat32: |
802 ASSEMBLE_CHECKED_STORE_FLOAT(32); | 808 ASSEMBLE_CHECKED_STORE_FLOAT(32); |
803 break; | 809 break; |
804 case kCheckedStoreFloat64: | 810 case kCheckedStoreFloat64: |
805 ASSEMBLE_CHECKED_STORE_FLOAT(64); | 811 ASSEMBLE_CHECKED_STORE_FLOAT(64); |
806 break; | 812 break; |
807 } | 813 } |
808 } | 814 } // NOLINT(readability/fn_size) |
809 | 815 |
810 | 816 |
811 // Assembles branches after an instruction. | 817 // Assembles branches after an instruction. |
812 void CodeGenerator::AssembleArchBranch(Instruction* instr, BranchInfo* branch) { | 818 void CodeGenerator::AssembleArchBranch(Instruction* instr, BranchInfo* branch) { |
813 ArmOperandConverter i(this, instr); | 819 ArmOperandConverter i(this, instr); |
814 Label* tlabel = branch->true_label; | 820 Label* tlabel = branch->true_label; |
815 Label* flabel = branch->false_label; | 821 Label* flabel = branch->false_label; |
816 Condition cc = FlagsConditionToCondition(branch->condition); | 822 Condition cc = FlagsConditionToCondition(branch->condition); |
817 __ b(cc, tlabel); | 823 __ b(cc, tlabel); |
818 if (!branch->fallthru) __ b(flabel); // no fallthru to flabel. | 824 if (!branch->fallthru) __ b(flabel); // no fallthru to flabel. |
(...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1157 } | 1163 } |
1158 } | 1164 } |
1159 MarkLazyDeoptSite(); | 1165 MarkLazyDeoptSite(); |
1160 } | 1166 } |
1161 | 1167 |
1162 #undef __ | 1168 #undef __ |
1163 | 1169 |
1164 } // namespace compiler | 1170 } // namespace compiler |
1165 } // namespace internal | 1171 } // namespace internal |
1166 } // namespace v8 | 1172 } // namespace v8 |
OLD | NEW |