Skip to content
Snippets Groups Projects
Commit dcd7b2f5 authored by Patrick O'Neill's avatar Patrick O'Neill
Browse files

RISC-V: Enforce Libatomic LR/SC SEQ_CST


Replace LR.aq/SC.rl pairs with the SEQ_CST LR.aqrl/SC.rl pairs
recommended by table A.6 of the ISA manual.

2023-04-27 Patrick O'Neill <patrick@rivosinc.com>

libgcc/ChangeLog:

	* config/riscv/atomic.c: Change LR.aq/SC.rl pairs into
	sequentially consistent LR.aqrl/SC.rl pairs.

Signed-off-by: default avatarPatrick O'Neill <patrick@rivosinc.com>
parent f37a36bc
No related branches found
No related tags found
No related merge requests found
...@@ -41,7 +41,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see ...@@ -41,7 +41,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
unsigned old, tmp1, tmp2; \ unsigned old, tmp1, tmp2; \
\ \
asm volatile ("1:\n\t" \ asm volatile ("1:\n\t" \
"lr.w.aq %[old], %[mem]\n\t" \ "lr.w.aqrl %[old], %[mem]\n\t" \
#insn " %[tmp1], %[old], %[value]\n\t" \ #insn " %[tmp1], %[old], %[value]\n\t" \
invert \ invert \
"and %[tmp1], %[tmp1], %[mask]\n\t" \ "and %[tmp1], %[tmp1], %[mask]\n\t" \
...@@ -75,7 +75,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see ...@@ -75,7 +75,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
unsigned old, tmp1; \ unsigned old, tmp1; \
\ \
asm volatile ("1:\n\t" \ asm volatile ("1:\n\t" \
"lr.w.aq %[old], %[mem]\n\t" \ "lr.w.aqrl %[old], %[mem]\n\t" \
"and %[tmp1], %[old], %[mask]\n\t" \ "and %[tmp1], %[old], %[mask]\n\t" \
"bne %[tmp1], %[o], 1f\n\t" \ "bne %[tmp1], %[o], 1f\n\t" \
"and %[tmp1], %[old], %[not_mask]\n\t" \ "and %[tmp1], %[old], %[not_mask]\n\t" \
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment