[PATCH-for-11.0 v3 22/22] accel/tcg: Remove non-explicit endian cpu_ld/st*_data*() helpers

Philippe Mathieu-Daudé posted 22 patches 2 days, 13 hours ago
Maintainers: Richard Henderson <richard.henderson@linaro.org>, Paolo Bonzini <pbonzini@redhat.com>, Laurent Vivier <laurent@vivier.eu>, Brian Cain <brian.cain@oss.qualcomm.com>, Helge Deller <deller@gmx.de>, Zhao Liu <zhao1.liu@intel.com>, Eduardo Habkost <eduardo@habkost.net>, "Philippe Mathieu-Daudé" <philmd@linaro.org>, Aurelien Jarno <aurelien@aurel32.net>, Jiaxun Yang <jiaxun.yang@flygoat.com>, Aleksandar Rikalo <arikalo@gmail.com>, Nicholas Piggin <npiggin@gmail.com>, Chinmay Rath <rathc@linux.ibm.com>, Palmer Dabbelt <palmer@dabbelt.com>, Alistair Francis <alistair.francis@wdc.com>, Weiwei Li <liwei1518@gmail.com>, Daniel Henrique Barboza <dbarboza@ventanamicro.com>, Liu Zhiwei <zhiwei_liu@linux.alibaba.com>, Yoshinori Sato <yoshinori.sato@nifty.com>, Ilya Leoshkevich <iii@linux.ibm.com>, David Hildenbrand <david@kernel.org>, Thomas Huth <thuth@redhat.com>, Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>, Artyom Tarasenko <atar4qemu@gmail.com>, Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
[PATCH-for-11.0 v3 22/22] accel/tcg: Remove non-explicit endian cpu_ld/st*_data*() helpers
Posted by Philippe Mathieu-Daudé 2 days, 13 hours ago
All uses were converted to the explicit cpu_ld/st*_{be,le}_data*()
helpers, no need for the non-explicit versions anymore.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 include/accel/tcg/cpu-ldst.h | 46 ------------------------------------
 1 file changed, 46 deletions(-)

diff --git a/include/accel/tcg/cpu-ldst.h b/include/accel/tcg/cpu-ldst.h
index 0de7f5eaa6b..12dd38599a6 100644
--- a/include/accel/tcg/cpu-ldst.h
+++ b/include/accel/tcg/cpu-ldst.h
@@ -428,52 +428,6 @@ cpu_stq_le_data(CPUArchState *env, abi_ptr addr, uint64_t val)
     cpu_stq_le_data_ra(env, addr, val, 0);
 }
 
