Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/i386/stand/lib Utilize movz[bw]l to save a few inst...



details:   https://anonhg.NetBSD.org/src/rev/44de6e61cdf6
branches:  trunk
changeset: 760172:44de6e61cdf6
user:      jakllsch <jakllsch%NetBSD.org@localhost>
date:      Wed Dec 29 22:40:46 2010 +0000

description:
Utilize movz[bw]l to save a few instrutions and bytes of .text.

diffstat:

 sys/arch/i386/stand/lib/bios_disk.S |  16 ++++++----------
 1 files changed, 6 insertions(+), 10 deletions(-)

diffs (58 lines):

diff -r ab6c3dff08e8 -r 44de6e61cdf6 sys/arch/i386/stand/lib/bios_disk.S
--- a/sys/arch/i386/stand/lib/bios_disk.S       Wed Dec 29 19:53:32 2010 +0000
+++ b/sys/arch/i386/stand/lib/bios_disk.S       Wed Dec 29 22:40:46 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bios_disk.S,v 1.19 2009/11/21 11:52:57 dsl Exp $       */
+/*     $NetBSD: bios_disk.S,v 1.20 2010/12/29 22:40:46 jakllsch Exp $  */
 
 /*
  * Ported to boot 386BSD by Julian Elischer (julian%tfs.com@localhost) Sept 1992
@@ -82,8 +82,7 @@
        calll   _C_LABEL(real_to_prot) # back to protected mode
        .code32
 
-       xorl    %eax, %eax
-       movw    %bx, %ax        # return value in %ax
+       movzwl  %bx, %eax       # return value in %eax
 
        pop     %edi
        pop     %edx
@@ -146,7 +145,7 @@
        calll   _C_LABEL(real_to_prot) # back to protected mode
        .code32
 
-       andl    $0xffff, %eax
+       movzwl  %ax, %eax       # return value in %eax
 
        pop     %edi
        pop     %esi
@@ -246,8 +245,7 @@
        calll   _C_LABEL(real_to_prot)  # switch back
        .code32
 
-       xorl    %eax, %eax
-       movb    %dl, %al        # return value in %ax
+       movzbl  %dl, %eax               # return value in %eax
 
        cmpw    $0xaa55, %bx
        sete    %dl
@@ -304,8 +302,7 @@
        calll   _C_LABEL(real_to_prot) # back to protected mode
        .code32
 
-       xorl    %eax, %eax
-       movw    %bx, %ax        # return value in %ax
+       movzwl  %bx, %eax       # return value in %eax
 
        pop     %edi
        pop     %esi
@@ -346,8 +343,7 @@
        calll   _C_LABEL(real_to_prot) # back to protected mode
        .code32
 
-       xorl    %eax, %eax
-       movb    %bl, %al        # return value in %ax
+       movzbl  %bl, %eax       # return value in %eax
 
        pop     %edi
        pop     %esi



Home | Main Index | Thread Index | Old Index