From: Eric Youngdale (eric@tantalus.dell.com)
Date: 06/10/92


From: eric@tantalus.dell.com (Eric Youngdale)
Subject: Re: 486 and Linux, Please Read This
Date: 10 Jun 1992 19:57:36 GMT

In article <bjl.708173891@freyr> B.J.Lippolt@research.ptt.nl writes:
>hlu@phys1.physics.wsu.edu (Hongjiu Lu) writes:
>
>>If you use 486, please add -m486 in all the CFLAGS of Makefiles of the kernel.
>>This may make a difference.
>
>>H.J.
>
>In what way? And how about other applications? Is -m486 useful in general?
>

        It does a couple of things. It turns out that certain primative
operations are best performed with one instruction on a 386, and with a
different instruction on a 486. It is just a matter of counting clock cycles.
Here are some comments from the i386 machine description:

;; "movl MEM,REG / testl REG,REG" is faster on a 486 than "cmpl $0,MEM".

;; On a 486, it is faster to move MEM to a REG and then push, rather than
;; push MEM directly.

;; On i486, an incl and movl are both faster than incw and movw.

;; On a 486, it is faster to do movl/addl than to do a single leal if
;; operands[1] and operands[2] are both registers.

;; On i486, the "andl" is always faster than the "movzbl".

;; On i386 and i486, "addl reg,reg" is faster than "sall $1,reg"
;; On i486, movl/sall appears slightly faster than leal, but the leal
;; is smaller - use leal for now unless the shift count is 1.

;; On i486, the shift & or/and code is faster than bts or btr. If
;; operands[0] is a MEM, the bt[sr] is half as fast as the normal code.

        The 486 mode also ensures that all functions start on a 16 byte
boundary, whereas for the 386 we use a 4 byte boundary. Similarily, targets of
jumps are placed on four byte boundaries, rather than 2 byte boundaries. This
all has to do with making the best use of the cache on the chip.

-Eric