2 ms·
You could check if the middle 64-12-12 bits are all 1's, and if they are branch to a slow codepath. It would be an incredibly rare case, so branch prediction w
by londons_explore 6y ago
You could check if the middle 64-12-12 bits are all 1's, and if they are branch to a slow codepath.
It would be an incredibly rare case, so branch prediction will always get it right, and the cost of a branch nearly nill.
- a1369209993 6y agoIf you're trying to add two 256-bit numbers, there's probably cryptography involved, and data-dependant branches are poison to crypto code.