/src/simdutf/src/icelake/icelake_common.inl.cpp
Line | Count | Source |
1 | | // file included directly |
2 | | /** |
3 | | * Store the last N bytes of previous followed by 512-N bytes from input. |
4 | | */ |
5 | 0 | template <int N> __m512i prev(__m512i input, __m512i previous) { |
6 | 0 | static_assert(N <= 32, "N must be no larger than 32"); |
7 | 0 | const __m512i movemask = |
8 | 0 | _mm512_setr_epi32(28, 29, 30, 31, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11); |
9 | 0 | const __m512i rotated = _mm512_permutex2var_epi32(input, movemask, previous); |
10 | | #if SIMDUTF_GCC8 || SIMDUTF_GCC9 |
11 | | constexpr int shift = 16 - N; // workaround for GCC8,9 |
12 | | return _mm512_alignr_epi8(input, rotated, shift); |
13 | | #else |
14 | 0 | return _mm512_alignr_epi8(input, rotated, 16 - N); |
15 | 0 | #endif // SIMDUTF_GCC8 || SIMDUTF_GCC9 |
16 | 0 | } Unexecuted instantiation: simdutf.cpp:long long __vector(8) simdutf::icelake::(anonymous namespace)::prev<1>(long long __vector(8), long long __vector(8)) Unexecuted instantiation: simdutf.cpp:long long __vector(8) simdutf::icelake::(anonymous namespace)::prev<2>(long long __vector(8), long long __vector(8)) Unexecuted instantiation: simdutf.cpp:long long __vector(8) simdutf::icelake::(anonymous namespace)::prev<3>(long long __vector(8), long long __vector(8)) |
17 | | |
18 | | template <unsigned idx0, unsigned idx1, unsigned idx2, unsigned idx3> |
19 | 0 | __m512i shuffle_epi128(__m512i v) { |
20 | 0 | static_assert((idx0 >= 0 && idx0 <= 3), "idx0 must be in range 0..3"); |
21 | 0 | static_assert((idx1 >= 0 && idx1 <= 3), "idx1 must be in range 0..3"); |
22 | 0 | static_assert((idx2 >= 0 && idx2 <= 3), "idx2 must be in range 0..3"); |
23 | 0 | static_assert((idx3 >= 0 && idx3 <= 3), "idx3 must be in range 0..3"); |
24 | |
|
25 | 0 | constexpr unsigned shuffle = idx0 | (idx1 << 2) | (idx2 << 4) | (idx3 << 6); |
26 | 0 | return _mm512_shuffle_i32x4(v, v, shuffle); |
27 | 0 | } Unexecuted instantiation: simdutf.cpp:long long __vector(8) simdutf::icelake::(anonymous namespace)::shuffle_epi128<0u, 0u, 0u, 0u>(long long __vector(8)) Unexecuted instantiation: simdutf.cpp:long long __vector(8) simdutf::icelake::(anonymous namespace)::shuffle_epi128<1u, 1u, 1u, 1u>(long long __vector(8)) Unexecuted instantiation: simdutf.cpp:long long __vector(8) simdutf::icelake::(anonymous namespace)::shuffle_epi128<2u, 2u, 2u, 2u>(long long __vector(8)) Unexecuted instantiation: simdutf.cpp:long long __vector(8) simdutf::icelake::(anonymous namespace)::shuffle_epi128<3u, 3u, 3u, 3u>(long long __vector(8)) |
28 | | |
29 | 0 | template <unsigned idx> constexpr __m512i broadcast_epi128(__m512i v) { |
30 | 0 | return shuffle_epi128<idx, idx, idx, idx>(v); |
31 | 0 | } Unexecuted instantiation: simdutf.cpp:long long __vector(8) simdutf::icelake::(anonymous namespace)::broadcast_epi128<0u>(long long __vector(8)) Unexecuted instantiation: simdutf.cpp:long long __vector(8) simdutf::icelake::(anonymous namespace)::broadcast_epi128<1u>(long long __vector(8)) Unexecuted instantiation: simdutf.cpp:long long __vector(8) simdutf::icelake::(anonymous namespace)::broadcast_epi128<2u>(long long __vector(8)) Unexecuted instantiation: simdutf.cpp:long long __vector(8) simdutf::icelake::(anonymous namespace)::broadcast_epi128<3u>(long long __vector(8)) |
32 | | |
33 | 0 | simdutf_really_inline __m512i broadcast_128bit_lane(__m128i lane) { |
34 | 0 | const __m512i tmp = _mm512_castsi128_si512(lane); |
35 | |
|
36 | 0 | return broadcast_epi128<0>(tmp); |
37 | 0 | } |