All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Javier Martín" <lordhabbit@gmail.com>
To: The development of GRUB 2 <grub-devel@gnu.org>
Subject: Re: Endianness macros capitalization
Date: Sun, 06 Jul 2008 22:02:14 +0200	[thread overview]
Message-ID: <1215374534.26019.194.camel@localhost> (raw)
In-Reply-To: <20080706183042.GA22023@thorin>

[-- Attachment #1: Type: text/plain, Size: 1090 bytes --]

El dom, 06-07-2008 a las 20:30 +0200, Robert Millan escribió:
> On Sun, Jul 06, 2008 at 12:54:58AM +0200, Javier Martín wrote:
> > El sáb, 05-07-2008 a las 17:30 -0400, Pavel Roskin escribió:
> > > They probably should be functions.  We may want to sparse annotate GRUB
> > > one day, and then inline functions in the only way to go.
> > Hmm... you mean changing this
> > 
> > #define grub_swap_bytes16(x)	\
> > ({ \
> >    grub_uint16_t _x = (x); \
> >    (grub_uint16_t) ((_x << 8) | (_x >> 8)); \
> > })
> > 
> > ...for this
> > 
> > inline grub_uint16_t grub_swap_bytes16(uint16_t x)
> > {
> >   return (x << 8) | (x >> 8);
> > }
> 
> I know I get to be annoying about this, but which of these two (plus the
> non-inline version) would result in _smaller_ code?
> 
> Function calls on i386-pc are cheap (because we use the regparm hack), so
> maybe it'd work better using normal functions.
> 
If we are to take the space-saving route, the best we can do is turn
them to functions, maybe even _without_ the "inline" keyword, and GCC
will do what's best.

[-- Attachment #2: Esta parte del mensaje está firmada digitalmente --]
[-- Type: application/pgp-signature, Size: 827 bytes --]

  reply	other threads:[~2008-07-06 20:02 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-05 13:27 Endianness macros capitalization Javier Martín
2008-07-05 21:30 ` Pavel Roskin
2008-07-05 22:54   ` Javier Martín
2008-07-05 23:14     ` Pavel Roskin
2008-07-06 18:30     ` Robert Millan
2008-07-06 20:02       ` Javier Martín [this message]
2008-07-07 19:25         ` Christian Franke
2008-07-08 18:04           ` Christian Franke
2008-07-09  6:47             ` Pavel Roskin
2008-07-09 12:50               ` Christian Franke
2008-07-09 17:57                 ` Pavel Roskin
2008-07-10 19:25                   ` Christian Franke
2008-07-10 19:59                     ` Pavel Roskin
2008-07-11  7:06                       ` Jordi Mallach
2008-07-11  8:53                     ` Pavel Roskin
2008-07-11  9:07                       ` Pavel Roskin
2008-07-11 13:21                         ` Christian Franke
2008-07-11 18:33                           ` Pavel Roskin
2008-07-20 13:45                 ` Christian Franke
2008-07-20 23:31                   ` Pavel Roskin

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=1215374534.26019.194.camel@localhost \
    --to=lordhabbit@gmail.com \
    --cc=grub-devel@gnu.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.