Open folkertdev opened 1 month ago
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @Amanieu (or someone else) some time within the next two weeks.
I don't think this idea works because of this LLVM issue I opened https://github.com/llvm/llvm-project/issues/94463. So unless we can get that fixed (or somehow accept much worse codegen) this PR does not work
OK let's defer this for now until the LLVM issue is sorted.
The idea behind this is that e.g. miri and cranelift don't know all of the llvm intrinsics (and adding them is possible but a lot of extra work). Using the generic simd function means logic only needs to be implemented once for all targets.
The
simd_saturating_*
functions generate the same instructions for the saturating add/sub operations https://godbolt.org/z/zc35doTc6