diff --git a/.github/workflows/ccp-workflow.yml b/.github/workflows/ccp-workflow.yml index 3ec3330..e31a0d4 100644 --- a/.github/workflows/ccp-workflow.yml +++ b/.github/workflows/ccp-workflow.yml @@ -51,7 +51,7 @@ jobs: fail-fast: false matrix: include: [ - { system: MacOS, runner: macos-13 }, + { system: MacOS, runner: macos-13, macos-latest }, { system: Ubuntu-latest, runner: ubuntu-latest }, ] name: ${{ matrix.system }} Test diff --git a/src/core/codestream/ojph_codestream_avx2.cpp b/src/core/codestream/ojph_codestream_avx2.cpp index c01e071..7e2aa29 100644 --- a/src/core/codestream/ojph_codestream_avx2.cpp +++ b/src/core/codestream/ojph_codestream_avx2.cpp @@ -75,7 +75,7 @@ namespace ojph { // convert to sign and magnitude and keep max_val ui32 shift = 31 - K_max; - __m256i m0 = _mm256_set1_epi32((int)0x80000000); + __m256i m0 = _mm256_set1_epi32(INT_MIN); __m256i tmax = _mm256_loadu_si256((__m256i*)max_val); __m256i *p = (__m256i*)sp; for (ui32 i = 0; i < count; i += 8, p += 1, dp += 8) @@ -99,7 +99,7 @@ namespace ojph { //quantize and convert to sign and magnitude and keep max_val __m256 d = _mm256_set1_ps(delta_inv); - __m256i m0 = _mm256_set1_epi32((int)0x80000000); + __m256i m0 = _mm256_set1_epi32(INT_MIN); __m256i tmax = _mm256_loadu_si256((__m256i*)max_val); float *p = (float*)sp; @@ -123,7 +123,7 @@ namespace ojph { { ojph_unused(delta); ui32 shift = 31 - K_max; - __m256i m1 = _mm256_set1_epi32(0x7FFFFFFF); + __m256i m1 = _mm256_set1_epi32(INT_MAX); si32 *p = (si32*)dp; for (ui32 i = 0; i < count; i += 8, sp += 8, p += 8) { @@ -140,7 +140,7 @@ namespace ojph { float delta, ui32 count) { ojph_unused(K_max); - __m256i m1 = _mm256_set1_epi32(0x7FFFFFFF); + __m256i m1 = _mm256_set1_epi32(INT_MAX); __m256 d = _mm256_set1_ps(delta); float *p = (float*)dp; for (ui32 i = 0; i < count; i += 8, sp += 8, p += 8) @@ -163,7 +163,7 @@ namespace ojph { // convert to sign and magnitude and keep max_val ui32 shift = 63 - K_max; - __m256i m0 = _mm256_set1_epi64x(0x8000000000000000LL); + __m256i m0 = _mm256_set1_epi64x(LLONG_MIN); __m256i zero = _mm256_setzero_si256(); __m256i one = _mm256_set1_epi64x(1); __m256i tmax = _mm256_loadu_si256((__m256i*)max_val); @@ -191,7 +191,7 @@ namespace ojph { ojph_unused(delta); ui32 shift = 63 - K_max; - __m256i m1 = _mm256_set1_epi64x(0x7FFFFFFFFFFFFFFFLL); + __m256i m1 = _mm256_set1_epi64x(LLONG_MAX); __m256i zero = _mm256_setzero_si256(); __m256i one = _mm256_set1_epi64x(1); si64 *p = (si64*)dp; diff --git a/src/core/codestream/ojph_codestream_sse2.cpp b/src/core/codestream/ojph_codestream_sse2.cpp index 738f24b..e980d77 100644 --- a/src/core/codestream/ojph_codestream_sse2.cpp +++ b/src/core/codestream/ojph_codestream_sse2.cpp @@ -138,7 +138,7 @@ namespace ojph { { ojph_unused(delta); ui32 shift = 31 - K_max; - __m128i m1 = _mm_set1_epi32(0x7FFFFFFF); + __m128i m1 = _mm_set1_epi32(INT_MAX); __m128i zero = _mm_setzero_si128(); __m128i one = _mm_set1_epi32(1); si32 *p = (si32*)dp; @@ -160,7 +160,7 @@ namespace ojph { float delta, ui32 count) { ojph_unused(K_max); - __m128i m1 = _mm_set1_epi32(0x7FFFFFFF); + __m128i m1 = _mm_set1_epi32(INT_MAX); __m128 d = _mm_set1_ps(delta); float *p = (float*)dp; for (ui32 i = 0; i < count; i += 4, sp += 4, p += 4) @@ -183,7 +183,7 @@ namespace ojph { // convert to sign and magnitude and keep max_val ui32 shift = 63 - K_max; - __m128i m0 = _mm_set1_epi64x(0x8000000000000000LL); + __m128i m0 = _mm_set1_epi64x(LLONG_MIN); __m128i zero = _mm_setzero_si128(); __m128i one = _mm_set1_epi64x(1); __m128i tmax = _mm_loadu_si128((__m128i*)max_val); @@ -211,7 +211,7 @@ namespace ojph { { ojph_unused(delta); ui32 shift = 63 - K_max; - __m128i m1 = _mm_set1_epi64x(0x7FFFFFFFFFFFFFFFLL); + __m128i m1 = _mm_set1_epi64x(LLONG_MAX); __m128i zero = _mm_setzero_si128(); __m128i one = _mm_set1_epi64x(1); si64 *p = (si64*)dp; diff --git a/src/core/transform/ojph_colour_sse2.cpp b/src/core/transform/ojph_colour_sse2.cpp index 1b5598a..988614b 100644 --- a/src/core/transform/ojph_colour_sse2.cpp +++ b/src/core/transform/ojph_colour_sse2.cpp @@ -335,7 +335,7 @@ namespace ojph { (g->flags & line_buf::LFT_32BIT) && (b->flags & line_buf::LFT_32BIT)); __m128i v2 = _mm_set1_epi64x(1ULL << (63 - 2)); - __m128i low_bits = _mm_set_epi64x(0, 0xFFFFFFFFFFFFFFFFLL); + __m128i low_bits = _mm_set_epi64x(0, ULLONG_MAX); const si64 *yp = y->i64, *cbp = cb->i64, *crp = cr->i64; si32 *rp = r->i32, *gp = g->i32, *bp = b->i32; for (int i = (repeat + 3) >> 2; i > 0; --i) diff --git a/src/core/transform/ojph_transform_avx2.cpp b/src/core/transform/ojph_transform_avx2.cpp index 0a6ea4d..68b67ff 100644 --- a/src/core/transform/ojph_transform_avx2.cpp +++ b/src/core/transform/ojph_transform_avx2.cpp @@ -272,7 +272,7 @@ namespace ojph { const si32 b = s->rev.Batk; const ui8 e = s->rev.Eatk; __m256i vb = _mm256_set1_epi64x(b); - __m256i ve = _mm256_set1_epi64x(1ULL << (63 - e)); + __m256i ve = _mm256_set1_epi64x(1LL << (63 - e)); si64* dst = aug->i64; const si64* src1 = sig->i64, * src2 = other->i64; @@ -621,7 +621,7 @@ namespace ojph { const si32 b = s->rev.Batk; const ui8 e = s->rev.Eatk; __m256i vb = _mm256_set1_epi64x(b); - __m256i ve = _mm256_set1_epi64x(1ULL << (63 - e)); + __m256i ve = _mm256_set1_epi64x(1LL << (63 - e)); // extension lp[-1] = lp[0]; @@ -977,7 +977,7 @@ namespace ojph { const si32 b = s->rev.Batk; const ui8 e = s->rev.Eatk; __m256i vb = _mm256_set1_epi64x(b); - __m256i ve = _mm256_set1_epi64x(1ULL << (63 - e)); + __m256i ve = _mm256_set1_epi64x(1LL << (63 - e)); // extension oth[-1] = oth[0]; diff --git a/src/core/transform/ojph_transform_sse2.cpp b/src/core/transform/ojph_transform_sse2.cpp index f083e8e..cafaaa4 100644 --- a/src/core/transform/ojph_transform_sse2.cpp +++ b/src/core/transform/ojph_transform_sse2.cpp @@ -238,7 +238,7 @@ namespace ojph { const si64 b = s->rev.Batk; const ui8 e = s->rev.Eatk; __m128i vb = _mm_set1_epi64x(b); - __m128i ve = _mm_set1_epi64x(1ULL << (63 - e)); + __m128i ve = _mm_set1_epi64x(1LL << (63 - e)); si64* dst = aug->i64; const si64* src1 = sig->i64, * src2 = other->i64; @@ -537,7 +537,7 @@ namespace ojph { const si32 b = s->rev.Batk; const ui8 e = s->rev.Eatk; __m128i vb = _mm_set1_epi64x(b); - __m128i ve = _mm_set1_epi64x(1ULL << (63 - e)); + __m128i ve = _mm_set1_epi64x(1LL << (63 - e)); // extension lp[-1] = lp[0]; @@ -843,7 +843,7 @@ namespace ojph { const si32 b = s->rev.Batk; const ui8 e = s->rev.Eatk; __m128i vb = _mm_set1_epi64x(b); - __m128i ve = _mm_set1_epi64x(1ULL << (63 - e)); + __m128i ve = _mm_set1_epi64x(1LL << (63 - e)); // extension oth[-1] = oth[0];