Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 28 Sep 2006 19:38:02 +0000 (UTC)
From:      John Baldwin <jhb@FreeBSD.org>
To:        src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org
Subject:   cvs commit: src/sys/boot/i386/btx/btx btx.S
Message-ID:  <200609281938.k8SJc238038372@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
jhb         2006-09-28 19:38:02 UTC

  FreeBSD src repository

  Modified files:
    sys/boot/i386/btx/btx btx.S 
  Log:
  Optimize the int 15/87 handler for space to shave another 16 bytes off of
  BTX (and thus boot2):
  - Don't bother saving %eax, %ebx, or %ecx as it is not necessary.
  - Use a more compact sequence to load the base value out of a GDT entry
    by loading the contiguous low 24 bits into the upper 24 bits of %eax,
    loading the high 8 bits into %al, and using a ror to rotate the bits
    (2 mov's and a ror) rather than loading the pieces in smaller chunks
    (3 mov's and a shl).
  - Use movzwl + leal instead of movl + movw + shll + addl.
  - Use 'xchgl %eax,%foo' rather than 'movl %eax,%foo' for cases where
    it's ok to trash %eax.  xchgl %eax, foo is a 1-byte opcode whereas the
    mov is a 2-byte opcode.
  - Use movzwl rather than xorl + movw.
  
  MFC after:      1 week
  
  Revision  Changes    Path
  1.41      +17 -31    src/sys/boot/i386/btx/btx/btx.S



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200609281938.k8SJc238038372>