Skip to content

Commit 2115578

Browse files
RalfJungAmanieu
authored andcommitted
simd_shuffle: pass the idx argument as a vector
1 parent 5dfe757 commit 2115578

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

crates/core_arch/src/macros.rs

+9-1
Original file line numberDiff line numberDiff line change
@@ -114,10 +114,18 @@ macro_rules! types {
114114
)*);
115115
}
116116

117+
#[allow(unused)]
118+
#[repr(simd)]
119+
pub(crate) struct SimdShuffleIdx<const LEN: usize>(pub(crate) [u32; LEN]);
120+
117121
#[allow(unused)]
118122
macro_rules! simd_shuffle {
119123
($x:expr, $y:expr, $idx:expr $(,)?) => {{
120-
$crate::intrinsics::simd::simd_shuffle::<_, [u32; _], _>($x, $y, const { $idx })
124+
$crate::intrinsics::simd::simd_shuffle(
125+
$x,
126+
$y,
127+
const { $crate::core_arch::macros::SimdShuffleIdx($idx) },
128+
)
121129
}};
122130
}
123131

0 commit comments

Comments
 (0)