[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 07/26] tcg-aarch64: Use adrp in tcg_out_movi
From: |
Richard Henderson |
Subject: |
Re: [Qemu-devel] [PATCH 07/26] tcg-aarch64: Use adrp in tcg_out_movi |
Date: |
Mon, 24 Mar 2014 08:36:59 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 |
On 03/24/2014 07:05 AM, Claudio Fontana wrote:
>> > + /* Look for host pointer values within 4G of the PC. This happens
>> > + often when loading pointers to QEMU's own data structures. */
>> > + disp = (value >> 12) - ((intptr_t)s->code_ptr >> 12);
>> > + if (disp == sextract64(disp, 0, 21)) {
>
> nit.. for the check to be correct in all cases, the assumption here is that
> intptr_t is the same size as a signed target long; would a cast to
> tcg_target_long instead of intptr_t be "safer"?
>
I don't think so.
Gcc 4.9 supports an -m32 abi for aarch64. Suppose we were to compile qemu this
way. In that case tcg_target_long would be larger than intptr_t, and the cast
here would Werror. But leaving it intptr_t, we get a proper sign-extension
with type promotion to tcg_target_long, and the arithmetic will in fact work
like expected.
r~
- [Qemu-devel] [PATCH 02/26] tcg-aarch64: Use intptr_t apropriately, (continued)
- [Qemu-devel] [PATCH 02/26] tcg-aarch64: Use intptr_t apropriately, Richard Henderson, 2014/03/14
- [Qemu-devel] [PATCH 03/26] tcg-aarch64: Use TCGType and TCGMemOp constants, Richard Henderson, 2014/03/14
- [Qemu-devel] [PATCH 04/26] tcg-aarch64: Use MOVN in tcg_out_movi, Richard Henderson, 2014/03/14
- [Qemu-devel] [PATCH 06/26] tcg-aarch64: Special case small constants in tcg_out_movi, Richard Henderson, 2014/03/14
- [Qemu-devel] [PATCH 07/26] tcg-aarch64: Use adrp in tcg_out_movi, Richard Henderson, 2014/03/14
- [Qemu-devel] [PATCH 05/26] tcg-aarch64: Use ORRI in tcg_out_movi, Richard Henderson, 2014/03/14
- [Qemu-devel] [PATCH 08/26] tcg-aarch64: Use symbolic names for branches, Richard Henderson, 2014/03/14
- [Qemu-devel] [PATCH 09/26] tcg-aarch64: Create tcg_out_brcond, Richard Henderson, 2014/03/14
- [Qemu-devel] [PATCH 10/26] tcg-aarch64: Use CBZ and CBNZ, Richard Henderson, 2014/03/14
- [Qemu-devel] [PATCH 11/26] tcg-aarch64: Reuse FP and LR in translated code, Richard Henderson, 2014/03/14