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

simd_gather mask triggers an error #237

Open
leudz opened this issue Apr 24, 2019 · 1 comment
Open

simd_gather mask triggers an error #237

leudz opened this issue Apr 24, 2019 · 1 comment
Labels
Bug Something isn't working P-High

Comments

@leudz
Copy link

leudz commented Apr 24, 2019

Hi, this code

fn main() {
    let masks = [m32::new(false); 1024];

    let mask_ptr = cptrx8::splat(masks.as_ptr());
    let mask = unsafe {
        mask_ptr.read(m32x8::splat(true), m32x8::splat(false))
    };
}

triggers this error

invalid monomorphization of simd_gather intrinsic: expected element type *const packed_simd::masks::m32 of second argument packed_simd::codegen::vPtr::cptrx8<*const packed_simd::masks::m32> to be a pointer to the element type i32 of the first argument packed_simd::codegen::v256::m32x8, found *const packed_simd::masks::m32 != *_ i32

Is it the intended behavior?

All masks trigger an error and I'm using the version 1.36.0-nightly (e938c2b9a 2019-04-23) on x86_64-pc-windows-msvc.

@gnzlbg
Copy link
Contributor

gnzlbg commented Apr 24, 2019

Thanks for the report. That should work, but as you mention it does not - I can reproduce.

When doing the mask_ptr.read we should be internally casting / transmuting m32 to i32 but we are not doing currently that, and apparently no test covers this. Nice.

Until this is fixed, a workaround would be to write cptrx8::splat(masks.as_ptr() as *const i32); and once you load the vector of i32s, then cast it to a mask vector.

@gnzlbg gnzlbg added Bug Something isn't working P-High labels Apr 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working P-High
Projects
None yet
Development

No branches or pull requests

2 participants