3 ms·
On PPC it does not produce an exception. Inspection of the assembler reveals, in part: cmpwi cr7,r0,0 beq cr7,L5 lwz r2,60(r30)
by mturmon 15y ago
On PPC it does not produce an exception. Inspection of the assembler reveals, in part:
cmpwi cr7,r0,0
beq cr7,L5
lwz r2,60(r30)
lwz r0,56(r30)
divw r2,r2,r0 ; ordinary integer divide
stw r2,72(r30) ; store the quotient
b L7
L5:
li r0,0 ; else load 0
stw r0,72(r30) ; store the 0
The following thread has more about the reason PPC does not raise exceptions for these overflows:
http://fixunix.com/embedded/341544-divide-zero-does-not-crash.html#post885372 http://fixunix.com/embedded/341544-divide-zero-does-not-cras...
But they're only thinking about division by 0, not by -1.