All of lore.kernel.org
 help / color / mirror / Atom feed
From: Claudio Fontana <claudio.fontana@huawei.com>
To: Richard Henderson <rth@twiddle.net>
Cc: Laurent Desnogues <laurent.desnogues@gmail.com>,
	Peter Maydell <peter.maydell@linaro.org>,
	Jani Kokkonen <Jani.Kokkonen@huawei.com>,
	qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 1/4] tcg/aarch64: more low level ops in preparation of tlb, lookup
Date: Mon, 3 Jun 2013 11:43:23 +0200	[thread overview]
Message-ID: <51AC653B.8080701@huawei.com> (raw)
In-Reply-To: <51A8F4D4.7000805@twiddle.net>

On 31.05.2013 21:07, Richard Henderson wrote:
> On 05/31/2013 10:57 AM, Jani Kokkonen wrote:
>> +    ARITH_SUBS = 0x6b,
> 
> Any reason you're adding SUBS here, but not ANDS?

I also forgot ANDS, I'll add them and reorder.

>> +/* encode a logical immediate, mapping user parameter
>> +   M=set bits pattern length to S=M-1 */
>> +static inline unsigned int
>> +aarch64_limm(unsigned int m, unsigned int r)
>> +{
>> +    assert(m > 0);
>> +    return r << 16 | (m - 1) << 10;
>> +}
>> +
>> +/* test a register against an immediate bit pattern made of
>> +   M set bits rotated right by R.
>> +   Examples:
>> +   to test a 32/64 reg against 0x00000007, pass M = 3,  R = 0.
>> +   to test a 32/64 reg against 0x000000ff, pass M = 8,  R = 0.
>> +   to test a 32bit reg against 0xff000000, pass M = 8,  R = 8.
>> +   to test a 32bit reg against 0xff0000ff, pass M = 16, R = 8.
>> + */
>> +static inline void tcg_out_tst(TCGContext *s, int ext, TCGReg rn,
>> +                               unsigned int m, unsigned int r)
>> +{
>> +    /* using TST alias of ANDS XZR, Xn,#bimm64 0x7200001f */
>> +    unsigned int base = ext ? 0xf240001f : 0x7200001f;
>> +    tcg_out32(s, base | aarch64_limm(m, r) | rn << 5);
>> +}
>> +
>> +/* and a register with a bit pattern, similarly to TST, no flags change */
>> +static inline void tcg_out_andi(TCGContext *s, int ext, TCGReg rd, TCGReg rn,
>> +                                unsigned int m, unsigned int r)
>> +{
>> +    /* using AND 0x12000000 */
>> +    unsigned int base = ext ? 0x92400000 : 0x12000000;
>> +    tcg_out32(s, base | aarch64_limm(m, r) | rn << 5 | rd);
>> +}
>> +
> 
> This should be a separate patch, since it's not related to the tcg_out_arith
> change.
> 

Agreed.

Claudio

  reply	other threads:[~2013-06-03  9:44 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-31 17:51 [Qemu-devel] [PATCH 0/4] ARM aarch64 TCG tlb fast lookup Jani Kokkonen
2013-05-31 17:57 ` [Qemu-devel] [PATCH 1/4] tcg/aarch64: more low level ops in preparation of tlb, lookup Jani Kokkonen
2013-05-31 19:07   ` Richard Henderson
2013-06-03  9:43     ` Claudio Fontana [this message]
2013-05-31 18:01 ` [Qemu-devel] [PATCH 2/4] tcg/aarch64: implement byte swap operations Jani Kokkonen
2013-05-31 19:11   ` Richard Henderson
2013-06-03  9:44     ` Claudio Fontana
2013-05-31 18:05 ` [Qemu-devel] [PATCH 3/4] tcg/aarch64: implement sign/zero extend operations Jani Kokkonen
2013-05-31 19:13   ` Richard Henderson
2013-06-03  9:48     ` Claudio Fontana
2013-05-31 18:07 ` [Qemu-devel] [PATCH 4/4] tcg/aarch64: implement tlb lookup fast path Jani Kokkonen
2013-05-31 20:25   ` Richard Henderson
2013-06-03 11:21     ` Jani Kokkonen
2013-06-03 15:52       ` Richard Henderson

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=51AC653B.8080701@huawei.com \
    --to=claudio.fontana@huawei.com \
    --cc=Jani.Kokkonen@huawei.com \
    --cc=laurent.desnogues@gmail.com \
    --cc=peter.maydell@linaro.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.