From: Laurent Desnogues <laurent.desnogues@gmail.com>
To: aurelien@aurel32.net
Cc: qemu-devel@nongnu.org, Richard Henderson <rth@twiddle.net>
Subject: Re: [Qemu-devel] [PATCH 1/5] tcg: Generic support for conditional set
Date: Tue, 22 Dec 2009 12:27:25 +0100 [thread overview]
Message-ID: <761ea48b0912220327g8184dddu20323f5c32cd390a@mail.gmail.com> (raw)
In-Reply-To: <08eb5a18dde9c9a676073d179003398473ca311c.1261248772.git.rth@twiddle.net>
On Sat, Dec 19, 2009 at 7:01 PM, Richard Henderson <rth@twiddle.net> wrote:
> Defines setcond_{i32,i64} and setcond2_i32 for 64-on-32-bit.
>
> Signed-off-by: Richard Henderson <rth@twiddle.net>
> ---
> tcg/README | 20 +++++++++++++++++++-
> tcg/tcg-op.h | 47 +++++++++++++++++++++++++++++++++++++++++++++++
> tcg/tcg-opc.h | 3 +++
> tcg/tcg.c | 21 +++++++++++++++------
> 4 files changed, 84 insertions(+), 7 deletions(-)
[...]
> diff --git a/tcg/tcg-op.h b/tcg/tcg-op.h
> index faf2e8b..70a75a0 100644
> --- a/tcg/tcg-op.h
> +++ b/tcg/tcg-op.h
> @@ -280,6 +280,32 @@ static inline void tcg_gen_op6_i64(int opc, TCGv_i64 arg1, TCGv_i64 arg2,
> *gen_opparam_ptr++ = GET_TCGV_I64(arg6);
> }
>
> +static inline void tcg_gen_op6i_i32(int opc, TCGv_i32 arg1, TCGv_i32 arg2,
> + TCGv_i32 arg3, TCGv_i32 arg4,
> + TCGv_i32 arg5, TCGArg arg6)
> +{
> + *gen_opc_ptr++ = opc;
> + *gen_opparam_ptr++ = GET_TCGV_I32(arg1);
> + *gen_opparam_ptr++ = GET_TCGV_I32(arg2);
> + *gen_opparam_ptr++ = GET_TCGV_I32(arg3);
> + *gen_opparam_ptr++ = GET_TCGV_I32(arg4);
> + *gen_opparam_ptr++ = GET_TCGV_I32(arg5);
> + *gen_opparam_ptr++ = arg6;
> +}
> +
> +static inline void tcg_gen_op6i_i64(int opc, TCGv_i64 arg1, TCGv_i64 arg2,
> + TCGv_i64 arg3, TCGv_i64 arg4,
> + TCGv_i64 arg5, TCGArg arg6)
> +{
> + *gen_opc_ptr++ = opc;
> + *gen_opparam_ptr++ = GET_TCGV_I64(arg1);
> + *gen_opparam_ptr++ = GET_TCGV_I64(arg2);
> + *gen_opparam_ptr++ = GET_TCGV_I64(arg3);
> + *gen_opparam_ptr++ = GET_TCGV_I64(arg4);
> + *gen_opparam_ptr++ = GET_TCGV_I64(arg5);
> + *gen_opparam_ptr++ = arg6;
> +}
> +
> static inline void tcg_gen_op6ii_i32(int opc, TCGv_i32 arg1, TCGv_i32 arg2,
> TCGv_i32 arg3, TCGv_i32 arg4, TCGArg arg5,
> TCGArg arg6)
> @@ -1795,6 +1821,25 @@ static inline void tcg_gen_rotri_i64(TCGv_i64 ret, TCGv_i64 arg1, int64_t arg2)
> }
> }
>
> +static inline void tcg_gen_setcond_i32(int cond, TCGv_i32 ret,
> + TCGv_i32 arg1, TCGv_i32 arg2)
> +{
> + tcg_gen_op4i_i32(INDEX_op_setcond_i32, ret, arg1, arg2, cond);
> +}
> +
> +static inline void tcg_gen_setcond_i64(int cond, TCGv_i64 ret,
> + TCGv_i64 arg1, TCGv_i64 arg2)
> +{
> +#if TCG_TARGET_REG_BITS == 64
> + tcg_gen_op4i_i64(INDEX_op_setcond_i64, ret, arg1, arg2, cond);
> +#else
> + tcg_gen_op6i_i32(INDEX_op_setcond2_i32, TCGV_LOW(ret),
> + TCGV_LOW(arg1), TCGV_HIGH(arg1),
> + TCGV_LOW(arg2), TCGV_HIGH(arg2), cond);
> + tcg_gen_movi_i32(TCGV_HIGH(ret), 0);
> +#endif
> +}
I wonder if it wouldn't be better to let the back-ends emit the
clearing of TCGV_HIGH(ret). This would reduce the number
of emitted TCG ops. Any thoughts?
Laurent
next prev parent reply other threads:[~2009-12-22 11:27 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-19 18:52 [Qemu-devel] [PATCH 0/5] tcg conditional set, round 4 Richard Henderson
2009-12-19 16:50 ` [Qemu-devel] [PATCH 2/5] tcg-x86_64: Implement setcond Richard Henderson
2009-12-19 23:11 ` Aurelien Jarno
2009-12-19 18:01 ` [Qemu-devel] [PATCH 1/5] tcg: Generic support for conditional set Richard Henderson
2009-12-19 23:11 ` Aurelien Jarno
2009-12-19 23:24 ` Richard Henderson
2009-12-19 23:45 ` Aurelien Jarno
2009-12-22 11:27 ` Laurent Desnogues [this message]
2009-12-22 16:09 ` Richard Henderson
2009-12-19 18:44 ` [Qemu-devel] [PATCH 3/5] tcg-i386: Implement small forward branches Richard Henderson
2009-12-19 23:11 ` Aurelien Jarno
2009-12-19 23:32 ` Laurent Desnogues
2009-12-20 1:17 ` Richard Henderson
2009-12-19 18:44 ` [Qemu-devel] [PATCH 4/5] tcg: Add tcg_invert_cond Richard Henderson
2009-12-19 23:11 ` Aurelien Jarno
2009-12-19 18:46 ` [Qemu-devel] [PATCH 5/5] tcg-i386: Implement setcond Richard Henderson
2009-12-19 23:11 ` Aurelien Jarno
2009-12-22 12:20 ` Laurent Desnogues
2009-12-19 23:11 ` [Qemu-devel] [PATCH 0/5] tcg conditional set, round 4 Aurelien Jarno
2009-12-19 23:43 ` malc
2009-12-20 11:03 ` Blue Swirl
2009-12-20 22:57 ` Paul Brook
2009-12-21 2:00 ` Richard Henderson
2009-12-21 9:13 ` Laurent Desnogues
2009-12-21 9:47 ` [Qemu-devel] " Paolo Bonzini
2009-12-21 10:03 ` Laurent Desnogues
2009-12-21 20:28 ` [Qemu-devel] " Richard Henderson
2009-12-21 22:21 ` Laurent Desnogues
2009-12-21 22:50 ` Richard Henderson
2009-12-21 23:08 ` Laurent Desnogues
2009-12-22 0:02 ` Richard Henderson
2009-12-22 14:46 ` Laurent Desnogues
2009-12-22 7:19 ` Aurelien Jarno
2009-12-21 10:08 ` Aurelien Jarno
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=761ea48b0912220327g8184dddu20323f5c32cd390a@mail.gmail.com \
--to=laurent.desnogues@gmail.com \
--cc=aurelien@aurel32.net \
--cc=qemu-devel@nongnu.org \
--cc=rth@twiddle.net \
/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).