------- Comment #3 from pinskia at gcc dot gnu dot org  2007-01-16 22:11 -------
(In reply to comment #1)
> Is this specific to x86? On PowerPC (gcc 4.0.1 from Mac OS X), I get:

This is because the PPC ISA says for divide:
If an attempt is made to perform either of the divisions -- 0x8000_0000 / -1 or
<anything> / 0, then the contents of rD are undefined, as are the contents of
the LT, GT, and EQ bits of the CR0 field (if Rc = 1).  In this case, if OE = 1
then OV is set.

The 32-bit signed remainder of diving the contents of rA by the contents of rB
can be computed as follows, exept in the case that hthe constnat of ra = - 2^31
and the constants of rB = -1.
divw rD, rA, rB
mullw rD, rD, rB
subf rD, rD, rA

----------------------
So the ISA in fact even mentions this case :).


-- 


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

Reply via email to