summaryrefslogtreecommitdiff
path: root/c
diff options
context:
space:
mode:
authorTheVice <thewinlab@hotmail.com>2020-01-27 16:24:14 +0200
committerJack O'Connor <oconnor663@gmail.com>2020-01-30 16:17:46 -0500
commit58926046ca31df80b8806e64d9edd13b8dd503dd (patch)
tree051f8bb0574719e980cb7b460c9fc6ff12694482 /c
parent3c098eecc1c5a19adbfc1968e055d4cfadf64f0f (diff)
[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.
Diffstat (limited to 'c')
-rw-r--r--c/blake3_avx2.c2
-rw-r--r--c/blake3_avx512.c2
-rw-r--r--c/blake3_sse41.c2
-rw-r--r--c/main.c1
4 files changed, 3 insertions, 4 deletions
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 <stdint.h>
#include <stdio.h>
#include <stdlib.h>
-#include <unistd.h>
#include "blake3.h"
#include "blake3_impl.h"