2024-02-23 18:36:24 +01:00
|
|
|
#![feature(repr_simd, intrinsics)]
|
2019-06-19 15:58:51 +02:00
|
|
|
|
|
|
|
//@ revisions:rpass1 rpass2
|
|
|
|
|
|
|
|
#[repr(simd)]
|
2024-08-22 01:28:20 -07:00
|
|
|
struct I32x2([i32; 2]);
|
2019-06-19 15:58:51 +02:00
|
|
|
|
2024-02-23 18:36:24 +01:00
|
|
|
extern "rust-intrinsic" {
|
2023-07-10 13:03:48 +00:00
|
|
|
fn simd_shuffle<T, I, U>(x: T, y: T, idx: I) -> U;
|
2019-06-19 15:58:51 +02:00
|
|
|
}
|
|
|
|
|
2024-09-12 11:33:13 +02:00
|
|
|
#[repr(simd)]
|
|
|
|
struct SimdShuffleIdx<const LEN: usize>([u32; LEN]);
|
|
|
|
|
2019-06-19 15:58:51 +02:00
|
|
|
fn main() {
|
|
|
|
unsafe {
|
2024-09-12 11:33:13 +02:00
|
|
|
const IDX: SimdShuffleIdx<2> = SimdShuffleIdx([0, 0]);
|
2024-08-22 01:28:20 -07:00
|
|
|
let _: I32x2 = simd_shuffle(I32x2([1, 2]), I32x2([3, 4]), IDX);
|
|
|
|
let _: I32x2 = simd_shuffle(I32x2([1, 2]), I32x2([3, 4]), IDX);
|
2019-06-19 15:58:51 +02:00
|
|
|
}
|
|
|
|
}
|