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

Scatter/gather for non-pointer types? #236

Open
rileylyman opened this issue Apr 21, 2019 · 1 comment
Open

Scatter/gather for non-pointer types? #236

rileylyman opened this issue Apr 21, 2019 · 1 comment
Labels
Enhancement New feature or request

Comments

@rileylyman
Copy link

I'm new to this crate, so I don't know if I just haven't looked hard enough, but it seems like there is no scatter/gather or strided loads/stores for the generic Simd<[T,n]> trait. Is it possible to do strided or gather/scatter memory operations for packed vectors that don't contain pointers? If not, are there any plans on adding this? For example, something like

let arr = [1, 2, 3, 4, 5, 6, 7, 8];
let vec1 = f64x4::load_stride(arr[..], 2); // [1,3,5,7]
let vec2 = f64x4::load_gather(arr[..], [0,3,5,6,7]); // [1,4,6,7,8]
@gnzlbg
Copy link
Contributor

gnzlbg commented Apr 24, 2019

It's possible, but there is no one working on that.

The way one would currently implement both operations is by just creating a suitable vector of pointers, and then doing the load on that. Currently, this approach does not work for all vector types, because the library currently only implements 512-bit wide vectors, and a u8x64::load_gather method would require a 4096-bit wide vector on 64-bit machines.

So full generic support for this might need adding more pointer vector types first.

@gnzlbg gnzlbg added the Enhancement New feature or request label Apr 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants