From: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
To: Richard Henderson <rth@twiddle.net>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] target-cris: Use new qemu_ld/st opcodes
Date: Sun, 8 Dec 2013 15:10:52 +0100 [thread overview]
Message-ID: <20131208141052.GC3738@zapo> (raw)
In-Reply-To: <1386381154-29682-1-git-send-email-rth@twiddle.net>
On Sat, Dec 07, 2013 at 02:52:34PM +1300, Richard Henderson wrote:
> Using the new opcodes we can reduce if/else trees to
> a single statement.
I committed this, thanks.
Edgar
>
> Cc: Edgar E. Iglesias <edgar.iglesias@gmail.com>
> Signed-off-by: Richard Henderson <rth@twiddle.net>
> ---
> target-cris/translate.c | 29 ++++-------------------------
> 1 file changed, 4 insertions(+), 25 deletions(-)
>
> diff --git a/target-cris/translate.c b/target-cris/translate.c
> index 5faa44c..f990d59 100644
> --- a/target-cris/translate.c
> +++ b/target-cris/translate.c
> @@ -1133,7 +1133,7 @@ static void gen_load64(DisasContext *dc, TCGv_i64 dst, TCGv addr)
> cris_store_direct_jmp(dc);
> }
>
> - tcg_gen_qemu_ld64(dst, addr, mem_index);
> + tcg_gen_qemu_ld_i64(dst, addr, mem_index, MO_TEQ);
> }
>
> static void gen_load(DisasContext *dc, TCGv dst, TCGv addr,
> @@ -1147,23 +1147,8 @@ static void gen_load(DisasContext *dc, TCGv dst, TCGv addr,
> cris_store_direct_jmp(dc);
> }
>
> - if (size == 1) {
> - if (sign) {
> - tcg_gen_qemu_ld8s(dst, addr, mem_index);
> - } else {
> - tcg_gen_qemu_ld8u(dst, addr, mem_index);
> - }
> - } else if (size == 2) {
> - if (sign) {
> - tcg_gen_qemu_ld16s(dst, addr, mem_index);
> - } else {
> - tcg_gen_qemu_ld16u(dst, addr, mem_index);
> - }
> - } else if (size == 4) {
> - tcg_gen_qemu_ld32u(dst, addr, mem_index);
> - } else {
> - abort();
> - }
> + tcg_gen_qemu_ld_tl(dst, addr, mem_index,
> + MO_TE + ctz32(size) + (sign ? MO_SIGN : 0));
> }
>
> static void gen_store (DisasContext *dc, TCGv addr, TCGv val,
> @@ -1187,13 +1172,7 @@ static void gen_store (DisasContext *dc, TCGv addr, TCGv val,
> return;
> }
>
> - if (size == 1) {
> - tcg_gen_qemu_st8(val, addr, mem_index);
> - } else if (size == 2) {
> - tcg_gen_qemu_st16(val, addr, mem_index);
> - } else {
> - tcg_gen_qemu_st32(val, addr, mem_index);
> - }
> + tcg_gen_qemu_st_tl(val, addr, mem_index, MO_TE + ctz32(size));
>
> if (dc->flagx_known && dc->flags_x) {
> cris_evaluate_flags(dc);
> --
> 1.8.3.1
>
prev parent reply other threads:[~2013-12-08 14:11 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-07 1:52 [Qemu-devel] [PATCH] target-cris: Use new qemu_ld/st opcodes Richard Henderson
2013-12-08 14:10 ` Edgar E. Iglesias [this message]
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=20131208141052.GC3738@zapo \
--to=edgar.iglesias@gmail.com \
--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).