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

Miri ICEs on non-power-of-2 non-packed SIMD vectors #3458

Closed
RalfJung opened this issue Apr 6, 2024 · 1 comment · Fixed by rust-lang/rust#126184
Closed

Miri ICEs on non-power-of-2 non-packed SIMD vectors #3458

RalfJung opened this issue Apr 6, 2024 · 1 comment · Fixed by rust-lang/rust#126184
Labels
A-shims Area: This affects the external function shims C-bug Category: This is a bug. I-ICE Impact: makes Miri crash with some ICE

Comments

@RalfJung
Copy link
Member

RalfJung commented Apr 6, 2024

#![feature(core_intrinsics)]
#![feature(repr_simd)]

use core::intrinsics::simd::*;

#[repr(simd)]
struct Simd<T, const N: usize>(pub [T; N]);

fn main() { unsafe {
    let v1 = Simd([1u32; 3]);
    let v2 = Simd([2u32; 3]);
    let v3 = simd_add(v1, v2);
    assert_eq!(v3.0, [3u32; 3]);
} }

Cc rust-lang/portable-simd#319

@RalfJung RalfJung added C-bug Category: This is a bug. A-shims Area: This affects the external function shims I-ICE Impact: makes Miri crash with some ICE labels May 3, 2024
@RalfJung RalfJung changed the title Miri ICEs on non-power-of-2 SIMD vectors Miri ICEs on non-power-of-2 non-packed SIMD vectors Jun 8, 2024
@RalfJung
Copy link
Member Author

RalfJung commented Jun 8, 2024

With rust-lang/rust#117116, there are now non-power-of-2 SIMD types without padding, and portable-simd is moving towards adopting those. They work fine in Miri. Only the variants that add padding lead to an ICE.

Currently it's unclear whether we'll even keep supporting them so this is pretty low priority on the Miri side.

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Jun 10, 2024
…=oli-obk

interpret: do not ICE on padded non-pow2 SIMD vectors

Fixes rust-lang/miri#3458

r? `@oli-obk`
rust-timer added a commit to rust-lang-ci/rust that referenced this issue Jun 10, 2024
Rollup merge of rust-lang#126184 - RalfJung:interpret-simd-nonpow2, r=oli-obk

interpret: do not ICE on padded non-pow2 SIMD vectors

Fixes rust-lang/miri#3458

r? ``@oli-obk``
RalfJung pushed a commit to RalfJung/miri that referenced this issue Jun 11, 2024
interpret: do not ICE on padded non-pow2 SIMD vectors

Fixes rust-lang#3458

r? ``@oli-obk``
flip1995 pushed a commit to flip1995/rust-clippy that referenced this issue Jun 28, 2024
interpret: do not ICE on padded non-pow2 SIMD vectors

Fixes rust-lang/miri#3458

r? ``@oli-obk``
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-shims Area: This affects the external function shims C-bug Category: This is a bug. I-ICE Impact: makes Miri crash with some ICE
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant