Compare commits

..

3 Commits

Author SHA1 Message Date
TotallyGamerJet
93189d24fc
Merge 63d3af6372 into 1204ac400b 2025-03-28 19:12:05 +07:00
Nic Barker
1204ac400b [Compilers] Fix implicit typecast in simd hash function
Some checks failed
CMake on multiple platforms / build (Release, cl, cl, windows-latest) (push) Has been cancelled
CMake on multiple platforms / build (Release, clang, clang++, ubuntu-latest) (push) Has been cancelled
CMake on multiple platforms / build (Release, gcc, g++, ubuntu-latest) (push) Has been cancelled
2025-03-28 11:52:20 +13:00
Nic Barker
6a7ce77024 [Core] Fix implicit simd typecast on arm architectures 2025-03-28 11:47:57 +13:00

6
clay.h
View File

@ -1373,7 +1373,7 @@ uint64_t Clay__HashData(const uint8_t* data, size_t length) {
length -= 16; length -= 16;
} }
else { else {
for (int i = 0; i < length; i++) { for (size_t i = 0; i < length; i++) {
overflowBuffer[i] = data[i]; overflowBuffer[i] = data[i];
} }
msg = _mm_loadu_si128((const __m128i*)overflowBuffer); msg = _mm_loadu_si128((const __m128i*)overflowBuffer);
@ -1430,11 +1430,11 @@ uint64_t Clay__HashData(const uint8_t* data, size_t length) {
length -= 8; length -= 8;
} }
else { else {
for (int i = 0; i < length; i++) { for (size_t i = 0; i < length; i++) {
overflowBuffer[i] = data[i]; overflowBuffer[i] = data[i];
} }
uint8x8_t lower = vld1_u8(overflowBuffer); uint8x8_t lower = vld1_u8(overflowBuffer);
msg = vcombine_u8(lower, vdup_n_u8(0)); msg = vreinterpretq_u64_u8(vcombine_u8(lower, vdup_n_u8(0)));
length = 0; length = 0;
} }
v0 = veorq_u64(v0, msg); v0 = veorq_u64(v0, msg);