This patch sets the relevant .rl bits on amo operations.

2023-04-10 Patrick O'Neill <patr...@rivosinc.com>

        * riscv.cc (riscv_print_operand): change behavior of %A to
        include release bits.

Signed-off-by: Patrick O'Neill <patr...@rivosinc.com>
---
 gcc/config/riscv/riscv.cc | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/gcc/config/riscv/riscv.cc b/gcc/config/riscv/riscv.cc
index 8f5636c93ed..8ffee494fbe 100644
--- a/gcc/config/riscv/riscv.cc
+++ b/gcc/config/riscv/riscv.cc
@@ -4492,8 +4492,13 @@ riscv_print_operand (FILE *file, rtx op, int letter)
       break;
 
     case 'A':
-      if (riscv_memmodel_needs_amo_acquire (model))
+      if (riscv_memmodel_needs_amo_acquire (model) &&
+         riscv_memmodel_needs_release_fence (model))
+       fputs (".aqrl", file);
+      else if (riscv_memmodel_needs_amo_acquire (model))
        fputs (".aq", file);
+      else if (riscv_memmodel_needs_release_fence (model))
+       fputs (".rl", file);
       break;
 
     case 'F':
-- 
2.25.1

Reply via email to