Re: patch 1.3.86

Ulrich Windl (Ulrich.Windl@rz.uni-regensburg.de)
Thu, 18 Apr 1996 09:34:28 +0200


On 17 Apr 96 at 10:15, Tom May wrote:

> Ulrich Windl <ulrich.windl@rrzc1.rz.uni-regensburg.de> writes:
>
> >In the following patch I think that the move operations were faster
> >than the push/pop combination. I only have timings for the 386...
> >
> >+++ linux/include/asm-i386/segment.h Tue Apr 9 10:35:29 1996
> >@@ -85,9 +85,9 @@
> > __asm__ volatile
> > (" cld
> > push %%es
> >- movw %%fs,%%cx
> >- movw %%cx,%%es
> >+ push %%fs
> > cmpl $3,%0
> >+ pop %%es
> > jbe 1f
> > movl %%edi,%%ecx
> > negl %%ecx
>
> *I* only have timings for the 486. On 486, all the instructions in
> question are 3 clocks. I just thought there might be a minute chance

But it's best-case only; isn't it. There are still two theoretical
memory accesses, and pushed value might have to be written out.

> of one less memory access by moving through the available cx register
> (depending on cache, etc.). So on 486 (at least), push/pop is fine.
>
> If there is a significant reason why the "cmpl" is between the push
> and pop, then it should be commented so future optimizers don't break
> something.

Maybe to align the branch?
>
> Tom.
Ulrich