[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 06/28] cputlb: Rename helper_ret_ld*_cmmu to cpu_ld*_code
From: |
Richard Henderson |
Subject: |
Re: [PATCH v2 06/28] cputlb: Rename helper_ret_ld*_cmmu to cpu_ld*_code |
Date: |
Sun, 29 Dec 2019 07:58:00 +1100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 |
On 12/21/19 4:25 AM, Alex Bennée wrote:
>> -#define CPU_MMU_INDEX (cpu_mmu_index(env, true))
>> -#define MEMSUFFIX _code
>> -#define SOFTMMU_CODE_ACCESS
>> +uint32_t cpu_ldub_code(CPUArchState *env, abi_ptr addr);
>> +uint32_t cpu_lduw_code(CPUArchState *env, abi_ptr addr);
>> +uint32_t cpu_ldl_code(CPUArchState *env, abi_ptr addr);
>> +uint64_t cpu_ldq_code(CPUArchState *env, abi_ptr addr);
>>
>> -#define DATA_SIZE 1
>> -#include "exec/cpu_ldst_template.h"
>> +static inline int cpu_ldsb_code(CPUArchState *env, abi_ptr addr)
>> +{
>> + return (int8_t)cpu_ldub_code(env, addr);
>> +}
...
>> -uint8_t helper_ret_ldub_cmmu(CPUArchState *env, target_ulong addr,
>> - TCGMemOpIdx oi, uintptr_t retaddr);
>> -int8_t helper_ret_ldsb_cmmu(CPUArchState *env, target_ulong addr,
>> - TCGMemOpIdx oi, uintptr_t retaddr);
>> -uint16_t helper_le_lduw_cmmu(CPUArchState *env, target_ulong addr,
>> - TCGMemOpIdx oi, uintptr_t retaddr);
>> -int16_t helper_le_ldsw_cmmu(CPUArchState *env, target_ulong addr,
>> - TCGMemOpIdx oi, uintptr_t retaddr);
>> -uint32_t helper_le_ldl_cmmu(CPUArchState *env, target_ulong addr,
>> - TCGMemOpIdx oi, uintptr_t retaddr);
>> -uint64_t helper_le_ldq_cmmu(CPUArchState *env, target_ulong addr,
>> - TCGMemOpIdx oi, uintptr_t retaddr);
>> -uint16_t helper_be_lduw_cmmu(CPUArchState *env, target_ulong addr,
>> - TCGMemOpIdx oi, uintptr_t retaddr);
>> -int16_t helper_be_ldsw_cmmu(CPUArchState *env, target_ulong addr,
>> - TCGMemOpIdx oi, uintptr_t retaddr);
>> -uint32_t helper_be_ldl_cmmu(CPUArchState *env, target_ulong addr,
>> - TCGMemOpIdx oi, uintptr_t retaddr);
>> -uint64_t helper_be_ldq_cmmu(CPUArchState *env, target_ulong addr,
>> - TCGMemOpIdx oi, uintptr_t retaddr);
>> -
> <snip>
>
> Why have we dropped the final type and stuck to uint32/64? Do we rely on
> the caller truncating any data by casting the result of their eventual
> cpu_ldFoo?
I have *preserved* the existing type of cpu_ld*_code(), the actual interface
that is being used.
Cleaning up the load return and store value types is another project. I would
not limit that to *_code, though. And I'd want to think of some way to prove
that all callers are getting the promotion that they expected.
r~
- Re: [PATCH v2 03/28] trace: Remove trace_mem_build_info_no_se_[bl]e, (continued)
- [PATCH v2 04/28] cputlb: Move body of cpu_ldst_template.h out of line, Richard Henderson, 2019/12/16
- [PATCH v2 05/28] translator: Use cpu_ld*_code instead of open-coding, Richard Henderson, 2019/12/16
- [PATCH v2 06/28] cputlb: Rename helper_ret_ld*_cmmu to cpu_ld*_code, Richard Henderson, 2019/12/16
- [PATCH v2 07/28] cputlb: Provide cpu_(ld, st}*_mmuidx_ra for user-only, Richard Henderson, 2019/12/16
- [PATCH v2 08/28] target/i386: Use cpu_*_mmuidx_ra instead of templates, Richard Henderson, 2019/12/16
- [PATCH v2 09/28] target/s390x: Include tcg.h in mem_helper.c, Richard Henderson, 2019/12/16
- [PATCH v2 10/28] target/arm: Include tcg.h in sve_helper.c, Richard Henderson, 2019/12/16
- [PATCH v2 11/28] accel/tcg: Include tcg.h in tcg-runtime.c, Richard Henderson, 2019/12/16