File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -179,6 +179,12 @@ namespace xsimd
179179 {
180180 constexpr auto bits = std::numeric_limits<T>::digits + std::numeric_limits<T>::is_signed;
181181 static_assert (shift < bits, " Shift must be less than the number of bits in T" );
182+ XSIMD_IF_CONSTEXPR (sizeof (T) == 1 )
183+ {
184+ constexpr uint8_t mask8 = static_cast <uint8_t >(~0u << shift);
185+ __m256i const mask = _mm256_set1_epi8 (mask8);
186+ return _mm256_and_si256 (_mm256_slli_epi16 (self, shift), mask);
187+ }
182188 XSIMD_IF_CONSTEXPR (sizeof (T) == 2 )
183189 {
184190 return _mm256_slli_epi16 (self, shift);
@@ -191,10 +197,6 @@ namespace xsimd
191197 {
192198 return _mm256_slli_epi64 (self, shift);
193199 }
194- else
195- {
196- return bitwise_lshift<shift>(self, avx {});
197- }
198200 }
199201
200202 template <class A , class T , class = typename std::enable_if<std::is_integral<T>::value>::type>
You can’t perform that action at this time.
0 commit comments