Skip to content

Commit

Permalink
Adding more tests to travis. A few more unit tests for issue 21.
Browse files Browse the repository at this point in the history
  • Loading branch information
lemire committed Sep 20, 2018
1 parent c80442f commit 3697eff
Show file tree
Hide file tree
Showing 5 changed files with 1,038 additions and 995 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ branches:
only:
- master

script: make && ./unit
script: make && ./unit && ./unit_chars && make clean && make DEBUG=1 && ./unit && ./unit_chars
6 changes: 3 additions & 3 deletions src/simdbitpacking.c
Original file line number Diff line number Diff line change
Expand Up @@ -14257,7 +14257,7 @@ const __m128i *simdunpack_shortlength(const __m128i *in, int length,
memcpy(out, in, length * sizeof(uint32_t));
return (const __m128i *)((uint32_t *)in + length);
}
maskbits = _mm_set1_epi32((1 << bit) - 1);
maskbits = _mm_set1_epi32((1U << bit) - 1);
inwordpointer = 0;
P = _mm_loadu_si128((__m128i *)in);
++in;
Expand Down Expand Up @@ -14306,7 +14306,7 @@ void simdfastset(__m128i *in128, uint32_t b, uint32_t value, size_t index) {
const int bitsinlane = (index / 4) * b; /* how many bits in lane */
const int firstwordinlane = bitsinlane / 32;
const int secondwordinlane = (bitsinlane + b - 1) / 32;
const uint32_t mask = (1 << b) - 1;
const uint32_t mask = (1U << b) - 1;
if (b == 0)
return;
/* we zero */
Expand All @@ -14325,7 +14325,7 @@ void simdfastset(__m128i *in128, uint32_t b, uint32_t value, size_t index) {
/* harder case where we need to combine two words */
const int firstbits = 32 - (bitsinlane % 32);
const int usablebits = b - firstbits;
const uint32_t mask2 = (1 << usablebits) - 1;
const uint32_t mask2 = (1U << usablebits) - 1;
in[4 * firstwordinlane + 4 + lane] &= ~mask2; /* we zero */
in[4 * firstwordinlane + 4 + lane] |= value >> firstbits; /* we write */
return;
Expand Down
4 changes: 2 additions & 2 deletions src/simdfor.c
Original file line number Diff line number Diff line change
Expand Up @@ -14999,7 +14999,7 @@ uint32_t simdselectFOR(uint32_t initvalue, const __m128i *in, uint32_t bit,
const int secondwordinlane = (bitsinlane + bit - 1) / 32;
const uint32_t firstpart =
pin[4 * firstwordinlane + lane] >> (bitsinlane % 32);
const uint32_t mask = (1 << bit) - 1;
const uint32_t mask = (1U << bit) - 1;
if (firstwordinlane == secondwordinlane) {
/* easy common case*/
return initvalue + (firstpart & mask);
Expand Down Expand Up @@ -15116,7 +15116,7 @@ const __m128i *simdunpackFOR_length(uint32_t initvalue, const __m128i *in,
return (const __m128i *)((const uint32_t *)in + length);
}
offset = _mm_set1_epi32(initvalue);
maskbits = _mm_set1_epi32((1 << bit) - 1);
maskbits = _mm_set1_epi32((1U << bit) - 1);
inwordpointer = 0;
P = _mm_loadu_si128((__m128i *)in);
++in;
Expand Down
Loading

0 comments on commit 3697eff

Please sign in to comment.