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~