qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: Stefan Weil <sw@weilnetz.de>
Cc: "Patch Tracking" <patches@linaro.org>,
	"Alexander Graf" <agraf@suse.de>,
	"QEMU Developers" <qemu-devel@nongnu.org>,
	"Blue Swirl" <blauwirbel@gmail.com>,
	"Claudio Fontana" <claudio.fontana@linaro.org>,
	"Aurelien Jarno" <aurelien@aurel32.net>,
	"Anthony Liguori" <aliguori@amazon.com>,
	"Alex Bennée" <alex.bennee@linaro.org>,
	"kvmarm@lists.cs.columbia.edu" <kvmarm@lists.cs.columbia.edu>,
	"Christoffer Dall" <christoffer.dall@linaro.org>,
	"Richard Henderson" <rth@twiddle.net>
Subject: Re: [Qemu-devel] [PATCH 0/4] disas: add libvixl to support A64 disassembly
Date: Tue, 7 Jan 2014 23:00:38 +0000	[thread overview]
Message-ID: <CAFEAcA8OgaqU+X_bhRnCSG5WvXLFa8nQPpTyND8m6SecjHqEGg@mail.gmail.com> (raw)
In-Reply-To: <52CC8006.9030305@weilnetz.de>

On 7 January 2014 22:30, Stefan Weil <sw@weilnetz.de> wrote:
> here are some first annotations.
>
> ---
>
> Git complains because patch 3 adds blank lines at EOF:
>
> Applying: disas: add libvixl source code for AArch64 A64 disassembler
> /home/stefan/src/qemu/qemu.org/a64-vixl/.git/rebase-apply/patch:1382:
> new blank line at EOF.
> +
> /home/stefan/src/qemu/qemu.org/a64-vixl/.git/rebase-apply/patch:11354:
> new blank line at EOF.
> +
> warning: 2 lines add whitespace errors.

Doh. I saw those as I applied the patches and then forgot to
investigate and fix them.

> I'd prefer one file disas/aarch64.cc instead of these two files:
>
>  disas/aarch64-cxx.cc        |   80
> +++++++++++++++++++++++++++++++++++++++++++
>  disas/aarch64.c             |   39 +++++++++++++++++++++
>
> This would also allow removing the extern statement in the C++ code (and
> use a local function).

See the comment in aarch64-cxx.cc -- to do that we'd need to
make sure bfd.h was valid for C++ as well as C compilation. This
came up when Andreas reviewed the RFC and that was Claudio's
explanation for the split, which is why I added the comment.

Claudio -- do you recall what the exact issue here is?

Specifically, I think the problem is that if we put print_insn_aarch64()
in the C++ file then we need to have its prototype in bfd.h guarded
with "extern C {}" if (and only if) we're compiling a C++ file. If
you care about restricting the C++-isms to the C++ files that's
a bit ugly. But we could do that if people prefer.

Some experimentation suggests it would also be possible to
just do

extern "C" {
#include "disas/bfd.h"
}

in the C++ file. If that doesn't have any hidden gotchas I don't
know about it looks like the nicest solution.

> Spelling bugs:
>
> disas/libvixl/src/a64/constants-a64.h:/* Add/substract extend
> */
> substract  ==> subtract

I don't really want to mess with the upstream libvixl code too much
for preference. Unlike the binutils disassemblers, we still have the
option in future for pulling in updated versions.

> Compiler warnings (w32, w64):
>
>   CXX   disas/aarch64-cxx.o
> In file included from
> /home/stefan/src/qemu/qemu.org/a64-vixl/disas/libvixl/src/a64/simulator-a64.h:32:0,
>                  from
> /home/stefan/src/qemu/qemu.org/a64-vixl/disas/aarch64-cxx.cc:25:
> /home/stefan/src/qemu/qemu.org/a64-vixl/disas/libvixl/src/a64/instructions-a64.h:60:36:
> warning: left shift coun
> t >= width of type [enabled by default]
>
> (more of that kind for disas/libvixl/src/a64/instructions-a64.o)
>
> These warnings are caused by Windows sizeof(long) == 4, so 1L has to be
> replaced by 1LL or 1ULL to represent a 64 bit value, or use a type cast
> like (int64_t)1.

Those I think we really do need to fix, though, since they're bugs.

> I tested cross compilation for w32 and w64 (see comments below) and
> started the w32 executable (wine
> bin/debug/i686-w64-mingw32/aarch64-softmmu/qemu-system-aarch64 -L
> pc-bios --sdl).

Thanks for testing this.

thanks
-- PMM

  reply	other threads:[~2014-01-07 23:01 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-07 16:51 [Qemu-devel] [PATCH 0/4] disas: add libvixl to support A64 disassembly Peter Maydell
2014-01-07 16:51 ` [Qemu-devel] [PATCH 1/4] rules.mak: Support .cc as a C++ source file suffix Peter Maydell
2014-01-07 16:51 ` [Qemu-devel] [PATCH 2/4] rules.mak: Link with C++ if we have a C++ compiler Peter Maydell
2014-01-07 16:51 ` [Qemu-devel] [PATCH 3/4] disas: add libvixl source code for AArch64 A64 disassembler Peter Maydell
2014-01-07 16:51 ` [Qemu-devel] [PATCH 4/4] disas: Implement disassembly output for A64 Peter Maydell
2014-01-07 22:30 ` [Qemu-devel] [PATCH 0/4] disas: add libvixl to support A64 disassembly Stefan Weil
2014-01-07 23:00   ` Peter Maydell [this message]
2014-01-08  6:55     ` Stefan Weil
2014-01-08 10:07       ` Peter Maydell
2014-01-07 22:53 ` Stefan Weil
2014-01-08 14:51   ` Alex Bennée
2014-01-08 15:31     ` Peter Maydell
2014-01-08 16:19       ` Alexander Graf
2014-01-07 23:46 ` Peter Maydell
2014-01-08 14:48   ` Alex Bennée

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=CAFEAcA8OgaqU+X_bhRnCSG5WvXLFa8nQPpTyND8m6SecjHqEGg@mail.gmail.com \
    --to=peter.maydell@linaro.org \
    --cc=agraf@suse.de \
    --cc=alex.bennee@linaro.org \
    --cc=aliguori@amazon.com \
    --cc=aurelien@aurel32.net \
    --cc=blauwirbel@gmail.com \
    --cc=christoffer.dall@linaro.org \
    --cc=claudio.fontana@linaro.org \
    --cc=kvmarm@lists.cs.columbia.edu \
    --cc=patches@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    --cc=sw@weilnetz.de \
    /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).