]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
added a CI test for x86 32-bit + avx2 combination
authorYann Collet <cyan@fb.com>
Sun, 19 Jan 2025 04:19:55 +0000 (20:19 -0800)
committerYann Collet <cyan@fb.com>
Sun, 19 Jan 2025 06:49:16 +0000 (22:49 -0800)
which is expected to be quite rare, but nonetheless possible.

This test is initially expected to fail, before integration of #4248 fix

.github/workflows/dev-short-tests.yml
lib/common/bitstream.h
lib/common/compiler.h

index 18c66f4f6c79ec482c54e15ba3848f6b6ad86d7a..fa28283f7a0c80aa9e7a77550457e9981ff2d92c 100644 (file)
@@ -164,7 +164,7 @@ jobs:
         make clean
         bash tests/libzstd_builds.sh
 
-  gcc-make-tests-32bit:
+  gcc-make-all-32bit:
     runs-on: ubuntu-latest
     steps:
     - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # tag=v4.1.1
@@ -174,6 +174,17 @@ jobs:
         make libc6install
         CFLAGS="-Werror -m32" make -j all32
 
+  gcc-make-all-32bit-avx2:
+    runs-on: ubuntu-latest
+    steps:
+    - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # tag=v4.1.1
+    - name: Make all, 32bit mode
+      run: |
+        sudo apt-get -qqq update
+        make libc6install
+        CFLAGS="-Werror -m32 -mavx2" make -j all32
+
+
   gcc-8-make:
     runs-on: ubuntu-latest
     steps:
index bc7118b375424bbc3311a202d1d6231800b665d1..88f448aa6d38cf861ce8cc2eebcb5c16b1ade602 100644 (file)
@@ -238,7 +238,7 @@ MEM_STATIC size_t BIT_closeCStream(BIT_CStream_t* bitC)
     BIT_addBitsFast(bitC, 1, 1);   /* endMark */
     BIT_flushBits(bitC);
     if (bitC->ptr >= bitC->endPtr) return 0; /* overflow detected */
-    return (bitC->ptr - bitC->startPtr) + (bitC->bitPos > 0);
+    return (size_t)(bitC->ptr - bitC->startPtr) + (bitC->bitPos > 0);
 }
 
 
index 2a8002288aca6e30eb4261c9cff83ca8cf94c7eb..84ce62349c4e05ff8a966432744f098e8d27b7b1 100644 (file)
 /*Like DYNAMIC_BMI2 but for compile time determination of BMI2 support*/
 #ifndef STATIC_BMI2
 #  if defined(_MSC_VER) && (defined(_M_X64) || defined(_M_I86))
-#    ifdef __AVX2__  //MSVC does not have a BMI2 specific flag, but every CPU that supports AVX2 also supports BMI2
+#    ifdef __AVX2__  /* MSVC does not have a BMI2 specific flag, but every CPU that supports AVX2 also supports BMI2 */
 #       define STATIC_BMI2 1
 #    endif
 #  elif defined(__BMI2__) && defined(__x86_64__) && defined(__GNUC__)