This is the mail archive of the
binutils@sourceware.cygnus.com
mailing list for the binutils project.
Re: shifts and rotates by 1 on ix86
- To: Alexander Sokolov <robocop at netlink dot ru>
- Subject: Re: shifts and rotates by 1 on ix86
- From: Alan Modra <alan at linuxcare dot com dot au>
- Date: Wed, 10 May 2000 18:32:18 +1000 (EST)
- cc: binutils <binutils at sourceware dot cygnus dot com>
On Wed, 10 May 2000, Alexander Sokolov wrote:
> It seems that gas (2.9.5.0.41) always uses the form with immediate for
> encoding shifts and rotates by immediate count, even if the count is 1
> where special form of encoding could be used which is 1 byte shorter
> (e.g. shll $1,%eax could be encoded as D1 E0, but gas outputs C1 E0 01).
> I think gas should always produce the shortest possible encodings.
You can get the smaller opcode sequence by writing "shll %eax". The
reason gas does not do this automatically is that on certain processors,
eg. 486, the D1 E0 opcode sequence is slower than C1 E0 01.
--
Linuxcare. Support for the Revolution.