Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider adding a SimdABI type parameter to select ABI #245

Open
gnzlbg opened this issue May 24, 2019 · 3 comments
Open

Consider adding a SimdABI type parameter to select ABI #245

gnzlbg opened this issue May 24, 2019 · 3 comments
Labels
Enhancement New feature or request

Comments

@gnzlbg
Copy link
Contributor

gnzlbg commented May 24, 2019

We could extend Simd<[T; N]> to Simd<[T; N], SimdABI = DefaultSimdABI> to enable users to, for example, use Simd<[f32; 4], AVX> and generate code that assumes that AVX is available.

cc @rkruppe

@hanna-kruppe
Copy link

I don't understand how this could allow changing the (function call) ABI. The instructions used by operations on that ytpe, sure (though probably with all the same problems of mismatched target_features), but how could it affect the type is passed between functions in LLVM IR / machine code?

@gnzlbg
Copy link
Contributor Author

gnzlbg commented May 24, 2019

My plan was to duplicate the implementation of the whole API per ABI, and for each ABI, #[target_feature(enable = "SimdAbi")] all functions and methods.

@gnzlbg
Copy link
Contributor Author

gnzlbg commented May 24, 2019

The type passed is the same (#[repr(simd)] struct(f32,f32,f32,f32) => <4 x float>) - that does not change per "ABI" in this scheme. The only thing that would change is the target feature on that type's methods.

Something like a target-feature propagation pass in LLVM would deal with the rest: https://bugs.llvm.org/show_bug.cgi?id=41138

@Lokathor Lokathor added the Enhancement New feature or request label Sep 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants