>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
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.
Tom.