PowerPC: Add intrinsics support vec_add(vector_double, vector_double)#2161
PowerPC: Add intrinsics support vec_add(vector_double, vector_double)#2161lei137 wants to merge 3 commits into
Conversation
|
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @sayantn (or someone else) some time within the next two weeks. Why was this reviewer chosen?The reviewer was selected based on:
|
|
This is my first rust patch and is the first of a series of vsx intrinsics support patches. |
| // Implement AltiVec's VectorAdd trait for vector_double to enable vec_add support | ||
| #[unstable(feature = "stdarch_powerpc", issue = "111145")] | ||
| impl crate::core_arch::powerpc::altivec::sealed::VectorAdd<vector_double> for vector_double { | ||
| type Result = vector_double; | ||
| #[inline] | ||
| #[target_feature(enable = "vsx")] | ||
| unsafe fn vec_add(self, other: vector_double) -> Self::Result { | ||
| sealed::vec_add_double_double(self, other) | ||
| } | ||
| } |
There was a problem hiding this comment.
So is the argument here that if you got your hands on a vector_double then vsx must be enabled?
Because normally adding stricter target features on a trait method is error-prone: there is now an additional safety requirement on that trait method, which is that if that particular instance is called, the target feature must be enabled.
| type Result = vector_double; | ||
| #[inline] | ||
| #[target_feature(enable = "vsx")] | ||
| unsafe fn vec_add(self, other: vector_double) -> Self::Result { |
There was a problem hiding this comment.
is this the only function you'd want to do this for? I'd guess not?
Add intrinsics support on Linux on Power for vec_add(vector_double, vector_double).
AI Assissted.