cvs commit: src/sys/boot/i386/btx/btx btx.S

John Baldwin jhb at FreeBSD.org
Thu Sep 28 12:38:03 PDT 2006


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


More information about the cvs-all mailing list