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: Alan Modra <alan at linuxcare dot com dot au>
- Subject: Re: shifts and rotates by 1 on ix86
- From: "Maciej W. Rozycki" <macro at ds2 dot pg dot gda dot pl>
- Date: Thu, 11 May 2000 12:48:47 +0200 (MET DST)
- cc: Alexander Sokolov <robocop at netlink dot ru>, binutils <binutils at sourceware dot cygnus dot com>
- Organization: Technical University of Gdansk
On Thu, 11 May 2000, Alan Modra wrote:
> > However, implicit 1-bit shifts and rotates do set flags differently than
> > the explicit forms.
>
> Are you sure about this statement? My reading of the Intel arch
> instruction set manual indicates that the overflow flag is set
> appropriately for 1 bit shifts, and undefined for > 1 bit shifts.
> There is no mention of a difference depending on which of the one bit
> shift instructions is used.
I can recall a reference to some instruction setting flags differently
based on its encoding. Now I couldn't find it. I tested both encodings
under a debugger and it proved I was wrong.
Hmm, after a bit of thinking, I believe the reference could be about
Z80's rotate opcodes -- it has two encodings for some of them of which the
8080-compatible accumulator-only one sets flags differently (only CF is
updated) comparing to the Z80-specific any-register one (all flags are set
accordingly).
--
+ Maciej W. Rozycki, Technical University of Gdansk, Poland +
+--------------------------------------------------------------+
+ e-mail: macro@ds2.pg.gda.pl, PGP key available +