From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Philippe Bergheaud <felix@linux.vnet.ibm.com>
Cc: Tom Musta <tommusta@gmail.com>, linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH] powerpc: fix xmon disassembler for little-endian
Date: Thu, 05 Dec 2013 15:39:26 +1100 [thread overview]
Message-ID: <1386218366.21910.16.camel@pasglop> (raw)
In-Reply-To: <529F31F8.6040302@linux.vnet.ibm.com>
On Wed, 2013-12-04 at 14:45 +0100, Philippe Bergheaud wrote:
> >>+#ifdef __LITTLE_ENDIAN__
> >>+#define GETWORD(v) (((v)[3] << 24) + ((v)[2] << 16) + ((v)[1] << 8) + (v)[0])
> >>+#else
> >> #define GETWORD(v) (((v)[0] << 24) + ((v)[1] << 16) + ((v)[2] << 8) + (v)[3])
> >>+#endif
> >>
> >> #define isxdigit(c) (('0' <= (c) && (c) <= '9') \
> >> || ('a' <= (c) && (c) <= 'f') \
> >>
> >
> >
> > Philippe: Wouldn't it be better to just do a 32-bit load and let the endianness be worked out
> > by the hardware? i.e.
> >
> > #define GETWORD(v) (*(u32 *)v)
> Yes, your alternative is better.
> Wouldn't it narrow the scope of the macro to aligned words on POWER7?
> I think that all references to GETWORD operate on aligned words anyway.
Well, xmon has to be robust ... as long as you are *certain* that even
with crap entry state it won't try to access unaligned boundaries then
go for it but we aren't looking at performance here.
Cheers,
Ben.
next prev parent reply other threads:[~2013-12-05 4:39 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-02 9:10 [PATCH] powerpc: fix xmon disassembler for little-endian Philippe Bergheaud
2013-12-02 14:05 ` Tom Musta
2013-12-04 13:45 ` Philippe Bergheaud
2013-12-05 4:39 ` Benjamin Herrenschmidt [this message]
2013-12-05 8:50 ` Philippe Bergheaud
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=1386218366.21910.16.camel@pasglop \
--to=benh@kernel.crashing.org \
--cc=felix@linux.vnet.ibm.com \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=tommusta@gmail.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).