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 via email to