qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Richard Henderson <rth@twiddle.net>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: Yongbok Kim <yongbok.kim@imgtec.com>,
	Leon Alrae <leon.alrae@imgtec.com>,
	QEMU Developers <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH 2/3] tcg: Push merged memop+mmu_idx parameter to softmmu routines
Date: Wed, 13 May 2015 14:06:39 -0700	[thread overview]
Message-ID: <5553BCDF.9010309@twiddle.net> (raw)
In-Reply-To: <CAFEAcA_H9c=B96vMxy+pphrfVJKU19HpqPmeg-5h-ebBUU8OUA@mail.gmail.com>

On 05/13/2015 01:54 PM, Peter Maydell wrote:
>> @@ -168,10 +168,11 @@ static inline DATA_TYPE glue(io_read, SUFFIX)(CPUArchState *env,
>>  #ifdef SOFTMMU_CODE_ACCESS
>>  static __attribute__((unused))
>>  #endif
>> -WORD_TYPE helper_le_ld_name(CPUArchState *env, target_ulong addr, int mmu_idx,
>> -                            uintptr_t retaddr)
>> +WORD_TYPE helper_le_ld_name(CPUArchState *env, target_ulong addr,
>> +                            TCGMemOpIdx oi, uintptr_t retaddr)
>>  {
>> -    int index = (addr >> TARGET_PAGE_BITS) & (CPU_TLB_SIZE - 1);
>> +    size_t mmu_idx = get_mmuidx(oi);
> 
> We don't seem to be very consistent about what type we're using for
> mmu_idx. In the TCG backends changed in patch 1 (and in the
> prototype of this helper which we've just removed) we used 'int';
> in the return type of get_mmuidx() we use 'unsigned'; and here we're
> using size_t...

Yes, we previously used "int", but we only allow small positive values.  I
could have continued to use "int", but I thought "unsigned" more approprate
most places that it's actually used.

As for here, we're about to pass mmu_idx to several array references.  In the
past this has been known to help the compiler realize it doesn't need an
additional zero-extension.  That said, in this case with gcc 4.9, it doesn't
seem to affect code generation in any way except register allocation.  I can
change it back if you prefer.


r~

  reply	other threads:[~2015-05-13 21:06 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-13 19:09 [Qemu-devel] [RFC 0/3] Per-memory-op alignment checks Richard Henderson
2015-05-13 19:09 ` [Qemu-devel] [PATCH 1/3] tcg: Merge memop and mmu_idx parameters to qemu_ld/st Richard Henderson
2015-05-13 20:46   ` Peter Maydell
2015-05-13 20:49     ` Richard Henderson
2015-05-13 19:09 ` [Qemu-devel] [PATCH 2/3] tcg: Push merged memop+mmu_idx parameter to softmmu routines Richard Henderson
2015-05-13 20:54   ` Peter Maydell
2015-05-13 21:06     ` Richard Henderson [this message]
2015-05-13 21:12       ` Peter Maydell
2015-05-13 19:10 ` [Qemu-devel] [PATCH 3/3] tcg: Add MO_ALIGN, MO_UNALN Richard Henderson
2015-05-13 21:04   ` Peter Maydell
2015-05-13 21:08     ` Richard Henderson
2015-05-13 21:15       ` Peter Maydell
2015-05-13 21:19         ` 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=5553BCDF.9010309@twiddle.net \
    --to=rth@twiddle.net \
    --cc=leon.alrae@imgtec.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=yongbok.kim@imgtec.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).