-
Notifications
You must be signed in to change notification settings - Fork 294
use simd_saturating_{add, sub}
on neon
#1575
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
base: master
Are you sure you want to change the base?
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 |
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