This is the mail archive of the binutils@sourceware.cygnus.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: shifts and rotates by 1 on ix86


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        +


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]