Skip to content

Commit 5794854

Browse files
authored
[libc][NFC] Use 16-byte indices for _mmXXX_shuffle_epi8 (#77781)
This is less confusing since the implementation only cares about the 4 lower bits.
1 parent 8f90e69 commit 5794854

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

libc/src/string/memory_utils/op_x86.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -263,13 +263,13 @@ LIBC_INLINE uint64_t big_endian_cmp_mask(__m512i max, __m512i value) {
263263
// 16-byte lane.
264264
// zmm = | 16 bytes | 16 bytes | 16 bytes | 16 bytes |
265265
// zmm = | <8> | <8> | <8> | <8> | <8> | <8> | <8> | <8> |
266-
const __m512i indices = _mm512_set_epi8(56, 57, 58, 59, 60, 61, 62, 63, //
267-
48, 49, 50, 51, 52, 53, 54, 55, //
268-
40, 41, 42, 43, 44, 45, 46, 47, //
269-
32, 33, 34, 35, 36, 37, 38, 39, //
270-
24, 25, 26, 27, 28, 29, 30, 31, //
271-
16, 17, 18, 19, 20, 21, 22, 23, //
272-
8, 9, 10, 11, 12, 13, 14, 15, //
266+
const __m512i indices = _mm512_set_epi8(8, 9, 10, 11, 12, 13, 14, 15, //
267+
0, 1, 2, 3, 4, 5, 6, 7, //
268+
8, 9, 10, 11, 12, 13, 14, 15, //
269+
0, 1, 2, 3, 4, 5, 6, 7, //
270+
8, 9, 10, 11, 12, 13, 14, 15, //
271+
0, 1, 2, 3, 4, 5, 6, 7, //
272+
8, 9, 10, 11, 12, 13, 14, 15, //
273273
0, 1, 2, 3, 4, 5, 6, 7);
274274
// Then we compute the mask for equal bytes. In this mask the bits of each
275275
// byte are already reversed but the byte themselves should be reversed, this

0 commit comments

Comments
 (0)