diff --git a/README b/README index ca14849..8cadd07 100644 --- a/README +++ b/README @@ -163,6 +163,7 @@ in this release or in an earlier release: - GCC 9.3.0 (Ubuntu) verified @v207fix1 - clang 8.0.0-3 (Lubuntu) verified @v187fix1 - clang 10.0.0-4 (ubuntu) verified @v207fix1 + - clang 15.0.6 (debian) @v208 - aarch64-linux-gnu-gcc 9.4.0 (Ubuntu) @v207fix1 Note: diff --git a/filter/DecAlpha.cpp b/filter/DecAlpha.cpp index 2c6d165..c48466e 100644 --- a/filter/DecAlpha.cpp +++ b/filter/DecAlpha.cpp @@ -145,6 +145,7 @@ void DECAlpha::Shuffle(uint32_t& instruction) { (instruction & 0x1F); break; } + default: break; } instruction = bswap(instruction); } @@ -173,5 +174,6 @@ void DECAlpha::Unshuffle(uint32_t& instruction) { (instruction & 0x1F); break; } + default: break; } } diff --git a/lstm/Activations.hpp b/lstm/Activations.hpp index bb77cf8..46b8d5b 100644 --- a/lstm/Activations.hpp +++ b/lstm/Activations.hpp @@ -21,7 +21,7 @@ class Tanh : __m256 const c1 = _mm256_set1_ps(0.03138777f); __m256 const c2 = _mm256_set1_ps(0.276281267f); __m256 const c_log2f = _mm256_set1_ps(1.442695022f); - size_t const limit = len & static_cast(-static_cast(SIMDW)); + size_t const limit = len & static_cast(-static_cast(SIMDW)); size_t remainder = len & (SIMDW - 1); for (size_t i = 0; i < limit; i += SIMDW) { _mm_prefetch((char*)(f + i + SIMDW), _MM_HINT_T0); @@ -83,7 +83,7 @@ class Logistic : static __m256 const c_log2f = _mm256_set1_ps(1.442695022f); static __m256 const c_log2f_2 = _mm256_set1_ps(0.721347511f); static __m256 const vec_half = _mm256_set1_ps(0.5f); - size_t const limit = len & static_cast(-static_cast(SIMDW)); + size_t const limit = len & static_cast(-static_cast(SIMDW)); size_t remainder = len & (SIMDW - 1); for (size_t i = 0; i < limit; i += SIMDW) { _mm_prefetch((char*)(f + i + SIMDW), _MM_HINT_T0); diff --git a/lstm/Adam.hpp b/lstm/Adam.hpp index 0421931..1ad9268 100644 --- a/lstm/Adam.hpp +++ b/lstm/Adam.hpp @@ -45,7 +45,7 @@ class Adam : __m256 const vec_bias_v = _mm256_set1_ps(bias_v); __m256 const vec_lr = _mm256_set1_ps(learning_rate); size_t const len = g->size(); - size_t const limit = len & static_cast(-static_cast(SIMDW)); + size_t const limit = len & static_cast(-static_cast(SIMDW)); size_t remainder = len & (SIMDW - 1); for (size_t i = 0; i < limit; i += SIMDW) { diff --git a/lstm/Lstm.hpp b/lstm/Lstm.hpp index 20b7b22..32fb921 100644 --- a/lstm/Lstm.hpp +++ b/lstm/Lstm.hpp @@ -179,7 +179,7 @@ class Lstm { #endif void SoftMaxSimdAVX2() { static constexpr size_t SIMDW = 8; - size_t const limit = output_size & static_cast(-static_cast(SIMDW)), len = hidden.size(); + size_t const limit = output_size & static_cast(-static_cast(SIMDW)), len = hidden.size(); size_t remainder = output_size & (SIMDW - 1); __m256 v_sum = _mm256_setzero_ps(); for (size_t i = 0; i < limit; i++) diff --git a/lstm/SimdFunctions.hpp b/lstm/SimdFunctions.hpp index 764f9f7..1cf8a6d 100644 --- a/lstm/SimdFunctions.hpp +++ b/lstm/SimdFunctions.hpp @@ -41,8 +41,8 @@ __attribute__((target("avx2,fma"))) #endif float dot256_ps_fma3(float const* x1, float const* x2, size_t const len, float init) { static constexpr size_t SIMDW = 8, CACHELINE = 64; - size_t const limit = len & static_cast(-static_cast(SIMDW)); - size_t const limit_x2 = len & static_cast(-static_cast(SIMDW * 2)); + size_t const limit = len & static_cast(-static_cast(SIMDW)); + size_t const limit_x2 = len & static_cast(-static_cast(SIMDW * 2)); size_t remainder = len & (SIMDW - 1), i = SIMDW * 2; __m256 sum0 = _mm256_setzero_ps(); __m256 sum1 = _mm256_setzero_ps(); @@ -69,7 +69,7 @@ __attribute__((target("avx2"))) #endif float sum256_ps(float const* x, size_t const len, float init) { static constexpr size_t SIMDW = 8; - size_t const limit = len & static_cast(-static_cast(SIMDW)), remainder = len & (SIMDW - 1); + size_t const limit = len & static_cast(-static_cast(SIMDW)), remainder = len & (SIMDW - 1); if (limit > 0) { __m256 sum = _mm256_loadu_ps(x); for (size_t i = SIMDW; i < limit; i += SIMDW) diff --git a/model/DecAlphaModel.hpp b/model/DecAlphaModel.hpp index d4cba29..c83d5e2 100644 --- a/model/DecAlphaModel.hpp +++ b/model/DecAlphaModel.hpp @@ -497,6 +497,7 @@ class DECAlphaModel { maps0[state].setDirect(count / 3); break; } + default: break; } } if (count == 0) { diff --git a/model/MatchModel.hpp b/model/MatchModel.hpp index 3e21cc0..cfa3043 100644 --- a/model/MatchModel.hpp +++ b/model/MatchModel.hpp @@ -170,7 +170,7 @@ class MatchModel { //is this position already registered? for (uint32_t j = 0; j < numberOfActiveCandidates; j++) { MatchInfo* oldcandidate = &matchCandidates[j]; - if (isSame = oldcandidate->index == matchpos) + if ((isSame = oldcandidate->index == matchpos)) break; } if (!isSame) { //don't register an already registered sequence diff --git a/zlib/crc32.c b/zlib/crc32.c index 9580440..74a4aa4 100644 --- a/zlib/crc32.c +++ b/zlib/crc32.c @@ -212,7 +212,7 @@ unsigned long ZEXPORT crc32_z(crc, buf, len) #endif /* DYNAMIC_CRC_TABLE */ #ifdef BYFOUR - if (sizeof(void *) == sizeof(ptrdiff_t)) { + if (sizeof(void *) == sizeof(std::ptrdiff_t)) { z_crc_t endian; endian = 1; @@ -273,7 +273,7 @@ local unsigned long crc32_little(crc, buf, len) c = (z_crc_t)crc; c = ~c; - while (len && ((ptrdiff_t)buf & 3)) { + while (len && ((std::ptrdiff_t)buf & 3)) { c = crc_table[0][(c ^ *buf++) & 0xff] ^ (c >> 8); len--; } @@ -313,7 +313,7 @@ local unsigned long crc32_big(crc, buf, len) c = ZSWAP32((z_crc_t)crc); c = ~c; - while (len && ((ptrdiff_t)buf & 3)) { + while (len && ((std::ptrdiff_t)buf & 3)) { c = crc_table[4][(c >> 24) ^ *buf++] ^ (c << 8); len--; } diff --git a/zlib/zutil.h b/zlib/zutil.h index b079ea6..8b21ad4 100644 --- a/zlib/zutil.h +++ b/zlib/zutil.h @@ -30,7 +30,7 @@ #endif #ifdef Z_SOLO - typedef long ptrdiff_t; /* guess -- will be caught if guess is wrong */ + typedef long std::ptrdiff_t; /* guess -- will be caught if guess is wrong */ #endif #ifndef local @@ -171,7 +171,7 @@ extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */ # if defined(_WIN32_WCE) # define fdopen(fd,mode) NULL /* No fdopen() */ # ifndef _PTRDIFF_T_DEFINED - typedef int ptrdiff_t; + typedef int std::ptrdiff_t; # define _PTRDIFF_T_DEFINED # endif # else