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

Boolean masks should become their own type #43

Open
Lokathor opened this issue Aug 19, 2020 · 3 comments
Open

Boolean masks should become their own type #43

Lokathor opened this issue Aug 19, 2020 · 3 comments
Milestone

Comments

@Lokathor
Copy link
Owner

some people like the increased type safety.

this is a breaking change so it'd be in 0.6, but otherwise it's not hard.

@Lokathor Lokathor added this to the v0.6 milestone Aug 19, 2020
@Lokathor
Copy link
Owner Author

Note: This will break because all existing cmp_eq operations would have to change from returning Self to returning a mask value.

@Lokathor
Copy link
Owner Author

Probably we can just have the "mask" factor be a wrapper type over a SIMD type, with blend / bit functions.

pub struct Mask<T>{ inner: T }

@Lokathor
Copy link
Owner Author

Looks like on i586 and other locations without specific hardware support for bit ops on floats we'll have to store these masks as unsigned arrays so that the bits are preserved properly. Otherwise signaling nan values can get bit modified to become quiet nan values.

I wanted to put off any breaks since the request was supposed to be "nice but not needed", but actually this only increases the priority of this particular break.

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

1 participant