Saving syscall cycles on a Cyrix

Thomas Koenig (ig25@mvmap66.ciw.uni-karlsruhe.de)
Thu, 12 Jun 1997 11:12:08 +0200 (MET DST)


Hi;

prompted by a discussion on comp.sys.development.system, I had a look
at entry.S, and found that this can be speeded up significantly for
a Cyrix.

The problem is that two pushl/popl instructions can't be paired in the
Cyrix' X and Y pipelines because the esp register gets modified
in both.

For example, the following code sequence from entry.S

pushl %eax
pushl %ebp
pushl %edi
pushl %esi
pushl %edx
pushl %ecx
pushl %ebx

takes seven cycles on a Cyrix, whereas

subl $28,%esp
movl %eax,24(%esp)
movl %ebp,20(%esp)
movl %edi,16(%esp)
movl %esi,12(%esp)
movl %edx,8(%esp)
movl %ecx,4(%esp)
movl %ebx,(%esp)

only takes four, because any two instructions can pair. The same
goes for the reverse, i.e. the popl instructions. Cyrix patch
maintainers, are you listening? :-)

-- 
Thomas Koenig, Thomas.Koenig@ciw.uni-karlsruhe.de, ig25@dkauni2.bitnet.
The joy of engineering is to find a straight line on a double
logarithmic diagram.