------- Comment #7 from joakim dot tjernlund at transmode dot se 2010-05-20 12:13 ------- The below code doesn't generate any "add with carry" insn's for either x86 nor powerpc:
u16 ipsum(u16 *buf, unsigned len, u16 sum) { int rest, carry ; u32 acc_sum, *buf_u32, x; acc_sum = sum; len >>= 2; buf_u32 = (u32 *) buf; carry = 0; for(buf_u32--; len; --len) { x = *++buf_u32; acc_sum += x; acc_sum += carry; carry = x > acc_sum ? 1 : 0; } acc_sum += carry; /* Add back carry outs from top 16 bits to low 16 bits. */ acc_sum = (acc_sum >> 16) + (acc_sum & 0xffff); /* add high-16 to low-16 */ acc_sum += (acc_sum >> 16); /* add carry */ return acc_sum; } -- joakim dot tjernlund at transmode dot se changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|enhancement |normal Component|rtl-optimization |regression http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43892