From: "Philippe Mathieu-Daudé" <f4bug@amsat.org>
To: Thomas Huth <thuth@redhat.com>,
qemu-devel@nongnu.org, Marek Vasut <marex@denx.de>
Cc: "Alex Bennée" <alex.bennee@linaro.org>,
"Chris Wulff" <crwulff@gmail.com>,
"Richard Henderson" <richard.henderson@linaro.org>,
"Alexander Graf" <agraf@csgraf.de>
Subject: Re: [PATCH-for-6.2 2/2] disas/nios2: Simplify endianess conversion
Date: Mon, 9 Aug 2021 11:48:48 +0200 [thread overview]
Message-ID: <bb2a9d03-94c3-bf48-ace0-e9669950f34e@amsat.org> (raw)
In-Reply-To: <b869358f-caed-6e03-5822-ada080961a11@redhat.com>
On 8/9/21 8:12 AM, Thomas Huth wrote:
> On 07/08/2021 13.09, Philippe Mathieu-Daudé wrote:
>> Since commit 12b6e9b27d4 ("disas: Clean up CPUDebug initialization")
>> the disassemble_info->bfd_endian enum is set for all targets in
>> target_disas(). We can directly call print_insn_nios2() and simplify.
>>
>> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
>> ---
>> include/disas/dis-asm.h | 3 +--
>> disas/nios2.c | 22 +++-------------------
>> target/nios2/cpu.c | 6 +-----
>> 3 files changed, 5 insertions(+), 26 deletions(-)
> [...]
>> diff --git a/target/nios2/cpu.c b/target/nios2/cpu.c
>> index 5e37defef80..5b503b5bb99 100644
>> --- a/target/nios2/cpu.c
>> +++ b/target/nios2/cpu.c
>> @@ -146,11 +146,7 @@ static void nios2_cpu_disas_set_info(CPUState
>> *cpu, disassemble_info *info)
>> {
>> /* NOTE: NiosII R2 is not supported yet. */
>> info->mach = bfd_arch_nios2;
>> -#ifdef TARGET_WORDS_BIGENDIAN
>> - info->print_insn = print_insn_big_nios2;
>> -#else
>> - info->print_insn = print_insn_little_nios2;
>> -#endif
>> + info->print_insn = print_insn_nios2;
>> }
>
> Oh, wow, I didn't even know that nios2 could be compiled with different
> endianness? I mean, we only have a "nios2-softmmu" target, not something
> like "nios2be-softmmu" and "nios2le-softmmu" ?
$ git grep ENDIAN configs/targets/nios2-*
$
We only build little-endian targets, but looking at commit
b7862564880 ("nios2: Add Altera 10M50 GHRD emulation")
hw/nios2/boot.c is ready to load big-endian ELF if we were
building the big-endian targets.
> Anyway, your patch makes a lot of sense to clean this up.
>
> Reviewed-by: Thomas Huth <thuth@redhat.com>
>
>
next prev parent reply other threads:[~2021-08-09 9:49 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-07 11:09 [PATCH-for-6.2 0/2] disas/nios2: Simplify endianess conversion Philippe Mathieu-Daudé
2021-08-07 11:09 ` [PATCH-for-6.2 1/2] disas/nios2: Fix style in print_insn_nios2() Philippe Mathieu-Daudé
2021-08-09 6:08 ` Thomas Huth
2021-08-09 7:14 ` Philippe Mathieu-Daudé
2021-09-29 15:28 ` Laurent Vivier
2021-08-07 11:09 ` [PATCH-for-6.2 2/2] disas/nios2: Simplify endianess conversion Philippe Mathieu-Daudé
2021-08-09 6:12 ` Thomas Huth
2021-08-09 9:48 ` Philippe Mathieu-Daudé [this message]
2021-09-29 15:28 ` Laurent Vivier
2021-09-18 9:19 ` [PATCH-for-6.2 0/2] " Philippe Mathieu-Daudé
2021-09-23 15:14 ` Laurent Vivier
2021-09-24 9:40 ` Philippe Mathieu-Daudé
2021-10-19 7:43 ` Laurent Vivier
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=bb2a9d03-94c3-bf48-ace0-e9669950f34e@amsat.org \
--to=f4bug@amsat.org \
--cc=agraf@csgraf.de \
--cc=alex.bennee@linaro.org \
--cc=crwulff@gmail.com \
--cc=marex@denx.de \
--cc=qemu-devel@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).