Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
8273380: ARM32: Default to {ldrexd,strexd} in StubRoutines::atomic_{l…
…oad|store}_long

Backport-of: 718eff2bb6e938440df9f7b982ef6d2f4060a759
  • Loading branch information
shipilev committed Nov 22, 2022
1 parent c260e8a commit 174c147
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions src/hotspot/cpu/arm/stubGenerator_arm.cpp
Expand Up @@ -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;
}
Expand All @@ -662,22 +662,22 @@ 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);
__ ldrexd(scratch_lo, Address(Rtemp));
__ 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;
}
Expand Down

1 comment on commit 174c147

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.