Skip to contentSkip to conversation

tcg/riscv: Fix StoreStore barrier generation

PATCH In review Roman Artemev 2 participants 2 messages Dec 11, 2024 RISC-V

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tcg/riscv: Fix StoreStore barrier generation

On RISC-V to StoreStore barrier corresponds
fence w, w not fence r, r

---
 tcg/riscv/tcg-target.c.inc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tcg/riscv/tcg-target.c.inc +1 -1
index f8331e4688..96f9a7e348 100644
@@ -1624,7 +1624,7 @@ static void tcg_out_mb(TCGContext *s, TCGArg a0)
         insn |= 0x02100000;
     }
     if (a0 & TCG_MO_ST_ST) {
-        insn |= 0x02200000;
+        insn |= 0x01100000;
     }
     tcg_out32(s, insn);
 }
Signature · 1 line
2.39.2
Reviewed-by on v1 1/1
#1 lore raw
Quoted 14 lines · Roman Artemev

On RISC-V to StoreStore barrier corresponds
fence w, w not fence r, r

---
  tcg/riscv/tcg-target.c.inc | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
tcg/riscv/tcg-target.c.inc +0 -0
index f8331e4688..96f9a7e348 100644

tcg/riscv/tcg-target.c.inc static void tcg_out_mb(TCGContext *s, TCGArg a0) · line 1630

Quoted 8 lines
tcg/riscv/tcg-target.c.inc +1 -1
@@ -1624,7 +1624,7 @@ static void tcg_out_mb(TCGContext *s, TCGArg a0)
          insn |= 0x02100000;
      }
      if (a0 & TCG_MO_ST_ST) {
-        insn |= 0x02200000;
+        insn |= 0x01100000;
      }
      tcg_out32(s, insn);
  }
Fixes efbea94c76b ("tcg/riscv: Add slowpath load and store instructions")

Wow, that typo has been around for a while.
Thanks, queued.

r~