Skip to content

Commit

Permalink
Fix avx512 16-bit symbol output
Browse files Browse the repository at this point in the history
  • Loading branch information
lin-toto committed Apr 17, 2023
1 parent 0654ee1 commit 7344a71
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions include/recoil/simd/rans_decoder_avx512_32x16n.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,13 @@ namespace Recoil {
}

inline void writeResult(const u32x16 symbolsSimd, ValueType *ptr) override {
auto sym = _mm512_cvtepi32_epi8(symbolsSimd);
_mm_storeu_si128(reinterpret_cast<__m128i*>(ptr), sym);
if constexpr (sizeof(ValueType) == 1) {
auto sym = _mm512_cvtepi32_epi8(symbolsSimd);
_mm_storeu_si128(reinterpret_cast<__m128i *>(ptr), sym);
} else {
auto sym = _mm512_cvtepi32_epi16(symbolsSimd);
_mm256_storeu_si256(reinterpret_cast<__m256i *>(ptr), sym);
}
}
};

Expand Down

0 comments on commit 7344a71

Please sign in to comment.