[Bug middle-end/22072] bizarre code for int*int/2

felix-gcc at fefe dot de gcc-bugzilla@gcc.gnu.org
Wed Jun 15 21:05:00 GMT 2005


------- Additional Comments From felix-gcc at fefe dot de  2005-06-15 21:05 -------
(In reply to comment #5)
> (In reply to comment #4)
> > what about *arithmetic shift* instruction (e.g. SAR on ix86) ?
> Nope, try that with a negative number and you will notice that it will not work.

Actually it does work.  5 SAR 1 == 2; -5 SAR 1 == -2.  That's exactly what SAR
is for, after all.  See the Intel manuals.  Or look here:

http://faydoc.tripod.com/cpu/sar.htm

 SAR r/m32, 1 	 Signed divide* r/m32 by 2, once

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22072



More information about the Gcc-bugs mailing list