| 1 | // { dg-options "-std=c++17" } |
| 2 | // { dg-do compile { target x86_64-*-* } } |
| 3 | // { dg-require-effective-target c++17 } |
| 4 | // { dg-additional-options "-march=x86-64-v3" { target x86_64-*-* } } |
| 5 | // { dg-require-cmath "" } |
| 6 | // { dg-final { scan-assembler-times "vperm(q|pd)\[\\t \]+\\\$144" 1 } } |
| 7 | |
| 8 | #include <experimental/simd> |
| 9 | |
| 10 | namespace stdx = std::experimental; |
| 11 | |
| 12 | using T = std::uint64_t; |
| 13 | using V = stdx::simd<T, stdx::simd_abi::_VecBuiltin<32>>; |
| 14 | using V1 = stdx::simd<T, stdx::simd_abi::scalar>; |
| 15 | |
| 16 | V perm(V data) |
| 17 | { |
| 18 | auto [carry, _] = stdx::split<3, 1>(data); |
| 19 | return concat(V1(), carry); |
| 20 | } |