Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.



If you're trying to add two 256-bit numbers, there's probably cryptography involved, and data-dependant branches are poison to crypto code.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: