qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Richard Henderson <rth@twiddle.net>
To: Aurelien Jarno <aurelien@aurel32.net>
Cc: "Philippe Mathieu-Daudé" <f4bug@amsat.org>,
	qemu-devel@nongnu.org, "Peter Maydell" <peter.maydell@linaro.org>,
	qemu-arm@nongnu.org
Subject: Re: [Qemu-devel] [PATCH v3 2/5] target/arm: optimize rev16() using extract op
Date: Fri, 12 May 2017 12:05:00 -0700	[thread overview]
Message-ID: <aaa04be5-78d6-311b-609b-d02f18e9ef96@twiddle.net> (raw)
In-Reply-To: <20170512182132.jdw4g2pd5gvf2dti@aurel32.net>

On 05/12/2017 11:21 AM, Aurelien Jarno wrote:
> +    uint64_t mask1 = sf ? 0x00ff00ff00ff00ffull : 0x00ff00ff;
> +    uint64_t mask2 = sf ? 0xff00ff00ff00ff00ull : 0xff00ff00;
> +
> +    tcg_gen_shri_i64(tcg_tmp, tcg_rn, 8);
> +    tcg_gen_andi_i64(tcg_tmp, tcg_tmp, mask1);
> +    tcg_gen_shli_i64(tcg_rd, tcg_rn, 8);
> +    tcg_gen_andi_i64(tcg_rd, tcg_rd, mask2);

It would probably be better to use a single mask, since they're not free to 
instantiate in a register.  So e.g.

   TCGv mask = tcg_const_i64(sf ? 0x00ff00ff00ff00ffull : 0x00ff00ff);
   tcg_gen_shri_i64(tcg_tmp, tcg_rn, 8);
   tcg_gen_and_i64(tcg_rd, tcg_rn, mask);
   tcg_gen_and_i64(tcg_tmp, tcg_tmp, mask);
   tcg_gen_shli_i64(tcg_rd, tcg_rd, 8);


r~

  reply	other threads:[~2017-05-12 19:05 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-12  3:35 [Qemu-devel] [PATCH v3 0/5] optimize various tcg_gen() functions using extract op Philippe Mathieu-Daudé
2017-05-12  3:35 ` [Qemu-devel] [RFC PATCH v3 1/5] coccinelle: add a script to optimize tcg op using tcg_gen_extract() Philippe Mathieu-Daudé
2017-05-12  3:41   ` Julia Lawall
2017-05-12  5:36     ` Philippe Mathieu-Daudé
2017-05-12  7:16       ` Julia Lawall
2017-05-12  7:39         ` SF Markus Elfring
2017-05-12 17:49       ` Eric Blake
2017-05-12  5:48   ` SF Markus Elfring
2017-05-12 11:00   ` SF Markus Elfring
2017-05-12  3:35 ` [Qemu-devel] [PATCH v3 2/5] target/arm: optimize rev16() using extract op Philippe Mathieu-Daudé
2017-05-12 16:50   ` Richard Henderson
2017-05-12 18:21     ` Aurelien Jarno
2017-05-12 19:05       ` Richard Henderson [this message]
2017-05-12 19:22         ` Aurelien Jarno
2017-05-12 19:38           ` Richard Henderson
2017-05-12 23:50     ` Philippe Mathieu-Daudé
2017-05-12  3:35 ` [Qemu-devel] [PATCH v3 3/5] target/m68k: optimize bcd_flags() " Philippe Mathieu-Daudé
2017-05-12  3:35 ` [Qemu-devel] [PATCH v3 4/5] target/ppc: using various functions " Philippe Mathieu-Daudé
2017-05-12 23:48   ` Philippe Mathieu-Daudé
2017-05-12  3:35 ` [Qemu-devel] [PATCH v3 5/5] target/sparc: optimize " Philippe Mathieu-Daudé
2017-05-12 23:49   ` Philippe Mathieu-Daudé

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=aaa04be5-78d6-311b-609b-d02f18e9ef96@twiddle.net \
    --to=rth@twiddle.net \
    --cc=aurelien@aurel32.net \
    --cc=f4bug@amsat.org \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-arm@nongnu.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).