Skip to content

Add mask casting using From - #440

Open
RunDevelopment wants to merge 1 commit into
linebender:mainfrom
RunDevelopment:mask-cast-from
Open

RunDevelopment wants to merge 1 commit into
linebender:mainfrom
RunDevelopment:mask-cast-from

Conversation

@RunDevelopment

Copy link
Copy Markdown
Contributor

Related to #439.

I implemented casting between masks with an equal number of lanes. This makes compatible mask conversions very easy for users. Example:

let m32: mask32x16<_> = a.simd_gt(b);
let m8 = mask8x16::from(m32);

Under the hood, this is implemented using the existing Simd::{combine,narrow,split,widen}_maskNxM on all platforms except AVX512 where same-lane-count mask conversion is trivial.

The code in fearless_simd_gen is a bit out there, because I couldn't easily hook into existing systems .

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

Successfully merging this pull request may close these issues.

1 participant