public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Ramana Radhakrishnan <ramana.r@gmail.com>
To: Min ZOU <zou.min@renesas.com>
Cc: gcc@gcc.gnu.org
Subject: Re: How to change bit-field allocation
Date: Mon, 06 Sep 2004 17:15:00 -0000	[thread overview]
Message-ID: <67ea2eb04090610155d13666e@mail.gmail.com> (raw)
In-Reply-To: <413C4CDB.6070609@renesas.com>

Hi Min, 

> HI,
> 
> As I know, GCC allocates bit-fields inside a structure from the lowest
> addressed byte, i.e. LSB, for little endian. However, I want to reverse
> the ordering for the bit-fields allocation, i.e. always from MSB.

The info pages seem to say and I quote 

<begin quote>

— Macro: BITS_BIG_ENDIAN

    Define this macro to have the value 1 if the most significant bit
in a byte has the lowest number; otherwise define it to have the value
zero. This means that bit-field instructions count from the most
significant bit. If the machine has no bit-field instructions, then
this must still be defined, but it doesn't matter which value it is
defined to. This macro need not be a constant.

    This macro does not affect the way structure fields are packed
into bytes or words; that is controlled by BYTES_BIG_ENDIAN.

— Macro: BYTES_BIG_ENDIAN

    Define this macro to have the value 1 if the most significant byte
in a word has the lowest number. This macro need not be a constant.

<end quote>

http://gcc.gnu.org/onlinedocs/gccint/Storage-Layout.html#Storage-Layout 



cheers
Ramana

-- 
Ramana Radhakrishnan

  reply	other threads:[~2004-09-06 17:15 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-09-06 11:41 Min ZOU
2004-09-06 17:15 ` Ramana Radhakrishnan [this message]
2004-09-06 21:43 ` James E Wilson
2004-09-06 22:19   ` Robert Dewar
2004-09-07  3:44     ` Min ZOU
2004-09-07 15:56   ` Dave Korn
2004-09-13  9:09   ` tm_gccmail
2004-09-07  1:24 ` DJ Delorie
2004-09-07  3:47   ` Min ZOU
2004-09-07 14:07     ` Robert Dewar
2004-09-07 14:59 Etienne Lorrain

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=67ea2eb04090610155d13666e@mail.gmail.com \
    --to=ramana.r@gmail.com \
    --cc=gcc@gcc.gnu.org \
    --cc=zou.min@renesas.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 read-only IMAP folder(s) and NNTP newsgroup(s).