From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: Thomas Huth <thuth@redhat.com>, qemu-devel@nongnu.org
Cc: qemu-arm@nongnu.org, qemu-s390x@nongnu.org,
Paolo Bonzini <pbonzini@redhat.com>,
qemu-riscv@nongnu.org, Peter Maydell <peter.maydell@linaro.org>,
Richard Henderson <richard.henderson@linaro.org>,
qemu-ppc@nongnu.org
Subject: Re: [PATCH 03/10] target/arm: Set disassemble_info::endian value in disas_set_info()
Date: Mon, 10 Feb 2025 22:24:26 +0100 [thread overview]
Message-ID: <ad266394-bf8c-4030-831c-b7e16aefd803@linaro.org> (raw)
In-Reply-To: <c364ee71-7f0c-43d2-8ded-a7b8156c0839@redhat.com>
On 27/1/25 14:57, Thomas Huth wrote:
> On 27/01/2025 12.54, Philippe Mathieu-Daudé wrote:
>> Have the CPUClass::disas_set_info() callback set the
>> disassemble_info::endian field.
>>
>> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>> ---
>> target/arm/cpu.c | 2 ++
>> 1 file changed, 2 insertions(+)
>>
>> diff --git a/target/arm/cpu.c b/target/arm/cpu.c
>> index f9fdf708653..9de8c799c77 100644
>> --- a/target/arm/cpu.c
>> +++ b/target/arm/cpu.c
>> @@ -1220,6 +1220,8 @@ static void arm_disas_set_info(CPUState *cpu,
>> disassemble_info *info)
>> #else
>> info->endian = BFD_ENDIAN_BIG;
>> #endif
>> + } else {
>> + info->endian = BFD_ENDIAN_LITTLE;
>> }
>
> I'd maybe rather go with something like this:
>
> info->endian = BFD_ENDIAN_LITTLE;
> #if TARGET_BIG_ENDIAN
> if (bswap_code(sctlr_b)) {
> info->endian = BFD_ENDIAN_LITTLE;
> }
This misses:
else {
info->endian = BFD_ENDIAN_BIG;
}
> #endif
>
> What do you think?
I'll go with Richard's ternary suggestion for v2 and see :)
next prev parent reply other threads:[~2025-02-10 21:25 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-27 11:54 [PATCH 00/10] disas: Have CPUClass::disas_set_info() callback set the endianness Philippe Mathieu-Daudé
2025-01-27 11:54 ` [PATCH 01/10] target: Set disassemble_info::endian value for little-endian targets Philippe Mathieu-Daudé
2025-01-27 13:49 ` Thomas Huth
2025-01-27 11:54 ` [PATCH 02/10] target: Set disassemble_info::endian value for big-endian targets Philippe Mathieu-Daudé
2025-01-27 13:50 ` Thomas Huth
2025-01-27 11:54 ` [PATCH 03/10] target/arm: Set disassemble_info::endian value in disas_set_info() Philippe Mathieu-Daudé
2025-01-27 13:57 ` Thomas Huth
2025-02-10 21:24 ` Philippe Mathieu-Daudé [this message]
2025-01-27 11:54 ` [PATCH 04/10] target/microblaze: Set disassemble_info::endian value in disas_set_info Philippe Mathieu-Daudé
2025-01-27 14:03 ` Thomas Huth
2025-01-27 16:24 ` Richard Henderson
2025-01-27 11:54 ` [PATCH 05/10] target/mips: Set disassemble_info::endian value in disas_set_info() Philippe Mathieu-Daudé
2025-01-27 13:58 ` Thomas Huth
2025-01-27 11:54 ` [PATCH 06/10] target/ppc: " Philippe Mathieu-Daudé
2025-01-27 14:03 ` Thomas Huth
2025-01-27 11:54 ` [PATCH 07/10] target/riscv: " Philippe Mathieu-Daudé
2025-01-27 14:04 ` Thomas Huth
2025-01-27 11:54 ` [PATCH 08/10] target/sh4: " Philippe Mathieu-Daudé
2025-01-27 14:05 ` Thomas Huth
2025-01-27 11:54 ` [PATCH 09/10] target/xtensa: " Philippe Mathieu-Daudé
2025-01-27 14:05 ` Thomas Huth
2025-01-27 11:54 ` [PATCH 10/10] disas: Remove target_words_bigendian() call in initialize_debug_target() Philippe Mathieu-Daudé
2025-01-27 14:07 ` Thomas Huth
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ad266394-bf8c-4030-831c-b7e16aefd803@linaro.org \
--to=philmd@linaro.org \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
--cc=qemu-riscv@nongnu.org \
--cc=qemu-s390x@nongnu.org \
--cc=richard.henderson@linaro.org \
--cc=thuth@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).