Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 2 Sep 1996 08:50:33 +1000
From:      Bruce Evans <bde@zeta.org.au>
To:        bde@zeta.org.au, staff@kyklopen.ping.dk
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: movsbw question
Message-ID:  <199609012250.IAA20814@godzilla.zeta.org.au>

next in thread | raw e-mail | index | archive | help
[movsbw]
>It was the movsx instruction it I was interessted in. The pgcc emits
>an instruction sequence that breaks our gas and i was wondering wether
>it was the FreeBSD gas that was wrong.

It is probably a pessimization to use movsbw, especially on Pentiums.
First, movsbl is 1 byte shorter and often (always except on 386's?)
1 cycle faster and is usually equivalent (it trashes the upper 16
bits of the destination, but this doesn't usually matter).  Second,
`movsbl %al,%eax' takes 3 nonpairable cycles on Pentiums, but the
equivalent `shl $24,%eax; shr $24,%eax' takes only 2 U-pairable 
cycles, so it is at least 3/2 times faster and up to 3 times faster
when reordered.

Bruce



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199609012250.IAA20814>