gptmbr: use cltq to extend a zero %eax into %edx
authorH. Peter Anvin <hpa@zytor.com>
Tue, 26 Feb 2008 00:59:54 +0000 (16:59 -0800)
committerH. Peter Anvin <hpa@zytor.com>
Tue, 26 Feb 2008 00:59:54 +0000 (16:59 -0800)
Using cltq (cdq) to clear %edx when %eax is zero is cheaper by one
byte.

mbr/gptmbr.S

index 9005183..85b9fcd 100644 (file)
@@ -112,7 +112,7 @@ next:
 
        /* Load partition table header */
        xorl    %eax,%eax
-       xorl    %edx,%edx
+       cltd
        incw    %ax             /* %edx:%eax = 1 */
        movw    $phdr, %bx
        pushw   %bx             /* -8(%bp) phdr == bootsect */