string-486.h - why not used?

Mark Hemment (markhe@nextd.demon.co.uk)
Sat, 7 Dec 1996 13:29:05 +0000 (GMT)


G'Day,

Yesterday, I noticed the header file "string-486.h" isn't used - not
included from include/asm-i386/string.h. (Note: *-486.h is suppose to
contain optimised string/memory funcs for 486s and Pentiums).
Why is the header not used? Are the 486 optimised string functions
broken, or are they no more optimal than using the 'rep*'/string
instructions?

For the str*() funcs, it's probably not worthwhile trying to avoid the
string ops. I'm guessing most kernel strings are reasonably short-ish, so
any cycles saved are not significant.
But, wouldn't avoiding Intel's string ops give a better chance of
register allocation? (not forced to use ecx/eax/edi).

For the mem*() funcs, isn't it worthwhile to avoid the 'sto*'s?
A quick look in string-486.h shows that the mem*() funcs haven't been
agressively optimised - no loop unrolling, or src/dest alignments to
dword boundaries before entering a loop.
OK, there is the Pentium FPU-memcopy() patch, which works for most users.
But that doesn't help the i486.

Also, most loops are not aligned on a 16byte boundary, which helps the
i486 (or is something going on which I'm missing...).

Could someone with more knowledge comment?

markhe

------------------------------------------------------------------
Mark Hemment, Unix/C Software Engineer (Contractor)
markhe@nextd.demon.co.uk
------------------------------------------------------------------