730 __ mov(R0, temp_lo); 731 __ mov(R1, temp_hi); 732 733 __ pop(RegisterSet(temp_result) | RegisterSet(temp_lo, temp_hi)); 734 735 __ membar(MEMBAR_ATOMIC_OP_POST, Rtemp); // Rtemp free (native ABI) 736 __ bx(LR); 737 738 return start; 739 } 740 741 address generate_atomic_load_long() { 742 address start; 743 744 StubCodeMark mark(this, "StubRoutines", "atomic_load_long"); 745 start = __ pc(); 746 Register result_lo = R0; 747 Register result_hi = R1; 748 Register src = R0; 749 750 if (!os::is_MP()) { 751 __ ldmia(src, RegisterSet(result_lo, result_hi)); 752 __ bx(LR); 753 } else if (VM_Version::supports_ldrexd()) { 754 __ ldrexd(result_lo, Address(src)); 755 __ clrex(); // FIXME: safe to remove? 756 __ bx(LR); 757 } else { 758 __ stop("Atomic load(jlong) unsupported on this platform"); 759 __ bx(LR); 760 } 761 762 return start; 763 } 764 765 address generate_atomic_store_long() { 766 address start; 767 768 StubCodeMark mark(this, "StubRoutines", "atomic_store_long"); 769 start = __ pc(); 770 Register newval_lo = R0; 771 Register newval_hi = R1; 772 Register dest = R2; 773 Register scratch_lo = R2; 774 Register scratch_hi = R3; /* After load from stack */ 775 Register result = R3; 776 777 if (!os::is_MP()) { 778 __ stmia(dest, RegisterSet(newval_lo, newval_hi)); 779 __ bx(LR); 780 } else if (VM_Version::supports_ldrexd()) { 781 __ mov(Rtemp, dest); // get dest to Rtemp 782 Label retry; 783 __ bind(retry); 784 __ ldrexd(scratch_lo, Address(Rtemp)); 785 __ strexd(result, R0, Address(Rtemp)); 786 __ rsbs(result, result, 1); 787 __ b(retry, eq); 788 __ bx(LR); 789 } else { 790 __ stop("Atomic store(jlong) unsupported on this platform"); 791 __ bx(LR); 792 } 793 794 return start; 795 } 796 797 798 #endif // AARCH64 799 800 #ifdef COMPILER2 | 730 __ mov(R0, temp_lo); 731 __ mov(R1, temp_hi); 732 733 __ pop(RegisterSet(temp_result) | RegisterSet(temp_lo, temp_hi)); 734 735 __ membar(MEMBAR_ATOMIC_OP_POST, Rtemp); // Rtemp free (native ABI) 736 __ bx(LR); 737 738 return start; 739 } 740 741 address generate_atomic_load_long() { 742 address start; 743 744 StubCodeMark mark(this, "StubRoutines", "atomic_load_long"); 745 start = __ pc(); 746 Register result_lo = R0; 747 Register result_hi = R1; 748 Register src = R0; 749 750 if (VM_Version::supports_ldrexd()) { 751 __ ldrexd(result_lo, Address(src)); 752 __ clrex(); // FIXME: safe to remove? 753 __ bx(LR); 754 } else { 755 __ stop("Atomic load(jlong) unsupported on this platform"); 756 __ bx(LR); 757 } 758 759 return start; 760 } 761 762 address generate_atomic_store_long() { 763 address start; 764 765 StubCodeMark mark(this, "StubRoutines", "atomic_store_long"); 766 start = __ pc(); 767 Register newval_lo = R0; 768 Register newval_hi = R1; 769 Register dest = R2; 770 Register scratch_lo = R2; 771 Register scratch_hi = R3; /* After load from stack */ 772 Register result = R3; 773 774 if (VM_Version::supports_ldrexd()) { 775 __ mov(Rtemp, dest); // get dest to Rtemp 776 Label retry; 777 __ bind(retry); 778 __ ldrexd(scratch_lo, Address(Rtemp)); 779 __ strexd(result, R0, Address(Rtemp)); 780 __ rsbs(result, result, 1); 781 __ b(retry, eq); 782 __ bx(LR); 783 } else { 784 __ stop("Atomic store(jlong) unsupported on this platform"); 785 __ bx(LR); 786 } 787 788 return start; 789 } 790 791 792 #endif // AARCH64 793 794 #ifdef COMPILER2 |