File tree Expand file tree Collapse file tree 1 file changed +3
-8
lines changed
Expand file tree Collapse file tree 1 file changed +3
-8
lines changed Original file line number Diff line number Diff line change @@ -314,10 +314,9 @@ namespace xsimd
314314 {
315315 XSIMD_IF_CONSTEXPR (sizeof (T) == 1 )
316316 {
317- const __m256i byte_mask = _mm256_set1_epi16 (0x00FF );
318- __m256i u16 = _mm256_and_si256 (self, byte_mask);
319- __m256i r16 = _mm256_srli_epi16 (u16 , shift);
320- return _mm256_and_si256 (r16, byte_mask);
317+ constexpr uint8_t mask8 = static_cast <uint8_t >((1u << shift) - 1u );
318+ __m256i const mask = _mm256_set1_epi8 (mask8);
319+ return _mm256_and_si256 (_mm256_srli_epi16 (self, shift), mask);
321320 }
322321 XSIMD_IF_CONSTEXPR (sizeof (T) == 2 )
323322 {
@@ -331,10 +330,6 @@ namespace xsimd
331330 {
332331 return _mm256_srli_epi64 (self, shift);
333332 }
334- else
335- {
336- return bitwise_rshift<shift>(self, avx {});
337- }
338333 }
339334 }
340335
You can’t perform that action at this time.
0 commit comments