-#if TARGET_BIG_ENDIAN
-# define cpu_lduw_data        cpu_lduw_be_data
-# define cpu_ldsw_data        cpu_ldsw_be_data
-# define cpu_ldl_data         cpu_ldl_be_data
-# define cpu_ldq_data         cpu_ldq_be_data
-# define cpu_lduw_data_ra     cpu_lduw_be_data_ra
-# define cpu_ldsw_data_ra     cpu_ldsw_be_data_ra
-# define cpu_ldl_data_ra      cpu_ldl_be_data_ra
-# define cpu_ldq_data_ra      cpu_ldq_be_data_ra
-# define cpu_lduw_mmuidx_ra   cpu_lduw_be_mmuidx_ra
-# define cpu_ldsw_mmuidx_ra   cpu_ldsw_be_mmuidx_ra
-# define cpu_ldl_mmuidx_ra    cpu_ldl_be_mmuidx_ra
-# define cpu_ldq_mmuidx_ra    cpu_ldq_be_mmuidx_ra
-# define cpu_stw_data         cpu_stw_be_data
-# define cpu_stl_data         cpu_stl_be_data
-# define cpu_stq_data         cpu_stq_be_data
-# define cpu_stw_data_ra      cpu_stw_be_data_ra
-# define cpu_stl_data_ra      cpu_stl_be_data_ra
-# define cpu_stq_data_ra      cpu_stq_be_data_ra
-# define cpu_stw_mmuidx_ra    cpu_stw_be_mmuidx_ra
-# define cpu_stl_mmuidx_ra    cpu_stl_be_mmuidx_ra
-# define cpu_stq_mmuidx_ra    cpu_stq_be_mmuidx_ra
-#else
-# define cpu_lduw_data        cpu_lduw_le_data
-# define cpu_ldsw_data        cpu_ldsw_le_data
-# define cpu_ldl_data         cpu_ldl_le_data
-# define cpu_ldq_data         cpu_ldq_le_data
-# define cpu_lduw_data_ra     cpu_lduw_le_data_ra
-# define cpu_ldsw_data_ra     cpu_ldsw_le_data_ra
-# define cpu_ldl_data_ra      cpu_ldl_le_data_ra
-# define cpu_ldq_data_ra      cpu_ldq_le_data_ra
-# define cpu_lduw_mmuidx_ra   cpu_lduw_le_mmuidx_ra
-# define cpu_ldsw_mmuidx_ra   cpu_ldsw_le_mmuidx_ra
-# define cpu_ldl_mmuidx_ra    cpu_ldl_le_mmuidx_ra
-# define cpu_ldq_mmuidx_ra    cpu_ldq_le_mmuidx_ra
-# define cpu_stw_data         cpu_stw_le_data
-# define cpu_stl_data         cpu_stl_le_data
-# define cpu_stq_data         cpu_stq_le_data
-# define cpu_stw_data_ra      cpu_stw_le_data_ra
-# define cpu_stl_data_ra      cpu_stl_le_data_ra
-# define cpu_stq_data_ra      cpu_stq_le_data_ra
-# define cpu_stw_mmuidx_ra    cpu_stw_le_mmuidx_ra
-# define cpu_stl_mmuidx_ra    cpu_stl_le_mmuidx_ra
-# define cpu_stq_mmuidx_ra    cpu_stq_le_mmuidx_ra
-#endif
-
 static inline uint32_t cpu_ldub_code(CPUArchState *env, abi_ptr addr)
 {
     CPUState *cs = env_cpu(env);
-- 
2.51.0


Re: [PATCH-for-11.0 v3 22/22] accel/tcg: Remove non-explicit endian cpu_ld/st*_data*() helpers
Posted by Philippe Mathieu-Daudé 2 days, 13 hours ago
On 26/11/25 21:21, Philippe Mathieu-Daudé wrote:
> All uses were converted to the explicit cpu_ld/st*_{be,le}_data*()
> helpers, no need for the non-explicit versions anymore.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>   include/accel/tcg/cpu-ldst.h | 46 ------------------------------------
>   1 file changed, 46 deletions(-)
> 
> diff --git a/include/accel/tcg/cpu-ldst.h b/include/accel/tcg/cpu-ldst.h
> index 0de7f5eaa6b..12dd38599a6 100644
> --- a/include/accel/tcg/cpu-ldst.h
> +++ b/include/accel/tcg/cpu-ldst.h
> @@ -428,52 +428,6 @@ cpu_stq_le_data(CPUArchState *env, abi_ptr addr, uint64_t val)
>       cpu_stq_le_data_ra(env, addr, val, 0);
>   }
>   
> -#if TARGET_BIG_ENDIAN
> -# define cpu_lduw_data        cpu_lduw_be_data
> -# define cpu_ldsw_data        cpu_ldsw_be_data
> -# define cpu_ldl_data         cpu_ldl_be_data
> -# define cpu_ldq_data         cpu_ldq_be_data
> -# define cpu_lduw_data_ra     cpu_lduw_be_data_ra
> -# define cpu_ldsw_data_ra     cpu_ldsw_be_data_ra
> -# define cpu_ldl_data_ra      cpu_ldl_be_data_ra
> -# define cpu_ldq_data_ra      cpu_ldq_be_data_ra
> -# define cpu_lduw_mmuidx_ra   cpu_lduw_be_mmuidx_ra
> -# define cpu_ldsw_mmuidx_ra   cpu_ldsw_be_mmuidx_ra
> -# define cpu_ldl_mmuidx_ra    cpu_ldl_be_mmuidx_ra
> -# define cpu_ldq_mmuidx_ra    cpu_ldq_be_mmuidx_ra
> -# define cpu_stw_data         cpu_stw_be_data
> -# define cpu_stl_data         cpu_stl_be_data
> -# define cpu_stq_data         cpu_stq_be_data
> -# define cpu_stw_data_ra      cpu_stw_be_data_ra
> -# define cpu_stl_data_ra      cpu_stl_be_data_ra
> -# define cpu_stq_data_ra      cpu_stq_be_data_ra
> -# define cpu_stw_mmuidx_ra    cpu_stw_be_mmuidx_ra
> -# define cpu_stl_mmuidx_ra    cpu_stl_be_mmuidx_ra
> -# define cpu_stq_mmuidx_ra    cpu_stq_be_mmuidx_ra
> -#else
> -# define cpu_lduw_data        cpu_lduw_le_data
> -# define cpu_ldsw_data        cpu_ldsw_le_data
> -# define cpu_ldl_data         cpu_ldl_le_data
> -# define cpu_ldq_data         cpu_ldq_le_data
> -# define cpu_lduw_data_ra     cpu_lduw_le_data_ra
> -# define cpu_ldsw_data_ra     cpu_ldsw_le_data_ra
> -# define cpu_ldl_data_ra      cpu_ldl_le_data_ra
> -# define cpu_ldq_data_ra      cpu_ldq_le_data_ra
> -# define cpu_lduw_mmuidx_ra   cpu_lduw_le_mmuidx_ra
> -# define cpu_ldsw_mmuidx_ra   cpu_ldsw_le_mmuidx_ra
> -# define cpu_ldl_mmuidx_ra    cpu_ldl_le_mmuidx_ra
> -# define cpu_ldq_mmuidx_ra    cpu_ldq_le_mmuidx_ra
> -# define cpu_stw_data         cpu_stw_le_data
> -# define cpu_stl_data         cpu_stl_le_data
> -# define cpu_stq_data         cpu_stq_le_data
> -# define cpu_stw_data_ra      cpu_stw_le_data_ra
> -# define cpu_stl_data_ra      cpu_stl_le_data_ra
> -# define cpu_stq_data_ra      cpu_stq_le_data_ra
> -# define cpu_stw_mmuidx_ra    cpu_stw_le_mmuidx_ra
> -# define cpu_stl_mmuidx_ra    cpu_stl_le_mmuidx_ra
> -# define cpu_stq_mmuidx_ra    cpu_stq_le_mmuidx_ra
> -#endif
> -

Missing to squash:

-- >8 --
diff --git a/docs/devel/loads-stores.rst b/docs/devel/loads-stores.rst
index c906c6509ee..e956aece673 100644
--- a/docs/devel/loads-stores.rst
+++ b/docs/devel/loads-stores.rst
@@ -152,3 +152,3 @@ store: ``cpu_st{size}{end}_mmuidx_ra(env, ptr, val, 
mmuidx, retaddr)``
  ``end``
- - (empty) : for target endian, or 8 bit sizes
+ - (empty) : for 8 bit sizes
   - ``_be`` : big endian
@@ -157,4 +157,4 @@ store: ``cpu_st{size}{end}_mmuidx_ra(env, ptr, val, 
mmuidx, retaddr)``
  Regexes for git grep:
- - ``\<cpu_ld[us]\?[bwlq]\(_[bl]e\)\?_mmuidx_ra\>``
- - ``\<cpu_st[bwlq]\(_[bl]e\)\?_mmuidx_ra\>``
+ - ``\<cpu_ld[us]\?\(b\|[wlq]\(_[bl]e\)\)_mmuidx_ra\>``
+ - ``\<cpu_st\(b\|[wlq]\(_[bl]e\)\)_mmuidx_ra\>``

@@ -190,3 +190,3 @@ store: ``cpu_st{size}{end}_data_ra(env, ptr, val, ra)``
  ``end``
- - (empty) : for target endian, or 8 bit sizes
+ - (empty) : for 8 bit sizes
   - ``_be`` : big endian
@@ -195,4 +195,4 @@ store: ``cpu_st{size}{end}_data_ra(env, ptr, val, ra)``
  Regexes for git grep:
- - ``\<cpu_ld[us]\?[bwlq]\(_[bl]e\)\?_data_ra\>``
- - ``\<cpu_st[bwlq]\(_[bl]e\)\?_data_ra\>``
+ - ``\<cpu_ld[us]\?\(b\|[wlq]\(_[bl]e\)\)_data_ra\>``
+ - ``\<cpu_st\(b\|[wlq]\(_[bl]e\)\)_data_ra\>``

@@ -229,3 +229,3 @@ store: ``cpu_st{size}{end}_data(env, ptr, val)``
  ``end``
- - (empty) : for target endian, or 8 bit sizes
+ - (empty) : for 8 bit sizes
   - ``_be`` : big endian
@@ -234,4 +234,4 @@ store: ``cpu_st{size}{end}_data(env, ptr, val)``
  Regexes for git grep:
- - ``\<cpu_ld[us]\?[bwlq]\(_[bl]e\)\?_data\>``
- - ``\<cpu_st[bwlq]\(_[bl]e\)\?_data\+\>``
+ - ``\<cpu_ld[us]\?\(b\|[wlq]\(_[bl]e\)\)_data\>``
+ - ``\<cpu_st\(b\|[wlq]\(_[bl]e\)\)_data\+\>``
---