Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion compression/compress-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -511,6 +511,17 @@ struct CompressTraits<int8_t> {
raw1 = hn::ConvertTo(df, vec_i32_1);
}

template <class DI16, HWY_IF_I16_D(DI16)>
static HWY_INLINE void Load2(DI16 di16,
const PackedSpan<const Packed>& packed,
const size_t packed_ofs, hn::Vec<DI16>& raw0,
hn::Vec<DI16>& raw1) {
const hn::Repartition<int8_t, DI16> di8;
const auto packed_vec = hn::LoadU(di8, packed.ptr + packed_ofs);
raw0 = hn::PromoteLowerTo(di16, packed_vec);
raw1 = hn::PromoteUpperTo(di16, packed_vec);
}

template <class DBF, HWY_IF_BF16_D(DBF)>
static HWY_INLINE void Load2(DBF dbf, const PackedSpan<const Packed>& packed,
const size_t packed_ofs, hn::Vec<DBF>& raw0,
Expand Down Expand Up @@ -745,7 +756,8 @@ HWY_INLINE void VerifyRawAndPackedForDecompress() {
using TRaw = hn::TFromD<DRaw>;
// We can decompress any Packed to f32 or BF16, or f32 to f64.
static_assert(hwy::IsSameEither<TRaw, float, BF16>() ||
(IsF32<Packed>() && hwy::IsSame<TRaw, double>()));
(IsF32<Packed>() && hwy::IsSame<TRaw, double>()) ||
(IsInt8<Packed>() && hwy::IsSame<TRaw, int16_t>()));
}

} // namespace detail
Expand Down
Loading
Loading