[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Endianness macros capitalization

From: Christian Franke
Subject: Re: Endianness macros capitalization
Date: Sun, 20 Jul 2008 15:45:10 +0200
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv: Gecko/20071128 SeaMonkey/1.1.7

Christian Franke wrote:
Pavel Roskin wrote:
On Tue, 2008-07-08 at 20:04 +0200, Christian Franke wrote:

With old gcc versions without the "rol" optimization, even the 16
bit swap should be a function:

Or better yet, an asm statement.

We should consider optimized assembly vs function call.  Even the
32-bit swap could be shorter:

a:   86 c4                   xchg   %al,%ah
c:   c1 c0 10                rol    $0x10,%eax
f:   86 c4                   xchg   %al,%ah

That's 7 bytes!  ...

But the function call in the 32-bit case requires only 5 bytes :-)

Sorry, I was wrong here. The assumption about function call size was only true for module-local calls. If a module calls a function in kernel, each 5 byte call requires another 8 bytes for the ELF relocation table entry.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]