From 58926046ca31df80b8806e64d9edd13b8dd503dd Mon Sep 17 00:00:00 2001 From: TheVice Date: Mon, 27 Jan 2020 16:24:14 +0200 Subject: [MSVC] added possible to compile at Microsoft Visual C compiler. [main.c] removed including of unistd.h from c/main.c file. [blake3_avx2.c|blake3_avx512.c|blake3_sse41.c] resolved compile error: 'C4146' - applying of unary minus operator to the unsigned value. --- c/blake3_avx2.c | 2 +- c/blake3_avx512.c | 2 +- c/blake3_sse41.c | 2 +- c/main.c | 1 - 4 files changed, 3 insertions(+), 4 deletions(-) (limited to 'c') diff --git a/c/blake3_avx2.c b/c/blake3_avx2.c index 370be4d..c5a2ce9 100644 --- a/c/blake3_avx2.c +++ b/c/blake3_avx2.c @@ -216,7 +216,7 @@ INLINE void transpose_msg_vecs(const uint8_t *const *inputs, INLINE void load_counters(uint64_t counter, bool increment_counter, __m256i *out_lo, __m256i *out_hi) { - const __m256i mask = _mm256_set1_epi32(-(uint32_t)increment_counter); + const __m256i mask = _mm256_set1_epi32(-(int32_t)increment_counter); const __m256i add0 = _mm256_set_epi32(7, 6, 5, 4, 3, 2, 1, 0); const __m256i add1 = _mm256_and_si256(mask, add0); __m256i l = _mm256_add_epi32(_mm256_set1_epi32(counter), add1); diff --git a/c/blake3_avx512.c b/c/blake3_avx512.c index 6477277..cbccb1b 100644 --- a/c/blake3_avx512.c +++ b/c/blake3_avx512.c @@ -1044,7 +1044,7 @@ INLINE void transpose_msg_vecs16(const uint8_t *const *inputs, INLINE void load_counters16(uint64_t counter, bool increment_counter, __m512i *out_lo, __m512i *out_hi) { - const __m512i mask = _mm512_set1_epi32(-(uint32_t)increment_counter); + const __m512i mask = _mm512_set1_epi32(-(int32_t)increment_counter); const __m512i add0 = _mm512_set_epi32(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); const __m512i add1 = _mm512_and_si512(mask, add0); __m512i l = _mm512_add_epi32(_mm512_set1_epi32(counter), add1); diff --git a/c/blake3_sse41.c b/c/blake3_sse41.c index c1b919c..b311225 100644 --- a/c/blake3_sse41.c +++ b/c/blake3_sse41.c @@ -439,7 +439,7 @@ INLINE void transpose_msg_vecs(const uint8_t *const *inputs, INLINE void load_counters(uint64_t counter, bool increment_counter, __m128i *out_lo, __m128i *out_hi) { - const __m128i mask = _mm_set1_epi32(-(uint32_t)increment_counter); + const __m128i mask = _mm_set1_epi32(-(int32_t)increment_counter); const __m128i add0 = _mm_set_epi32(3, 2, 1, 0); const __m128i add1 = _mm_and_si128(mask, add0); __m128i l = _mm_add_epi32(_mm_set1_epi32(counter), add1); diff --git a/c/main.c b/c/main.c index 9fe59dd..fff3c22 100644 --- a/c/main.c +++ b/c/main.c @@ -10,7 +10,6 @@ #include #include #include -#include #include "blake3.h" #include "blake3_impl.h" -- cgit v1.2.3-70-g09d2