3 ms·
>Hardware doesn't have native saturating overflow operations Uh, what hardware are you talking about? x86 and ARM at the least have saturating arithmetic instr
by sjolsen 10y ago
>Hardware doesn't have native saturating overflow operations
Uh, what hardware are you talking about? x86 and ARM at the least have saturating arithmetic instructions.
- eridius 10y agoThey do? I admit I'm not an expert on either x86 or ARM assembly, but I've never seen code that used a saturating arithmetic instruction, and the saturating math in Rust is implemented using checked arithmetic as opposed to any kind of llvm intrinsic for saturating math. Looking at the LLVM docs I don't see any kind of intrinsic for saturating math either (checked math uses llvm.sadd.with.overflow.* and friends).
- yoklov 10y agoIt's part of the vector ISAs for both. x86 does as part of SSE (or SSE2, or MMX, etc, I don't remember). ARM it's part of the DSP extensions.