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
11:

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.

Christian



_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/grub-devel

Reply via email to