4 ms·
Yep. Those are two additions, and naturally every full-word addition needs a separate overflow check. You can avoid the short-circuiting branches by just adding
by worstspotgain 2y ago
Yep. Those are two additions, and naturally every full-word addition needs a separate overflow check. You can avoid the short-circuiting branches by just adding the carries:
uint32_t res1 = a + carry;
carry = res1 < a;
uint32_t res2 = b + res1;
carry += res2 < b;