Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Why does Julia use native machine integer arithmetic? (julialang.org)
5 points by luu on Nov 25, 2013 | hide | past | favorite | 1 comment


Most hardware architectures have a trap or condition set upon integer overflow, eg. x86 has the 'jo' instruction to jump if the overflow flag is set after an integer operation. Unfortunately, these are not exposed by C, so there's no portable way to access them, as long as you're writing the interpreter in C. This is one of the big advantages of compiling to LLVM or directly to the hardware; LLVM provides the llvm.*.with.overflow intrinsics to access the overflow flag of the hardware, which lets you do bigints at basically zero overhead.




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

Search: