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

RFC: SIMD vectors in FFI #2574

Merged
merged 8 commits into from Jul 28, 2019

Conversation

@gnzlbg
Copy link
Contributor

commented Oct 23, 2018

This RFC allows using architecture-specific vector types like core::arch::x86_64::__m128 in C FFI.

Rendered.
Tracking issue

@gnzlbg gnzlbg changed the title Initial simd_ffi RFC RFC: SIMD in FFI Oct 23, 2018

@gnzlbg gnzlbg changed the title RFC: SIMD in FFI RFC: SIMD vectors in FFI Oct 23, 2018

text/0000-simd-ffi.md Outdated Show resolved Hide resolved
text/0000-simd-ffi.md Outdated Show resolved Hide resolved
text/0000-simd-ffi.md Outdated Show resolved Hide resolved
text/0000-simd-ffi.md Outdated Show resolved Hide resolved
text/0000-simd-ffi.md Outdated Show resolved Hide resolved
@joshtriplett

This comment has been minimized.

Copy link
Member

commented Mar 16, 2019

This seems like a straightforward, reasonable change.

@rfcbot merge

@rfcbot

This comment has been minimized.

Copy link

commented Mar 16, 2019

Team member @joshtriplett has proposed to merge this. The next step is review by the rest of the tagged team members:

No concerns currently listed.

Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up!

See this document for info about what commands tagged team members can give me.

@oli-obk

This comment has been minimized.

Copy link
Contributor

commented Mar 16, 2019

@rfcbot reviewed

text/0000-simd-ffi.md Outdated Show resolved Hide resolved
text/0000-simd-ffi.md Outdated Show resolved Hide resolved
text/0000-simd-ffi.md Outdated Show resolved Hide resolved
@Centril

This comment has been minimized.

Copy link
Member

commented Mar 27, 2019

@gnzlbg Thanks! The implementation in rust-lang/rust#59238 doesn't seem all that complex so therefore:

@rfcbot reviewed

@gnzlbg

This comment has been minimized.

Copy link
Contributor Author

commented Jul 16, 2019

@rfcbot

This comment has been minimized.

Copy link

commented Jul 17, 2019

🔔 This is now entering its final comment period, as per the review above. 🔔

@Zoxc

This comment has been minimized.

Copy link

commented Jul 19, 2019

Are architecture-specific vector types always passed in the vector registers in C ABIs or is that an x86-ism? I know ARM has lots of interesting ABI stuff.

@comex

This comment has been minimized.

Copy link

commented Jul 21, 2019

I checked whether a few architectures pass vector arguments in registers:

  • ARM does: link
  • Power does: link (section 2.2.3)
  • MIPS does not: link (section 5.2.4)

(But ARM also has older "soft float" ABIs that don't even use floating-point registers when passing arguments, let alone SIMD registers.)

@gnzlbg

This comment has been minimized.

Copy link
Contributor Author

commented Jul 23, 2019

Are architecture-specific vector types always passed in the vector registers in C ABIs or is that an x86-ism?

How vector types are passed depends on the ABI used. One could define an x86 ABI that doesn't pass vectors in registers, and in fact, the "Rust ABI" is such an ABI since it currently passes vectors by memory on x86.


FWIW this RFC does not propose always using vector registers on C FFI. Instead, it proposes passing them to C using the ABI of the target, whatever that might be. For doing that correctly, we do need to know whether the type being passed to C is a vector type, its element type, and length, because in most widely used platform ABIs those things will determine which vector register to use.

@rfcbot

This comment has been minimized.

Copy link

commented Jul 27, 2019

The final comment period, with a disposition to merge, as per the review above, is now complete.

As the automated representative of the governance process, I would like to thank the author for their work and everyone else who contributed.

The RFC will be merged soon.

@Centril Centril merged commit 638af43 into rust-lang:master Jul 28, 2019

@Centril

This comment has been minimized.

Copy link
Member

commented Jul 28, 2019

Huzzah! This RFC has been merged!

Tracking issue: rust-lang/rust#63068

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.