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

Tracking issue for RFC 2574, "SIMD vectors in FFI" #63068

Open
4 tasks
Centril opened this issue Jul 28, 2019 · 2 comments
Open
4 tasks

Tracking issue for RFC 2574, "SIMD vectors in FFI" #63068

Centril opened this issue Jul 28, 2019 · 2 comments
Labels
A-FFI Area: Foreign function interface (FFI) A-SIMD Area: SIMD (Single Instruction Multiple Data) B-RFC-approved Blocker: Approved by a merged RFC but not yet implemented. C-tracking-issue Category: An issue tracking the progress of sth. like the implementation of an RFC F-simd_ffi `#![feature(simd_ffi)]` requires-nightly This issue requires a nightly compiler in some way. S-tracking-unimplemented Status: The feature has not been implemented. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-lang Relevant to the language team, which will review and decide on the PR/issue.

Comments

@Centril
Copy link
Contributor

Centril commented Jul 28, 2019

This is a tracking issue for the RFC "SIMD vectors in FFI" (rust-lang/rfcs#2574).
The feature gate is #![feature(simd_ffi)].

Steps:

Unresolved questions:

  • Should it be possible to use, e.g., __m128 on C FFI when the avx feature is enabled? Does that change the calling convention and make doing so unsafe ? We could extend this RFC to also require that to use certain types certain features must be disabled.
@Centril Centril added T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-lang Relevant to the language team, which will review and decide on the PR/issue. C-tracking-issue Category: An issue tracking the progress of sth. like the implementation of an RFC B-RFC-approved Blocker: Approved by a merged RFC but not yet implemented. A-FFI Area: Foreign function interface (FFI) A-SIMD Area: SIMD (Single Instruction Multiple Data) F-simd_ffi `#![feature(simd_ffi)]` labels Jul 28, 2019
@Centril Centril added the requires-nightly This issue requires a nightly compiler in some way. label Jul 28, 2019
@joshtriplett joshtriplett added S-tracking-design-concerns Status: There are blocking design concerns. S-tracking-impl-incomplete Status: The implementation is incomplete. and removed S-tracking-design-concerns Status: There are blocking design concerns. labels Jun 22, 2022
@wesleywiser wesleywiser added S-tracking-unimplemented Status: The feature has not been implemented. and removed S-tracking-impl-incomplete Status: The implementation is incomplete. labels Jan 5, 2024
@RalfJung
Copy link
Member

I think this is mostly implemented by the lint tracked at #116558. However, the simd_ffi feature still exists, and if you don't use it you get some warnings or so? I've seen the improper C types warning, but there's a dedicated warning emitted here that I don't think I have ever seen...

Cc @workingjubilee @veluca93

@RalfJung
Copy link
Member

RalfJung commented Nov 23, 2024

Ah, you only get that error when importing a foreign function in an extern "C" block.

I think that can be removed? Calling that function without having the feature gate required for this vector type will lead to an error (well, a future-compat warning for now, an error eventually). And the error tracked here is quite incomplete anyway (see #87438).

We can probably also remove this warning saying that __m256 is not FFI safe when defining an extern "C" function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-FFI Area: Foreign function interface (FFI) A-SIMD Area: SIMD (Single Instruction Multiple Data) B-RFC-approved Blocker: Approved by a merged RFC but not yet implemented. C-tracking-issue Category: An issue tracking the progress of sth. like the implementation of an RFC F-simd_ffi `#![feature(simd_ffi)]` requires-nightly This issue requires a nightly compiler in some way. S-tracking-unimplemented Status: The feature has not been implemented. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-lang Relevant to the language team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

4 participants