[PATCH v9 19/20] target/arm/tcg/translate.c: remove target_ulong

Pierrick Bouvier posted 20 patches 4 days, 16 hours ago
Maintainers: Richard Henderson <richard.henderson@linaro.org>, Paolo Bonzini <pbonzini@redhat.com>, Peter Maydell <peter.maydell@linaro.org>, Michael Rolnik <mrolnik@gmail.com>, Brian Cain <brian.cain@oss.qualcomm.com>, Helge Deller <deller@gmx.de>, Song Gao <gaosong@loongson.cn>, Laurent Vivier <laurent@vivier.eu>, "Edgar E. Iglesias" <edgar.iglesias@gmail.com>, "Philippe Mathieu-Daudé" <philmd@linaro.org>, Aurelien Jarno <aurelien@aurel32.net>, Jiaxun Yang <jiaxun.yang@flygoat.com>, Aleksandar Rikalo <arikalo@gmail.com>, Stafford Horne <shorne@gmail.com>, Nicholas Piggin <npiggin@gmail.com>, Chinmay Rath <rathc@linux.ibm.com>, Glenn Miles <milesg@linux.ibm.com>, Palmer Dabbelt <palmer@dabbelt.com>, Alistair Francis <alistair.francis@wdc.com>, Weiwei Li <liwei1518@gmail.com>, Daniel Henrique Barboza <daniel.barboza@oss.qualcomm.com>, Liu Zhiwei <zhiwei_liu@linux.alibaba.com>, Chao Liu <chao.liu.zevorn@gmail.com>, Yoshinori Sato <yoshinori.sato@nifty.com>, Ilya Leoshkevich <iii@linux.ibm.com>, David Hildenbrand <david@kernel.org>, Cornelia Huck <cohuck@redhat.com>, Eric Farman <farman@linux.ibm.com>, Matthew Rosato <mjrosato@linux.ibm.com>, Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>, Artyom Tarasenko <atar4qemu@gmail.com>, Bastian Koppelmann <kbastian@rumtueddeln.de>, Max Filippov <jcmvbkbc@gmail.com>
There is a newer version of this series
[PATCH v9 19/20] target/arm/tcg/translate.c: remove target_ulong
Posted by Pierrick Bouvier 4 days, 16 hours ago
We can replace it with uint32_t, because we know it's limited to 32-bit
target.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
---
 target/arm/tcg/translate.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/target/arm/tcg/translate.c b/target/arm/tcg/translate.c
index 5b6a80930af..ee3407fbd7f 100644
--- a/target/arm/tcg/translate.c
+++ b/target/arm/tcg/translate.c
@@ -6281,7 +6281,7 @@ static void disas_thumb_insn(DisasContext *s, uint32_t insn)
 
 /* Ditto, for a halfword (Thumb) instruction */
 static uint16_t arm_lduw_code(CPUARMState *env, DisasContextBase* s,
-                              target_ulong addr, bool sctlr_b)
+                              uint32_t addr, bool sctlr_b)
 {
     MemOp end = MO_LE;
     if (sctlr_b) {
@@ -6528,7 +6528,7 @@ static void arm_post_translate_insn(DisasContext *dc)
 
 /* Load an instruction and return it in the standard little-endian order */
 static uint32_t arm_ldl_code(CPUARMState *env, DisasContextBase *s,
-                             target_ulong addr, bool sctlr_b)
+                             uint32_t addr, bool sctlr_b)
 {
     return translator_ldl_end(env, s, addr, sctlr_b ? MO_BE : MO_LE);
 }
-- 
2.47.3
Re: [PATCH v9 19/20] target/arm/tcg/translate.c: remove target_ulong
Posted by Philippe Mathieu-Daudé 3 days, 23 hours ago
On 7/4/26 04:27, Pierrick Bouvier wrote:
> We can replace it with uint32_t, because we know it's limited to 32-bit
> target.

That, or widen to vaddr for consistency and save a "why this uint32_t
type here?", anyway:

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>

> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
> Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
> ---
>   target/arm/tcg/translate.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)


Re: [PATCH v9 19/20] target/arm/tcg/translate.c: remove target_ulong
Posted by Pierrick Bouvier 3 days, 22 hours ago
On 4/7/26 12:16 PM, Philippe Mathieu-Daudé wrote:
> On 7/4/26 04:27, Pierrick Bouvier wrote:
>> We can replace it with uint32_t, because we know it's limited to 32-bit
>> target.
> 
> That, or widen to vaddr for consistency and save a "why this uint32_t
> type here?", anyway:
>

It's really specifically uint32_t we want here.

> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> 
>> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
>> Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
>> ---
>>    target/arm/tcg/translate.c | 4 ++--
>>    1 file changed, 2 insertions(+), 2 deletions(-)
> 


Re: [PATCH v9 19/20] target/arm/tcg/translate.c: remove target_ulong
Posted by Philippe Mathieu-Daudé 3 days, 9 hours ago
On 7/4/26 21:56, Pierrick Bouvier wrote:
> On 4/7/26 12:16 PM, Philippe Mathieu-Daudé wrote:
>> On 7/4/26 04:27, Pierrick Bouvier wrote:
>>> We can replace it with uint32_t, because we know it's limited to 32-bit
>>> target.
>>
>> That, or widen to vaddr for consistency and save a "why this uint32_t
>> type here?", anyway:
>>
> 
> It's really specifically uint32_t we want here.

Well, the caller pass a vaddr argument and the single callee also takes
a vaddr type, so sticking to vaddr is more meaningful but probably a
simple matter of taste at this point, I don't mind much.

> 
>> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>>
>>> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
>>> Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
>>> ---
>>>    target/arm/tcg/translate.c | 4 ++--
>>>    1 file changed, 2 insertions(+), 2 deletions(-)
>>
>