[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: |
Alex Bennée |
Subject: |
Re: [PATCH v2 06/28] cputlb: Rename helper_ret_ld*_cmmu to cpu_ld*_code |
Date: |
Fri, 20 Dec 2019 17:25:45 +0000 |
User-agent: |
mu4e 1.3.5; emacs 27.0.50 |
Richard Henderson <address@hidden> 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 <address@hidden>
> Signed-off-by: Richard Henderson <address@hidden>
> ---
> 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
- 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
- Re: [PATCH v2 06/28] cputlb: Rename helper_ret_ld*_cmmu to cpu_ld*_code,
Alex Bennée <=
- [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