Richard Henderson <richard.hender...@linaro.org> writes:
> There are no uses of the *_cmmu names other than the bare wrapping > within the *_code inlines. Therefore rename the functions so we > can drop the inlines. > > Use abi_ptr instead of target_ulong in preparation for user-only; > the two types are identical for softmmu. > > Reviewed-by: Aleksandar Markovic <amarko...@wavecomp.com> > Signed-off-by: Richard Henderson <richard.hender...@linaro.org> > --- > include/exec/cpu_ldst.h | 29 ++++------ > include/exec/cpu_ldst_template.h | 21 ------- > tcg/tcg.h | 29 ---------- > accel/tcg/cputlb.c | 94 ++++++++------------------------ > docs/devel/loads-stores.rst | 4 +- > 5 files changed, 36 insertions(+), 141 deletions(-) > > diff --git a/include/exec/cpu_ldst.h b/include/exec/cpu_ldst.h > index 399ff6c3da..ef59ed61e4 100644 > --- a/include/exec/cpu_ldst.h > +++ b/include/exec/cpu_ldst.h > @@ -450,25 +450,20 @@ void cpu_stq_mmuidx_ra(CPUArchState *env, abi_ptr addr, > uint64_t val, > #undef CPU_MMU_INDEX > #undef MEMSUFFIX > > -#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); > +} <snip> > --- a/tcg/tcg.h > +++ b/tcg/tcg.h > @@ -1290,27 +1290,6 @@ void helper_be_stl_mmu(CPUArchState *env, target_ulong > addr, uint32_t val, > void helper_be_stq_mmu(CPUArchState *env, target_ulong addr, uint64_t val, > TCGMemOpIdx oi, uintptr_t retaddr); > > -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? -- Alex Bennée