-
Notifications
You must be signed in to change notification settings - Fork 280
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
#[repr(simd)] on structs vs arrays, motivation #37
Comments
I don't really have a dog in this fight. I defined them the way they are a year ago because that's how they were defined in the I haven't kept up with the type-level const RFC. I don't know it's implementation status. I think it would help if we could have some concrete code samples. |
Before we waste any time on this I am just going to ping @alexchrichton and
ask: was this discussed somewhere? And if so, do you have some links? I am
mostly curious, and since we are not going to pursue stabilizing repr[simd]
any time soon maybe this discussion is not worth having. We can manually
implement the Index traits on simd types if we just so desire.
…On Fri 22. Sep 2017 at 14:47, Andrew Gallant ***@***.***> wrote:
I don't really have a dog in this fight. I defined them the way they are *a
year ago* because that's how they were defined in the simd crate *many
years ago*. :-) Any and all developments in Rust the language after that
point had zero role in the design decision.
I haven't kept up with the type-level const RFC. I don't know it's
implementation status. I think it would help if we could have some concrete
code samples.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#37 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AA3Npv1TNx2bcLRJAppJ3ENiQIOSMZW0ks5sk6xsgaJpZM4PfvGh>
.
|
My guess is that it's just always been this way, I can't personally remember a time when we debated this and/or decided on structs. Doing some digging through revealed what may be the first implementation of SIMD in rust using dedicated syntax (not merged) followed by what I think is the first merged PR for SIMD in Rust. This comment in particular may be of interest. tl;dr; I don't think there's much to learn from the past here? |
I'm closing this. The comment you cited answered my questions. |
I have been trying to find the motivation for using
repr(simd)
on tuple structs instead of arrays for a while without any luck. Does anybody have some pointers?I must be missing something because to make using it on arrays makes much more sense, mainly because:
[]
to index into the elements of a simd vector, which is much nicer than using .0 (maybe it is because[]
always does bounds checking which would be bad for simd where a compile-time solution would be preferable?)The text was updated successfully, but these errors were encountered: