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

fix simd_bitmask docs #378

Merged
merged 1 commit into from
Dec 3, 2023
Merged

Conversation

RalfJung
Copy link
Member

@RalfJung RalfJung commented Dec 3, 2023

Seems like we forgot to update the docs when #267 landed. This documentation matches the follow testcase:

    let values = [false, false, false, true];
    let mask = Mask::<i64, 4>::from_array(values);

    unsafe {
        let bitmask1: u8 = simd_bitmask(mask.to_int());
        let bitmask2: [u8; 1] = simd_bitmask(mask.to_int());
        if cfg!(target_endian = "little") {
            assert_eq!(bitmask1, 0b1000);
            assert_eq!(bitmask2, [0b1000]);
        } else {
            assert_eq!(bitmask1, 0b0001);
            assert_eq!(bitmask2, [0b0001]);
        }
    }

@calebzulawski calebzulawski merged commit 80ff6a5 into rust-lang:master Dec 3, 2023
66 checks passed
@RalfJung RalfJung deleted the simd_bitmask branch December 3, 2023 20:44
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.

2 participants