Skip to content

Commit 3b84417

Browse files
committed
a64: Use explicit vector-load instructions
1 parent ae06f6a commit 3b84417

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

source/CRC/CRC32-a64.cpp

+4-3
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,8 @@ inline poly64x2_t
195195
template<std::uint32_t Polynomial>
196196
std::uint32_t CRC32_PMULL(std::span<const std::byte> Data, std::uint32_t CRC)
197197
{
198-
poly64x2x4_t CRCVec = reinterpret_cast<const poly64x2x4_t*>(Data.data())[0];
198+
poly64x2x4_t CRCVec
199+
= vld1q_p64_x4(reinterpret_cast<const poly64_t*>(Data.data()));
199200

200201
Data = Data.subspan(64);
201202

@@ -221,7 +222,7 @@ std::uint32_t CRC32_PMULL(std::span<const std::byte> Data, std::uint32_t CRC)
221222
const poly64x2_t MulHi3 = pmull_p64<1, 1>(CRCVec.val[3], K1K2);
222223

223224
const poly64x2x4_t Load
224-
= reinterpret_cast<const poly64x2x4_t*>(Data.data())[0];
225+
= vld1q_p64_x4(reinterpret_cast<const poly64_t*>(Data.data()));
225226

226227
CRCVec.val[0] = eor3_p64(MulHi0, MulLo0, Load.val[0]);
227228
CRCVec.val[1] = eor3_p64(MulHi1, MulLo1, Load.val[1]);
@@ -260,7 +261,7 @@ std::uint32_t CRC32_PMULL(std::span<const std::byte> Data, std::uint32_t CRC)
260261
for( ; Data.size() >= 16; Data = Data.subspan(16) )
261262
{
262263
const poly64x2_t Load
263-
= *reinterpret_cast<const poly64x2_t*>(Data.data());
264+
= vld1q_p64(reinterpret_cast<const poly64_t*>(Data.data()));
264265

265266
const poly64x2_t MulLo = pmull_p64<0, 0>(CRCVec.val[0], K3K4);
266267
const poly64x2_t MulHi = pmull_p64<1, 1>(CRCVec.val[0], K3K4);

0 commit comments

Comments
 (0)