Hi,
As stated in the comments of riscv_print_operand (the latest version of
gcc/config/riscv/riscv.cc), the RISCV-specific operand code 'A', which is used
in the implementation of 'atomic_cas_value_strong' in sync.md, is the atomic
operation suffix for memory model OP.
However, only '.aq' is considered in the current implementation:
case 'A':
if (riscv_memmodel_needs_amo_acquire ((enum memmodel) INTVAL (op)))
fputs (".aq", file);
break;
Currently, we cannot add '.rl' to the function like
atomic_compare_exchange_weak_release in glibc.
I think we should also take '.rl' & '.aqrl' into consideration. The correct
implementation in my understanding should be:
case 'A':
if (riscv_memmodel_needs_amo_acquire_release ((enum memmodel) INTVAL (op)))
fputs (".aqrl", file);
else if (riscv_memmodel_needs_amo_acquire ((enum memmodel) INTVAL (op)))
fputs (".aq", file);
else if (riscv_memmodel_needs_amo_release ((enum memmodel) INTVAL (op)))
fputs (".rl", file);
break;
Did I get it wrong? I'd appreciate it if you could explain it for me.
Thanks
Xuezheng