rust/tests/target/issue-3105.rs
Stéphane Campinas 9c75a15f4c
Fix handling of code that is annotated with rustfmt::skip.
A rustfmt::skip'ed block is indented although original lines are
returned. In order to resolve this, the leading whitespaces are trimmed
on each line while retaining the layout; this leaves the skipped code
to be indented as necessary by the caller.
2018-10-24 12:11:11 +02:00

31 lines
1.0 KiB
Rust

// rustfmt-wrap_comments: true
/// ```
/// pub unsafe fn _mm256_shufflehi_epi16(a: __m256i, imm8: i32) -> __m256i {
/// let imm8 = (imm8 & 0xFF) as u8;
/// let a = a.as_i16x16();
/// macro_rules! shuffle_done {
/// ($x01:expr, $x23:expr, $x45:expr, $x67:expr) => {
/// #[cfg_attr(rustfmt, rustfmt_skip)]
/// simd_shuffle16(a, a, [
/// 0, 1, 2, 3, 4+$x01, 4+$x23, 4+$x45, 4+$x67,
/// 8, 9, 10, 11, 12+$x01, 12+$x23, 12+$x45, 12+$x67
/// ]);
/// };
/// }
/// }
/// ```
pub unsafe fn _mm256_shufflehi_epi16(a: __m256i, imm8: i32) -> __m256i {
let imm8 = (imm8 & 0xFF) as u8;
let a = a.as_i16x16();
macro_rules! shuffle_done {
($x01:expr, $x23:expr, $x45:expr, $x67:expr) => {
#[cfg_attr(rustfmt, rustfmt_skip)]
simd_shuffle16(a, a, [
0, 1, 2, 3, 4+$x01, 4+$x23, 4+$x45, 4+$x67,
8, 9, 10, 11, 12+$x01, 12+$x23, 12+$x45, 12+$x67
]);
};
}
}