8273380: ARM32: Default to {ldrexd,strexd} in StubRoutines::atomic_{load|store}_long

Reviewed-by: dlong, dsamersoff
This commit is contained in:
Aleksey Shipilev 2021-09-24 15:31:35 +00:00
parent f214d6e873
commit 718eff2bb6

View File

@ -635,17 +635,17 @@ class StubGenerator: public StubCodeGenerator {
Register result_hi = R1;
Register src = R0;
if (!os::is_MP()) {
__ ldmia(src, RegisterSet(result_lo, result_hi));
__ bx(LR);
} else if (VM_Version::supports_ldrexd()) {
if (VM_Version::supports_ldrexd()) {
__ ldrexd(result_lo, Address(src));
__ clrex(); // FIXME: safe to remove?
__ bx(LR);
} else if (!os::is_MP()) {
// Last-ditch attempt: we are allegedly running on uni-processor.
// Load the thing non-atomically and hope for the best.
__ ldmia(src, RegisterSet(result_lo, result_hi));
} else {
__ stop("Atomic load(jlong) unsupported on this platform");
__ bx(LR);
}
__ bx(LR);
return start;
}
@ -662,10 +662,7 @@ class StubGenerator: public StubCodeGenerator {
Register scratch_hi = R3; /* After load from stack */
Register result = R3;
if (!os::is_MP()) {
__ stmia(dest, RegisterSet(newval_lo, newval_hi));
__ bx(LR);
} else if (VM_Version::supports_ldrexd()) {
if (VM_Version::supports_ldrexd()) {
__ mov(Rtemp, dest); // get dest to Rtemp
Label retry;
__ bind(retry);
@ -673,11 +670,14 @@ class StubGenerator: public StubCodeGenerator {
__ strexd(result, R0, Address(Rtemp));
__ rsbs(result, result, 1);
__ b(retry, eq);
__ bx(LR);
} else if (!os::is_MP()) {
// Last-ditch attempt: we are allegedly running on uni-processor.
// Store the thing non-atomically and hope for the best.
__ stmia(dest, RegisterSet(newval_lo, newval_hi));
} else {
__ stop("Atomic store(jlong) unsupported on this platform");
__ bx(LR);
}
__ bx(LR);
return start;
}