Skip to content

Commit

Permalink
DSUtil: Унификация кода.
Browse files Browse the repository at this point in the history
  • Loading branch information
v0lt committed Dec 15, 2024
1 parent 97b2322 commit a3b5ead
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/DSUtil/Utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,22 +58,22 @@ void fill_u32(void* dst, uint32_t c, size_t count)
__m128i val = _mm_set1_epi32((int)c);
if (((uintptr_t)dst & 0x0F) == 0) { // 16-byte aligned
for (size_t i = 0; i < o; i += 4) {
_mm_store_si128((__m128i*) & (((DWORD*)dst)[i]), val);
_mm_store_si128((__m128i*) & (((uint32_t*)dst)[i]), val);
}
}
else {
for (size_t i = 0; i < o; i += 4) {
_mm_storeu_si128((__m128i*) & (((DWORD*)dst)[i]), val);
_mm_storeu_si128((__m128i*) & (((uint32_t*)dst)[i]), val);
}
}

switch (n - o) {
case 3:
((DWORD*)dst)[o + 2] = c;
((uint32_t*)dst)[o + 2] = c;
case 2:
((DWORD*)dst)[o + 1] = c;
((uint32_t*)dst)[o + 1] = c;
case 1:
((DWORD*)dst)[o + 0] = c;
((uint32_t*)dst)[o + 0] = c;
}
#endif
}
Expand Down

0 comments on commit a3b5ead

Please sign in to comment.