From: "Alex Bennée" <alex.bennee@linaro.org>
To: Pranith Kumar <bobby.prani@gmail.com>
Cc: Claudio Fontana <claudio.fontana@huawei.com>,
Richard Henderson <rth@twiddle.net>,
"open list:AArch64 target" <qemu-arm@nongnu.org>,
"open list:All patches CC here" <qemu-devel@nongnu.org>,
serge.fdrv@gmail.com, Claudio Fontana <claudio.fontana@gmail.com>
Subject: Re: [Qemu-devel] [RFC v3 PATCH 03/14] tcg/aarch64: Add support for fence
Date: Thu, 23 Jun 2016 17:18:11 +0100 [thread overview]
Message-ID: <87inwzri9o.fsf@linaro.org> (raw)
In-Reply-To: <20160618040343.19517-4-bobby.prani@gmail.com>
Pranith Kumar <bobby.prani@gmail.com> writes:
> Cc: Claudio Fontana <claudio.fontana@gmail.com>
> Signed-off-by: Richard Henderson <rth@twiddle.net>
> Signed-off-by: Pranith Kumar <bobby.prani@gmail.com>
> ---
> tcg/aarch64/tcg-target.inc.c | 25 +++++++++++++++++++++++++
> 1 file changed, 25 insertions(+)
>
> diff --git a/tcg/aarch64/tcg-target.inc.c b/tcg/aarch64/tcg-target.inc.c
> index 1447f7c..bc8ac9c 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,
As ISH is part of the CRm encoding I wonder if this should be split into
the main DMB encoding (0xd50330bf) and a separate set of CRm defines.
In fact the documentation of the struct above implies you should
probably have:
I6260_DMB = 0xd50330bf,
And then:
static void tcg_out_insn_6260(TCGContext *s, AArch64Insn insn, int crm);
{
tcg_out32(s, insn | (crm & 0xf) << 8);
}
Claudio,
Does this actually gain anything over doing a direct tcg_out? I guess it
makes a bit more sense for more complex instruction encodings.
> + DMB_LD = 0x00000100,
> + DMB_ST = 0x00000200,
> } AArch64Insn;
>
> static inline uint32_t tcg_in32(TCGContext *s)
> @@ -971,6 +976,21 @@ 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)
> +{
> + switch (a0 & TCG_MO_ALL) {
> + case TCG_MO_LD_LD:
> + tcg_out32(s, DMB_ISH | DMB_LD);
This would then become:
tcg_out_insn(s, 6260, DMB, R_LD)
> + break;
> + case TCG_MO_ST_ST:
> + tcg_out32(s, DMB_ISH | DMB_ST);
tcg_out_insn(s, 6260, DMB, R_ST)
> + break;
> + default:
> + tcg_out32(s, DMB_ISH | DMB_LD | DMB_ST);
tcg_out_insn(s, 6260, DMB, R_LD|R_ST)
> + break;
> + }
> +}
> +
> #ifdef CONFIG_SOFTMMU
> /* helper signature: helper_ret_ld_mmu(CPUState *env, target_ulong addr,
> * TCGMemOpIdx oi, uintptr_t ra)
> @@ -1637,6 +1657,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. */
> @@ -1761,6 +1785,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 },
> };
--
Alex Bennée
next prev parent reply other threads:[~2016-06-23 16:18 UTC|newest]
Thread overview: 56+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20160618040343.19517-1-bobby.prani@gmail.com>
2016-06-18 4:03 ` [Qemu-devel] [RFC v3 PATCH 01/14] Introduce TCGOpcode for memory barrier Pranith Kumar
2016-06-20 21:21 ` Sergey Fedorov
2016-06-21 14:52 ` Pranith Kumar
2016-06-21 15:09 ` Alex Bennée
2016-06-21 18:06 ` Pranith Kumar
2016-06-22 15:50 ` Sergey Fedorov
2016-06-21 7:30 ` Paolo Bonzini
2016-06-21 18:04 ` Alex Bennée
2016-06-21 18:09 ` Pranith Kumar
2016-06-21 18:23 ` Alex Bennée
2016-06-21 19:40 ` Richard Henderson
2016-06-18 4:03 ` [Qemu-devel] [RFC v3 PATCH 02/14] tcg/i386: Add support for fence Pranith Kumar
2016-06-21 7:24 ` Paolo Bonzini
2016-06-22 16:25 ` Alex Bennée
2016-06-22 16:49 ` Richard Henderson
2016-06-22 18:18 ` Alex Bennée
2016-06-18 4:03 ` [Qemu-devel] [RFC v3 PATCH 03/14] tcg/aarch64: " Pranith Kumar
2016-06-23 16:18 ` Alex Bennée [this message]
2016-06-23 16:50 ` Richard Henderson
2016-06-23 19:58 ` Alex Bennée
2016-06-18 4:03 ` [Qemu-devel] [RFC v3 PATCH 04/14] tcg/arm: " Pranith Kumar
2016-06-23 16:30 ` Alex Bennée
2016-06-23 16:49 ` Richard Henderson
2016-06-18 4:03 ` [Qemu-devel] [RFC v3 PATCH 05/14] tcg/ia64: " Pranith Kumar
2016-06-18 4:03 ` [Qemu-devel] [RFC v3 PATCH 06/14] tcg/mips: " Pranith Kumar
2016-06-18 4:03 ` [Qemu-devel] [RFC v3 PATCH 07/14] tcg/ppc: " Pranith Kumar
2016-06-22 19:50 ` Sergey Fedorov
2016-06-22 20:21 ` Richard Henderson
2016-06-22 20:27 ` Sergey Fedorov
2016-06-23 14:42 ` Sergey Fedorov
2016-06-18 4:03 ` [Qemu-devel] [RFC v3 PATCH 08/14] tcg/s390: " Pranith Kumar
2016-06-21 7:26 ` Paolo Bonzini
2016-06-18 4:03 ` [Qemu-devel] [RFC v3 PATCH 09/14] tcg/sparc: " Pranith Kumar
2016-06-22 19:56 ` Sergey Fedorov
2016-06-18 4:03 ` [Qemu-devel] [RFC v3 PATCH 10/14] tcg/tci: " Pranith Kumar
2016-06-22 19:57 ` Sergey Fedorov
2016-06-22 20:25 ` Richard Henderson
2016-06-22 20:28 ` Sergey Fedorov
2016-06-18 4:03 ` [Qemu-devel] [RFC v3 PATCH 11/14] target-arm: Generate fences in ARMv7 frontend Pranith Kumar
2016-06-18 4:03 ` [Qemu-devel] [RFC v3 PATCH 12/14] target-alpha: Generate fence op Pranith Kumar
2016-06-18 4:03 ` [Qemu-devel] [RFC v3 PATCH 13/14] aarch64: Generate fences for aarch64 Pranith Kumar
2016-06-24 16:17 ` Alex Bennée
2016-06-18 4:03 ` [Qemu-devel] [RFC v3 PATCH 14/14] target-i386: Generate fences for x86 Pranith Kumar
2016-06-18 5:48 ` Richard Henderson
2016-06-20 15:05 ` Pranith Kumar
2016-06-21 7:28 ` Paolo Bonzini
2016-06-21 15:57 ` Richard Henderson
2016-06-21 16:12 ` Paolo Bonzini
2016-06-21 16:23 ` Richard Henderson
2016-06-21 16:33 ` Paolo Bonzini
2016-06-21 17:28 ` Pranith Kumar
2016-06-21 17:54 ` Peter Maydell
2016-06-21 18:03 ` Pranith Kumar
2016-06-21 18:25 ` Alex Bennée
2016-06-22 11:18 ` Sergey Fedorov
2016-06-18 4:08 ` [Qemu-devel] [RFC v3 PATCH 00/14] tcg: Add fence gen support Pranith Kumar
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=87inwzri9o.fsf@linaro.org \
--to=alex.bennee@linaro.org \
--cc=bobby.prani@gmail.com \
--cc=claudio.fontana@gmail.com \
--cc=claudio.fontana@huawei.com \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=rth@twiddle.net \
--cc=serge.fdrv@gmail.com \
/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).