[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v4 09/14] tcg/sparc: Add support for fence
From: |
Pranith Kumar |
Subject: |
[Qemu-devel] [PATCH v4 09/14] tcg/sparc: Add support for fence |
Date: |
Thu, 14 Jul 2016 16:20:21 -0400 |
Cc: Blue Swirl <address@hidden>
Signed-off-by: Pranith Kumar <address@hidden>
Signed-off-by: Richard Henderson <address@hidden>
---
tcg/sparc/tcg-target.inc.c | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)
diff --git a/tcg/sparc/tcg-target.inc.c b/tcg/sparc/tcg-target.inc.c
index 8e98172..04a6404 100644
--- a/tcg/sparc/tcg-target.inc.c
+++ b/tcg/sparc/tcg-target.inc.c
@@ -249,6 +249,8 @@ static const int tcg_target_call_oarg_regs[] = {
#define STWA (INSN_OP(3) | INSN_OP3(0x14))
#define STXA (INSN_OP(3) | INSN_OP3(0x1e))
+#define MEMBAR (INSN_OP(2) | INSN_OP3(0x28) | INSN_RS1(15) | (1 << 13))
+
#ifndef ASI_PRIMARY_LITTLE
#define ASI_PRIMARY_LITTLE 0x88
#endif
@@ -835,6 +837,24 @@ static void tcg_out_call(TCGContext *s, tcg_insn_unit
*dest)
tcg_out_nop(s);
}
+static void tcg_out_mb(TCGContext *s, TCGArg a0)
+{
+ uint8_t bar_opcode = MEMBAR;
+ if (a0 & TCG_MO_LD_LD) {
+ /* #LoadLoad */
+ bar_opcode |= 0x5;
+ }
+ if (a0 & TCG_MO_ST_ST) {
+ /* #StoreStore */
+ bar_opcode |= 0xa;
+ }
+ if (a0 & (TCG_MO_LD_ST | TCG_MO_ST_LD)) {
+ /* #StoreLoad | #LoadStore */
+ bar_opcode |= 0xf;
+ }
+ tcg_out32(s, bar_opcode);
+}
+
#ifdef CONFIG_SOFTMMU
static tcg_insn_unit *qemu_ld_trampoline[16];
static tcg_insn_unit *qemu_st_trampoline[16];
@@ -1460,6 +1480,10 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc,
tcg_out_arithc(s, a0, TCG_REG_G0, a1, const_args[1], c);
break;
+ case INDEX_op_mb:
+ tcg_out_mb(s, a0);
+ break;
+
case INDEX_op_mov_i32: /* Always emitted via tcg_out_mov. */
case INDEX_op_mov_i64:
case INDEX_op_movi_i32: /* Always emitted via tcg_out_movi. */
@@ -1561,6 +1585,7 @@ static const TCGTargetOpDef sparc_op_defs[] = {
{ INDEX_op_qemu_st_i32, { "sZ", "A" } },
{ INDEX_op_qemu_st_i64, { "SZ", "A" } },
+ { INDEX_op_mb, { } },
{ -1 },
};
--
2.9.0
- [Qemu-devel] [PATCH v4 00/14] tcg: Add support for fence generation, Pranith Kumar, 2016/07/14
- [Qemu-devel] [PATCH v4 02/14] tcg/i386: Add support for fence, Pranith Kumar, 2016/07/14
- [Qemu-devel] [PATCH v4 01/14] Introduce TCGOpcode for memory barrier, Pranith Kumar, 2016/07/14
- [Qemu-devel] [PATCH v4 05/14] tcg/ia64: Add support for fence, Pranith Kumar, 2016/07/14
- [Qemu-devel] [PATCH v4 03/14] tcg/aarch64: Add support for fence, Pranith Kumar, 2016/07/14
- [Qemu-devel] [PATCH v4 07/14] tcg/ppc: Add support for fence, Pranith Kumar, 2016/07/14
- [Qemu-devel] [PATCH v4 08/14] tcg/s390: Add support for fence, Pranith Kumar, 2016/07/14
- [Qemu-devel] [PATCH v4 06/14] tcg/mips: Add support for fence, Pranith Kumar, 2016/07/14
- [Qemu-devel] [PATCH v4 04/14] tcg/arm: Add support for fence, Pranith Kumar, 2016/07/14
- [Qemu-devel] [PATCH v4 09/14] tcg/sparc: Add support for fence,
Pranith Kumar <=
- [Qemu-devel] [PATCH v4 10/14] tcg/tci: Add support for fence, Pranith Kumar, 2016/07/14
- [Qemu-devel] [PATCH v4 12/14] target-alpha: Generate fence op, Pranith Kumar, 2016/07/14
- [Qemu-devel] [PATCH v4 11/14] target-arm: Generate fences in ARMv7 frontend, Pranith Kumar, 2016/07/14
- [Qemu-devel] [PATCH v4 14/14] target-i386: Generate fences for x86, Pranith Kumar, 2016/07/14
- [Qemu-devel] [PATCH v4 13/14] target-aarch64: Generate fences for aarch64, Pranith Kumar, 2016/07/14
- Re: [Qemu-devel] [PATCH v4 00/14] tcg: Add support for fence generation, Pranith Kumar, 2016/07/23