Fix Codec T64 on s390x

This commit is contained in:
HarryLeeIBM 2022-10-14 07:16:18 -07:00
parent d63a1fde05
commit 6cdb7b5a94

View File

@ -307,7 +307,19 @@ void reverseTransposeBytes(const UInt64 * matrix, UInt32 col, T & value)
template <typename T>
void load(const char * src, T * buf, UInt32 tail = 64)
{
memcpy(buf, src, tail * sizeof(T));
if constexpr (std::endian::native == std::endian::little)
{
memcpy(buf, src, tail * sizeof(T));
}
else
{
/// Since the algorithm uses little-endian integers, data is loaded
/// as little-endian types on big-endian machine(s390x, etc.)
for (UInt32 i = 0; i < tail; i++)
{
buf[i] = unalignedLoadLE<T>(src + i * sizeof(T));
}
}
}
template <typename T>