From: Richard Henderson <rth@twiddle.net>
To: qemu-devel@nongnu.org
Cc: peter.maydell@linaro.org, Pranith Kumar <bobby.prani@gmail.com>,
Claudio Fontana <claudio.fontana@gmail.com>
Subject: [Qemu-devel] [PULL v3 06/18] tcg/aarch64: Add support for fence
Date: Mon, 12 Sep 2016 16:39:40 -0700 [thread overview]
Message-ID: <1473723592-524-7-git-send-email-rth@twiddle.net> (raw)
In-Reply-To: <1473723592-524-1-git-send-email-rth@twiddle.net>
From: Pranith Kumar <bobby.prani@gmail.com>
Cc: Claudio Fontana <claudio.fontana@gmail.com>
Signed-off-by: Pranith Kumar <bobby.prani@gmail.com>
Message-Id: <20160714202026.9727-4-bobby.prani@gmail.com>
Signed-off-by: Richard Henderson <rth@twiddle.net>
---
tcg/aarch64/tcg-target.inc.c | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/tcg/aarch64/tcg-target.inc.c b/tcg/aarch64/tcg-target.inc.c
index 2f5629e..6caa9a4 100644
--- a/tcg/aarch64/tcg-target.inc.c
+++ b/tcg/aarch64/tcg-target.inc.c
@@ -372,6 +372,11 @@ typedef enum {
I3510_EOR = 0x4a000000,
I3510_EON = 0x4a200000,
I3510_ANDS = 0x6a000000,
+
+ /* System instructions. */
+ DMB_ISH = 0xd50338bf,
+ DMB_LD = 0x00000100,
+ DMB_ST = 0x00000200,
} AArch64Insn;
static inline uint32_t tcg_in32(TCGContext *s)
@@ -981,6 +986,20 @@ static inline void tcg_out_addsub2(TCGContext *s, int ext, TCGReg rl,
tcg_out_mov(s, ext, orig_rl, rl);
}
+static inline void tcg_out_mb(TCGContext *s, TCGArg a0)
+{
+ uint32_t dmb_type = DMB_ISH;
+ a0 &= TCG_MO_ALL;
+ if (a0 == TCG_MO_LD_LD) {
+ dmb_type |= DMB_LD;
+ } else if (a0 == TCG_MO_ST_ST) {
+ dmb_type |= DMB_ST;
+ } else {
+ dmb_type |= DMB_LD | DMB_ST;
+ }
+ tcg_out32(s, dmb_type);
+}
+
#ifdef CONFIG_SOFTMMU
/* helper signature: helper_ret_ld_mmu(CPUState *env, target_ulong addr,
* TCGMemOpIdx oi, uintptr_t ra)
@@ -1647,6 +1666,10 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc,
tcg_out_insn(s, 3508, SMULH, TCG_TYPE_I64, a0, a1, a2);
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. */
@@ -1771,6 +1794,7 @@ static const TCGTargetOpDef aarch64_op_defs[] = {
{ INDEX_op_muluh_i64, { "r", "r", "r" } },
{ INDEX_op_mulsh_i64, { "r", "r", "r" } },
+ { INDEX_op_mb, { } },
{ -1 },
};
--
2.7.4
next prev parent reply other threads:[~2016-09-12 23:41 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-12 23:39 [Qemu-devel] [PULL v3 00/18] tcg queued patches Richard Henderson
2016-09-12 23:39 ` [Qemu-devel] [PULL v3 01/18] tcg: Support arbitrary size + alignment Richard Henderson
2016-09-20 10:16 ` Bharata B Rao
2016-09-20 18:57 ` Richard Henderson
2016-09-12 23:39 ` [Qemu-devel] [PULL v3 02/18] tcg: Merge GETPC and GETRA Richard Henderson
2016-09-12 23:39 ` [Qemu-devel] [PULL v3 03/18] cpu-exec: Check -dfilter for -d cpu Richard Henderson
2016-09-12 23:39 ` [Qemu-devel] [PULL v3 04/18] Introduce TCGOpcode for memory barrier Richard Henderson
2016-09-12 23:39 ` [Qemu-devel] [PULL v3 05/18] tcg/i386: Add support for fence Richard Henderson
2016-09-12 23:39 ` Richard Henderson [this message]
2016-09-12 23:39 ` [Qemu-devel] [PULL v3 07/18] tcg/arm: " Richard Henderson
2016-09-12 23:39 ` [Qemu-devel] [PULL v3 08/18] tcg/ia64: " Richard Henderson
2016-09-12 23:39 ` [Qemu-devel] [PULL v3 09/18] tcg/mips: " Richard Henderson
2016-09-12 23:39 ` [Qemu-devel] [PULL v3 10/18] tcg/ppc: " Richard Henderson
2016-09-12 23:39 ` [Qemu-devel] [PULL v3 11/18] tcg/s390: " Richard Henderson
2016-09-12 23:39 ` [Qemu-devel] [PULL v3 12/18] tcg/sparc: " Richard Henderson
2016-09-12 23:39 ` [Qemu-devel] [PULL v3 13/18] tcg/tci: " Richard Henderson
2016-09-12 23:39 ` [Qemu-devel] [PULL v3 14/18] target-arm: Generate fences in ARMv7 frontend Richard Henderson
2016-09-12 23:39 ` [Qemu-devel] [PULL v3 15/18] target-alpha: Generate fence op Richard Henderson
2016-09-12 23:39 ` [Qemu-devel] [PULL v3 16/18] target-aarch64: Generate fences for aarch64 Richard Henderson
2016-09-12 23:39 ` [Qemu-devel] [PULL v3 17/18] target-i386: Generate fences for x86 Richard Henderson
2016-09-12 23:39 ` [Qemu-devel] [PULL v3 18/18] tcg: Optimize fence instructions Richard Henderson
2016-09-13 10:39 ` [Qemu-devel] [PULL v3 00/18] tcg queued patches Peter Maydell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1473723592-524-7-git-send-email-rth@twiddle.net \
--to=rth@twiddle.net \
--cc=bobby.prani@gmail.com \
--cc=claudio.fontana@gmail.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).