
Phil wrote on Thursday, March 31, 2011 at 4:51:18:
I came to the conclusion that it is better to write multi-word addition code (like the above) in assembler for each platform.
I believe that the issues are similar on other architectures that have a flag register, but maybe others can confirm or deny that.
Any thoughts anyone?
taking into account luke's message about adc_pi, i think that it's a perfect opportunity to abstract multiword addition (with carry) like this: unsigned add_with_carry(unsigned *dest, const unsigned *src, size_t size); the returned value is intended to be an overflow flag (read: carry of the result of the most significant word addition) that is the returned value is 0 or 1 (or even 2) obviously, inside the function one may implement any incredible (asm?) code (possibly involving sse/avx/altivec/etc.) -- Pavel P.S. if you notice a grammar mistake or weird phrasing in my message please point it out