qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH-for-8.0 0/3] tcg: Replace tcg_target_[u]long -> [u]intptr_t


From: Richard Henderson
Subject: Re: [PATCH-for-8.0 0/3] tcg: Replace tcg_target_[u]long -> [u]intptr_t
Date: Wed, 30 Nov 2022 12:49:40 -0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2

On 11/30/22 05:26, Philippe Mathieu-Daudé wrote:
Trivial cleanup (99% mechanical) suggested by rth:
the tcg_target_[u]long type is redundant with [u]intptr_t.

Ah, no, what I said was that much of the usage in tcg-op.h should be either ptrdiff_t or intptr_t. In particular, e.g.

static inline void tcg_gen_ld_i32(TCGv_i32 ret, TCGv_ptr arg2,
                                  tcg_target_long offset)

should change, because @offset is an addend to a host pointer. In this case ptrdiff_t seems more descriptive than intptr_t.

Generalized replacement is wrong. In particular it would break x32 (ilp32 on x86_64)... not that I've done any testing of that in the past few releases, and qemu is exactly the wrong sort of application to be skimping on host pointer width.


r~



reply via email to

[Prev in Thread] Current Thread [Next in Thread]