9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: erik quanstrom <quanstro@quanstro.net>
To: sstallion@gmail.com, 9fans@9fans.net
Subject: Re: [9fans] ureg alignment
Date: Fri,  9 May 2014 10:31:49 -0400	[thread overview]
Message-ID: <9bca01ca1ac85fadafe2959cf3f7af87@mikro.quanstro.net> (raw)
In-Reply-To: <CAGGHmKF-upNXMZjzhrmp4zGsFvS25hx2BJeZapndYB0QbusgJw@mail.gmail.com>

> Ugh, no! Is there a case where the padding is a problem? Normally
> registers belonging to the same union are uniform in size. Those
> defines will expand anywhere and not behave as expected:
>
> ulong sp = ureg->sp;
>
> This could lead to all sorts of entertaining problems.

any union on a 64-bit machine will get padded out to 0%8 bytes.

also your example

	ulong sp = ureg->sp

will get expanded to

	ulong r13 = ureg->r13

and this is just fine!

- erik



  reply	other threads:[~2014-05-09 14:31 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-09 14:21 erik quanstrom
2014-05-09 14:28 ` Steven Stallion
2014-05-09 14:31   ` erik quanstrom [this message]
2014-05-09 14:56 ` Charles Forsyth
2014-05-09 15:29   ` erik quanstrom
2014-05-09 15:45     ` Charles Forsyth
2014-05-09 15:52       ` erik quanstrom

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=9bca01ca1ac85fadafe2959cf3f7af87@mikro.quanstro.net \
    --to=quanstro@quanstro.net \
    --cc=9fans@9fans.net \
    --cc=sstallion@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).