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!  And if written properly, it could work with any of the
registers that allow access to the lower two bytes (%eax, %ebx, %ecx and
%edx), thus giving more flexibility to the optimizer.

-- 
Regards,
Pavel Roskin


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

Reply via email to