sail-riscv
sail-riscv copied to clipboard
Store Conditional can retire successfully even if atomics are disabled
/* NOTE: Currently, we only EA if address translation is successful. This may need revisiting. */
function clause execute (STORECON(aq, rl, rs2, rs1, width, rd)) = {
if speculate_conditional () == false then {
/* should only happen in rmem
* rmem: allow SC to fail very early
*/
X(rd) = zero_extend(0b1); RETIRE_SUCCESS
} else {
if haveAtomics() then {
/* normal non-rmem case
* rmem: SC is allowed to succeed (but might fail later)
*/
Surely speculate_conditional() should be inside if haveAtomics()?