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

Add masked expanded loads and compressed stores API #229

Open
gnzlbg opened this issue Mar 12, 2019 · 0 comments
Open

Add masked expanded loads and compressed stores API #229

gnzlbg opened this issue Mar 12, 2019 · 0 comments
Labels
Enhancement New feature or request

Comments

@gnzlbg
Copy link
Contributor

gnzlbg commented Mar 12, 2019

There is an LLVM patch under review (https://reviews.llvm.org/D59180) that adds portable support for masked compressed loads and masked expand stores via llvm.masked.compressstore and llvm.masked.expandload.

We should add two APIs to vector masks:

impl<T, const N: usize> Simd<[T; N]>  
    where Simd<[T; N]>: Mask 
{
    /// Writes the lanes of `value` for which `self` is `true` to 
    /// adjacent memory locations at `ptr`.
    unsafe fn write_compressed<U>(self, value: Simd<[U; N]>, ptr: *mut U);
    /// Reads adjacent `U` values at `ptr` into the result's vector 
    /// lanes for which `self` is `true`, using the values of `defaults` 
    /// otherwise.
    unsafe fn read_expanded<U>(self, defaults: Simd<[U; N]>, ptr: *const U) -> Simd<[U; N]>;
}
@gnzlbg gnzlbg added the Enhancement New feature or request label Mar 12, 2019
@gnzlbg gnzlbg changed the title Add masked compressed load and stores API Add masked expanded loads and compressed stores API Mar 12, 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

1 participant