File tree 1 file changed +6
-0
lines changed 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -517,6 +517,11 @@ static inline __m256 mul_sum_i8_pairs_float(const __m256i x, const __m256i y) {
517
517
static inline __m128i packNibbles ( __m256i bytes )
518
518
{
519
519
// Move bits within 16-bit lanes from 0000_abcd_0000_efgh into 0000_0000_abcd_efgh
520
+ #if __AVX512F__
521
+ const __m256i bytes_srli_4 = _mm256_srli_epi16 (bytes , 4 ); // 0000_0000_abcd_0000
522
+ bytes = _mm256_or_si256 (bytes , bytes_srli_4 ); // 0000_abcd_abcd_efgh
523
+ return _mm256_cvtepi16_epi8 (bytes ); // abcd_efgh
524
+ #else
520
525
const __m256i lowByte = _mm256_set1_epi16 ( 0xFF );
521
526
__m256i high = _mm256_andnot_si256 ( lowByte , bytes );
522
527
__m256i low = _mm256_and_si256 ( lowByte , bytes );
@@ -527,6 +532,7 @@ static inline __m128i packNibbles( __m256i bytes )
527
532
__m128i r0 = _mm256_castsi256_si128 ( bytes );
528
533
__m128i r1 = _mm256_extracti128_si256 ( bytes , 1 );
529
534
return _mm_packus_epi16 ( r0 , r1 );
535
+ #endif
530
536
}
531
537
#else
532
538
static inline __m128i packNibbles ( __m128i bytes1 , __m128i bytes2 )
You can’t perform that action at this time.
0 commit comments