[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 2/3] tcg: Push merged memop+mmu_idx parameter to
From: |
Richard Henderson |
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 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 |
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~
- [Qemu-devel] [PATCH 1/3] tcg: Merge memop and mmu_idx parameters to qemu_ld/st, (continued)
[Qemu-devel] [PATCH 2/3] tcg: Push merged memop+mmu_idx parameter to softmmu routines, Richard Henderson, 2015/05/13