<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">Hey Duncan.<div><br></div><div>Sorry for the delay. Attached is a patch which follows what you suggested on IRC. Specifically:</div><div><br></div><div>1. I updated the logic to handle the promotion of UADDO so that it just uses 1 getSetCC instead of truncating/zexting which is unnecessary since:</div><div><br></div><div>Addition:      x + y < x => carry</div><div>Subtraction: x - y > x => carry</div><div><br></div><div>2. I refactored out said method and used it to also handle the promotion of ADDC.</div><div><br></div><div>3. I implemented a similar algorithm for ADDE. Specifically for addition:</div><div><br></div><div>sum = x + y + c_in</div><div>carry = [(x & y) | ((x | y) & ~sum)]  >> ((sizeof(carry) << 3)-1)</div><div>         = [(x & y) | ((x | y) & (sum ^ -1))]  >> ((sizeof(carry) << 3)-1)</div><div><br></div><div>and for subtraction:</div><div><br></div><div>diff = x - y - c_in</div><div>carry = [(~x & y) | ((~x | y) & diff)] >> ((sizeof(carry) << 3)-1)</div><div>         = [((x ^ -1) & y) | (((x ^ -1) | y) & diff)  >> ((sizeof(carry) << 3)-1)]</div><div><br></div><div>Hows it look?</div><div><br></div><div>Michael</div><div><br></div><div></div></body></html>