On Jun 19, 2008, at 3:36 AM, Julian Seward wrote:
addme 00000000 XER.CA=1 = 00000000 (cr 00000000 xer 20000000)
Did I miss the obvious, but why does 0 + 1 - 1 generate a carry ?
Because (as per the docs) it's computing rA + XER.CA + 0xFFFF_FFFF,
which is 0 + 1 + 0xFFFF_FFFF == 0x1_0000_0000. Which does indeed
carry. I tested now on both a 7447 and a G5 and they both do that.
Ok thanks. So addme set the carry unless both xer.ca and rA are 0.
Your expression is a little bit complex, especially the second part.
If xer_ca = 1 then res == argL, right ?
void do_addmeo (void)
+ uint32_t argL = T0;
+ uint32_t res = T0 + xer_ca + (-1);
+ uint32_t carried = res < argL || ((xer_ca & 1) == 1 && res ==