use simd_saturating_{add, sub} on neon#1575
Conversation
|
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. |
a4bc645 to
86450b2
Compare
|
I don't think this idea works because of this LLVM issue I opened llvm/llvm-project#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. |
|
@Jamesbarford given that you work at ARM, is there any chance you could pass this on to the right person (specifically the LLVM issue llvm/llvm-project#94463). Not only does it clean up stdarch a bit, but it's especially valuable for |
|
Sure, I've mentioned it 👍 |
Head branch was pushed to by a user without write access
86450b2 to
fe53529
Compare
|
We can still use |
|
I actually fixed llvm/llvm-project#94463 in llvm/llvm-project#140454. I just re-ran CI here to check if there are any other issues, and there were, resulting in llvm/llvm-project#142323 and a fix in llvm/llvm-project#142342. So, things are looking good for being able to use these operations for For |
|
The ARM intrinsics are actually using the same LLVM intrinsics that |
fe53529 to
6d9bc61
Compare
|
@Amanieu this works now and is ready for review |
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