diff --git a/Src/Core/Memory.c b/Src/Core/Memory.c index 5b8ddd3..7c633d3 100644 --- a/Src/Core/Memory.c +++ b/Src/Core/Memory.c @@ -58,7 +58,7 @@ HallocyError hallocy_set_memory(void *destination, int value, const size_t size) destination_bytes += 1; } - __m512i simd_value = _mm512_set1_epi8(value_bytes); + __m512i simd_value = _mm512_set1_epi8((char)value_bytes); while (destination_bytes - end_address >= SIMD_512_WIDTH) { _mm512_store_si512((__m512i*)destination_bytes, simd_value); destination_bytes += SIMD_512_WIDTH; @@ -73,7 +73,7 @@ HallocyError hallocy_set_memory(void *destination, int value, const size_t size) destination_bytes += 1; } - __m256i simd_value = _mm256_set1_epi8(value_bytes); + __m256i simd_value = _mm256_set1_epi8((char)value_bytes); while (destination_bytes - end_address >= SIMD_256_WIDTH) { _mm256_store_si256((__m256i*)destination_bytes, simd_value); destination_bytes += SIMD_256_WIDTH; @@ -90,7 +90,7 @@ HallocyError hallocy_set_memory(void *destination, int value, const size_t size) destination_bytes += 1; } - __m128i simd_value = _mm_set1_epi8(value_bytes); + __m128i simd_value = _mm_set1_epi8((char)value_bytes); while (destination_bytes - end_address >= SIMD_128_WIDTH) { _mm_store_si128((__m128i*)destination_bytes, simd_value); destination_bytes += SIMD_128_WIDTH; @@ -576,7 +576,7 @@ bool hallocy_compare_memory(void *left_side, void *right_side, const size_t size right_side_bytes += 1; } - while (left_side_bytes - end_address >= 16) { + while (left_side_bytes - end_address >= SIMD_128_WIDTH) { __m128i simd_left_side_value = _mm_load_si128((__m128i*)left_side_bytes); __m128i simd_right_side_value = _mm_load_si128((__m128i*)right_side_bytes);