OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #ifndef VM_ASSEMBLER_ARM64_H_ | 5 #ifndef VM_ASSEMBLER_ARM64_H_ |
6 #define VM_ASSEMBLER_ARM64_H_ | 6 #define VM_ASSEMBLER_ARM64_H_ |
7 | 7 |
8 #ifndef VM_ASSEMBLER_H_ | 8 #ifndef VM_ASSEMBLER_H_ |
9 #error Do not include assembler_arm64.h directly; use assembler.h instead. | 9 #error Do not include assembler_arm64.h directly; use assembler.h instead. |
10 #endif | 10 #endif |
(...skipping 715 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
726 void fdivd(VRegister vd, VRegister vn, VRegister vm) { | 726 void fdivd(VRegister vd, VRegister vn, VRegister vm) { |
727 EmitFPTwoSourceOp(FDIVD, vd, vn, vm); | 727 EmitFPTwoSourceOp(FDIVD, vd, vn, vm); |
728 } | 728 } |
729 void faddd(VRegister vd, VRegister vn, VRegister vm) { | 729 void faddd(VRegister vd, VRegister vn, VRegister vm) { |
730 EmitFPTwoSourceOp(FADDD, vd, vn, vm); | 730 EmitFPTwoSourceOp(FADDD, vd, vn, vm); |
731 } | 731 } |
732 void fsubd(VRegister vd, VRegister vn, VRegister vm) { | 732 void fsubd(VRegister vd, VRegister vn, VRegister vm) { |
733 EmitFPTwoSourceOp(FSUBD, vd, vn, vm); | 733 EmitFPTwoSourceOp(FSUBD, vd, vn, vm); |
734 } | 734 } |
735 | 735 |
| 736 // SIMD operations. |
| 737 void vadds(VRegister vd, VRegister vn, VRegister vm) { |
| 738 EmitSIMDThreeSameOp(VADDS, vd, vn, vm); |
| 739 } |
| 740 void vaddd(VRegister vd, VRegister vn, VRegister vm) { |
| 741 EmitSIMDThreeSameOp(VADDD, vd, vn, vm); |
| 742 } |
| 743 void vsubs(VRegister vd, VRegister vn, VRegister vm) { |
| 744 EmitSIMDThreeSameOp(VSUBS, vd, vn, vm); |
| 745 } |
| 746 void vsubd(VRegister vd, VRegister vn, VRegister vm) { |
| 747 EmitSIMDThreeSameOp(VSUBD, vd, vn, vm); |
| 748 } |
| 749 void vmuls(VRegister vd, VRegister vn, VRegister vm) { |
| 750 EmitSIMDThreeSameOp(VMULS, vd, vn, vm); |
| 751 } |
| 752 void vmuld(VRegister vd, VRegister vn, VRegister vm) { |
| 753 EmitSIMDThreeSameOp(VMULD, vd, vn, vm); |
| 754 } |
| 755 void vdivs(VRegister vd, VRegister vn, VRegister vm) { |
| 756 EmitSIMDThreeSameOp(VDIVS, vd, vn, vm); |
| 757 } |
| 758 void vdivd(VRegister vd, VRegister vn, VRegister vm) { |
| 759 EmitSIMDThreeSameOp(VDIVD, vd, vn, vm); |
| 760 } |
| 761 void vdups(VRegister vd, VRegister vn, int32_t idx) { |
| 762 EmitSIMDCopyOp(VDUP, vd, vn, kSWord, 0, idx); |
| 763 } |
| 764 void vdupd(VRegister vd, VRegister vn, int32_t idx) { |
| 765 EmitSIMDCopyOp(VDUP, vd, vn, kDWord, 0, idx); |
| 766 } |
| 767 void vinss(VRegister vd, int32_t didx, VRegister vn, int32_t sidx) { |
| 768 EmitSIMDCopyOp(VINS, vd, vn, kSWord, sidx, didx); |
| 769 } |
| 770 void vinsd(VRegister vd, int32_t didx, VRegister vn, int32_t sidx) { |
| 771 EmitSIMDCopyOp(VINS, vd, vn, kDWord, sidx, didx); |
| 772 } |
| 773 |
736 // Aliases. | 774 // Aliases. |
737 void mov(Register rd, Register rn) { | 775 void mov(Register rd, Register rn) { |
738 if ((rd == SP) || (rn == SP)) { | 776 if ((rd == SP) || (rn == SP)) { |
739 add(rd, rn, Operand(0)); | 777 add(rd, rn, Operand(0)); |
740 } else { | 778 } else { |
741 orr(rd, ZR, Operand(rn)); | 779 orr(rd, ZR, Operand(rn)); |
742 } | 780 } |
743 } | 781 } |
744 void mvn(Register rd, Register rm) { | 782 void mvn(Register rd, Register rm) { |
745 orn(rd, ZR, Operand(rm)); | 783 orn(rd, ZR, Operand(rm)); |
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
963 void EnterCallRuntimeFrame(intptr_t frame_size); | 1001 void EnterCallRuntimeFrame(intptr_t frame_size); |
964 void LeaveCallRuntimeFrame(); | 1002 void LeaveCallRuntimeFrame(); |
965 void CallRuntime(const RuntimeEntry& entry, intptr_t argument_count); | 1003 void CallRuntime(const RuntimeEntry& entry, intptr_t argument_count); |
966 | 1004 |
967 // Set up a stub frame so that the stack traversal code can easily identify | 1005 // Set up a stub frame so that the stack traversal code can easily identify |
968 // a stub frame. | 1006 // a stub frame. |
969 void EnterStubFrame(bool load_pp = false); | 1007 void EnterStubFrame(bool load_pp = false); |
970 void LeaveStubFrame(); | 1008 void LeaveStubFrame(); |
971 | 1009 |
972 void UpdateAllocationStats(intptr_t cid, | 1010 void UpdateAllocationStats(intptr_t cid, |
973 Register temp_reg, | |
974 Register pp, | 1011 Register pp, |
975 Heap::Space space = Heap::kNew); | 1012 Heap::Space space = Heap::kNew); |
976 | 1013 |
977 void UpdateAllocationStatsWithSize(intptr_t cid, | 1014 void UpdateAllocationStatsWithSize(intptr_t cid, |
978 Register size_reg, | 1015 Register size_reg, |
979 Register temp_reg, | |
980 Register pp, | 1016 Register pp, |
981 Heap::Space space = Heap::kNew); | 1017 Heap::Space space = Heap::kNew); |
982 | 1018 |
983 // Inlined allocation of an instance of class 'cls', code has no runtime | 1019 // Inlined allocation of an instance of class 'cls', code has no runtime |
984 // calls. Jump to 'failure' if the instance cannot be allocated here. | 1020 // calls. Jump to 'failure' if the instance cannot be allocated here. |
985 // Allocated instance is returned in 'instance_reg'. | 1021 // Allocated instance is returned in 'instance_reg'. |
986 // Only the tags field of the object is initialized. | 1022 // Only the tags field of the object is initialized. |
987 void TryAllocate(const Class& cls, | 1023 void TryAllocate(const Class& cls, |
988 Label* failure, | 1024 Label* failure, |
989 Register instance_reg, | 1025 Register instance_reg, |
990 Register temp_reg, | |
991 Register pp); | 1026 Register pp); |
992 | 1027 |
993 private: | 1028 private: |
994 AssemblerBuffer buffer_; // Contains position independent code. | 1029 AssemblerBuffer buffer_; // Contains position independent code. |
995 | 1030 |
996 // Objects and patchable jump targets. | 1031 // Objects and patchable jump targets. |
997 GrowableObjectArray& object_pool_; | 1032 GrowableObjectArray& object_pool_; |
998 | 1033 |
999 // Patchability of pool entries. | 1034 // Patchability of pool entries. |
1000 GrowableArray<Patchability> patchable_pool_entries_; | 1035 GrowableArray<Patchability> patchable_pool_entries_; |
(...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1398 } | 1433 } |
1399 | 1434 |
1400 void EmitFPCompareOp(FPCompareOp op, VRegister vn, VRegister vm) { | 1435 void EmitFPCompareOp(FPCompareOp op, VRegister vn, VRegister vm) { |
1401 const int32_t encoding = | 1436 const int32_t encoding = |
1402 op | | 1437 op | |
1403 (static_cast<int32_t>(vn) << kVnShift) | | 1438 (static_cast<int32_t>(vn) << kVnShift) | |
1404 (static_cast<int32_t>(vm) << kVmShift); | 1439 (static_cast<int32_t>(vm) << kVmShift); |
1405 Emit(encoding); | 1440 Emit(encoding); |
1406 } | 1441 } |
1407 | 1442 |
| 1443 void EmitSIMDThreeSameOp(SIMDThreeSameOp op, |
| 1444 VRegister vd, VRegister vn, VRegister vm) { |
| 1445 const int32_t encoding = |
| 1446 op | |
| 1447 (static_cast<int32_t>(vd) << kVdShift) | |
| 1448 (static_cast<int32_t>(vn) << kVnShift) | |
| 1449 (static_cast<int32_t>(vm) << kVmShift); |
| 1450 Emit(encoding); |
| 1451 } |
| 1452 |
| 1453 void EmitSIMDCopyOp(SIMDCopyOp op, VRegister vd, VRegister vn, OperandSize sz, |
| 1454 int32_t idx4, int32_t idx5) { |
| 1455 const int32_t shift = Log2OperandSizeBytes(sz); |
| 1456 const int32_t imm5 = ((idx5 << (shift + 1)) | (1 << shift)) & 0x1f; |
| 1457 const int32_t imm4 = (idx4 << shift) & 0xf; |
| 1458 const int32_t encoding = |
| 1459 op | |
| 1460 (imm5 << kImm5Shift) | |
| 1461 (imm4 << kImm4Shift) | |
| 1462 (static_cast<int32_t>(vd) << kVdShift) | |
| 1463 (static_cast<int32_t>(vn) << kVnShift); |
| 1464 Emit(encoding); |
| 1465 } |
| 1466 |
1408 void StoreIntoObjectFilter(Register object, Register value, Label* no_update); | 1467 void StoreIntoObjectFilter(Register object, Register value, Label* no_update); |
1409 | 1468 |
1410 // Shorter filtering sequence that assumes that value is not a smi. | 1469 // Shorter filtering sequence that assumes that value is not a smi. |
1411 void StoreIntoObjectFilterNoSmi(Register object, | 1470 void StoreIntoObjectFilterNoSmi(Register object, |
1412 Register value, | 1471 Register value, |
1413 Label* no_update); | 1472 Label* no_update); |
1414 | 1473 |
1415 DISALLOW_ALLOCATION(); | 1474 DISALLOW_ALLOCATION(); |
1416 DISALLOW_COPY_AND_ASSIGN(Assembler); | 1475 DISALLOW_COPY_AND_ASSIGN(Assembler); |
1417 }; | 1476 }; |
1418 | 1477 |
1419 } // namespace dart | 1478 } // namespace dart |
1420 | 1479 |
1421 #endif // VM_ASSEMBLER_ARM64_H_ | 1480 #endif // VM_ASSEMBLER_ARM64_H_ |
OLD | NEW |