Skip to content

types to use for mask parameters #6

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

Closed
jackmott opened this issue Jun 9, 2017 · 3 comments
Closed

types to use for mask parameters #6

jackmott opened this issue Jun 9, 2017 · 3 comments

Comments

@jackmott
Copy link
Contributor

jackmott commented Jun 9, 2017

avx and avx512 have a lot of mask parameters.

For a function like _mm256_blendv_pd what should the type be for the mask parameter?
I've currently got it as:

pub fn _mm256_blendv_pd(a: f64x4, b: f64x4, mask: f64x4) -> f64x4 {
    unsafe { blendvpd256(a, b, mask) }
}

But should this be i64x4? __m256i?

@BurntSushi
Copy link
Member

This is an interesting one. I'm not exactly sure. Both Clang and the Intel documentation say the mask should be a __m256d which is equivalent to f64x4. The documentation certainly seems to treat the mask parameter as if it were a normal bit vector, but the types clearly indicate otherwise.

Unless there's a compelling reason to the contrary, we should stick to the vendor interface. I will note this case down and mention in the RFC though. Thanks!

@alexcrichton
Copy link
Member

@p32blo had a question about some mask types, @BurntSushi you may know better than I maybe?

@alexcrichton
Copy link
Member

I'm going to close this now due to #263

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants