Skip to content

also test simd_select_bitmask on arrays for less than 8 elements #3205

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

Merged
merged 4 commits into from
Dec 3, 2023

Conversation

RalfJung
Copy link
Member

@RalfJung RalfJung commented Dec 3, 2023

No description provided.

@RalfJung
Copy link
Member Author

RalfJung commented Dec 3, 2023

@bors r+

@bors
Copy link
Contributor

bors commented Dec 3, 2023

📌 Commit 4a7cfac has been approved by RalfJung

It is now in the queue for this repository.

@bors
Copy link
Contributor

bors commented Dec 3, 2023

⌛ Testing commit 4a7cfac with merge ee7516c...

bors added a commit that referenced this pull request Dec 3, 2023
also test simd_select_bitmask on arrays for less than 8 elements
@bors
Copy link
Contributor

bors commented Dec 3, 2023

💔 Test failed - checks-actions

@RalfJung
Copy link
Member Author

RalfJung commented Dec 3, 2023

@workingjubilee @calebzulawski this code is causing a Miri UB error when run on a big-endian target:

    let bitmask = u8x4::from_array([0b00001101, 0, 0, 0]);
    assert_eq!(
        mask32x4::from_bitmask_vector(bitmask),
        mask32x4::from_array([true, false, true, true]),
    );

It seems to be calling simd_select_bitmask with 10110000. My interpretation was that even on big-endian, it is the N least significant bits that carry the mask when N<8, so this is wrong? I think it should be 00001011.

Currently what it does seems inconsistent with simd_bitmask.

This is basically rust-lang/portable-simd#267 again, but for simd_select_bitmask rather than simd_bitmask.

@RalfJung
Copy link
Member Author

RalfJung commented Dec 3, 2023

Filed an issue: rust-lang/portable-simd#379

I think what Miri does here is right, or at least it is consistent with simd_bitmask and with rust-lang/portable-simd#267. So I'll land this.

@bors r+

@bors
Copy link
Contributor

bors commented Dec 3, 2023

📌 Commit 2e66bec has been approved by RalfJung

It is now in the queue for this repository.

@bors
Copy link
Contributor

bors commented Dec 3, 2023

⌛ Testing commit 2e66bec with merge bad98ce...

@bors
Copy link
Contributor

bors commented Dec 3, 2023

☀️ Test successful - checks-actions
Approved by: RalfJung
Pushing bad98ce to master...

@bors bors merged commit bad98ce into rust-lang:master Dec 3, 2023
@RalfJung RalfJung deleted the simd-bitmask branch December 3, 2023 18:06
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