From: Kumar Gala <galak@kernel.crashing.org>
To: David Laight <David.Laight@ACULAB.COM>
Cc: Linuxppc-dev list <linuxppc-dev@ozlabs.org>
Subject: Re: union/struct representations for MAS Registers
Date: Wed, 10 Aug 2011 12:48:05 -0500 [thread overview]
Message-ID: <6AC384B9-E07E-4BFC-B9AD-3A671EF4F650@kernel.crashing.org> (raw)
In-Reply-To: <AE90C24D6B3A694183C094C60CF0A2F6D8AE26@saturn3.aculab.com>
On Aug 10, 2011, at 12:38 PM, David Laight wrote:
>=20
>>> Bitfields are rather non-portable, the compiler has a lot of choice
>>> about how to align the bits in memory.
>>=20
>> I'm ok with the masking stuff.
>> However, I'm actually surprised this is true given the=20
>> maturity of our ABIs.
>=20
> The C standard says nothing at all about how bitfields are =
implemented,
> I think the first bit might be 0x1, 0x80, 0x1000000 or 0x80000000
> when treated as a 32bit value, regardless of the endianness.
>=20
> Different architectures can (and do) assign things in different ways.
> So code that is ok on ppc might fail on arm or x86 (etc).
>=20
> David
I think PPCs a bit sane and what Jimi was proposing the union for is =
something that would never need to be portable (as it a PPC specific =
register).
Still, prefer the shifts, masks & macros as that's what I've been =
reading & using in ppc land forever ;)
- k=
prev parent reply other threads:[~2011-08-10 17:48 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-10 17:21 union/struct representations for MAS Registers Jimi Xenidis
2011-08-10 17:25 ` Kumar Gala
2011-08-10 17:31 ` Jimi Xenidis
2011-08-10 17:25 ` David Laight
2011-08-10 17:31 ` Jimi Xenidis
2011-08-10 17:38 ` David Laight
2011-08-10 17:48 ` Kumar Gala [this message]
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=6AC384B9-E07E-4BFC-B9AD-3A671EF4F650@kernel.crashing.org \
--to=galak@kernel.crashing.org \
--cc=David.Laight@ACULAB.COM \
--cc=linuxppc-dev@ozlabs.org \
/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