[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Endianness macros capitalization
From: |
Robert Millan |
Subject: |
Re: Endianness macros capitalization |
Date: |
Sun, 6 Jul 2008 20:30:42 +0200 |
User-agent: |
Mutt/1.5.13 (2006-08-11) |
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.
--
Robert Millan
<GPLv2> I know my rights; I want my phone call!
<DRM> What good is a phone call… if you are unable to speak?
(as seen on /.)
- Endianness macros capitalization, Javier Martín, 2008/07/05
- Re: Endianness macros capitalization, Pavel Roskin, 2008/07/05
- Re: Endianness macros capitalization, Javier Martín, 2008/07/05
- Re: Endianness macros capitalization, Pavel Roskin, 2008/07/05
- Re: Endianness macros capitalization,
Robert Millan <=
- Re: Endianness macros capitalization, Javier Martín, 2008/07/06
- Re: Endianness macros capitalization, Christian Franke, 2008/07/07
- Re: Endianness macros capitalization, Christian Franke, 2008/07/08
- Re: Endianness macros capitalization, Pavel Roskin, 2008/07/09
- Re: Endianness macros capitalization, Christian Franke, 2008/07/09
- Re: Endianness macros capitalization, Pavel Roskin, 2008/07/09
- Re: Endianness macros capitalization, Christian Franke, 2008/07/10
- Re: Endianness macros capitalization, Pavel Roskin, 2008/07/10
- Re: Endianness macros capitalization, Jordi Mallach, 2008/07/11
- Re: Endianness macros capitalization, Pavel Roskin, 2008/07/11