Skip to content

Commit 896012c

Browse files
JoeMattclaude
andcommitted
Add SIMD blitter bit-exactness tests to CI
Runs the test harness for both the platform-native SIMD implementation and the scalar fallback on every build, covering SSE2 (linux-x64, windows), NEON (linux-arm64, macos-arm64), and scalar cross-check. Co-Authored-By: Claude Opus 4.6 <[email protected]>
1 parent 2c6160f commit 896012c

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

.github/workflows/c-cpp.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,26 @@ jobs:
6969
- name: Build
7070
run: make -j4 CC=${{ matrix.config.cc }} CXX=${{ matrix.config.cxx }}
7171

72+
- name: Run SIMD blitter tests
73+
run: |
74+
# Detect which SIMD impl to test based on runner architecture
75+
ARCH=$(uname -m)
76+
case "$ARCH" in
77+
x86_64|i686|i386) SIMD_SRC=src/blitter_simd_sse2.c; EXTRA="-msse2" ;;
78+
aarch64|arm64) SIMD_SRC=src/blitter_simd_neon.c; EXTRA="" ;;
79+
*) SIMD_SRC=src/blitter_simd_scalar.c; EXTRA="" ;;
80+
esac
81+
82+
echo "==> Testing ${SIMD_SRC}..."
83+
${{ matrix.config.cc }} -O2 -Wall ${EXTRA} -I src \
84+
-o test_blitter_simd test/test_blitter_simd.c ${SIMD_SRC}
85+
./test_blitter_simd
86+
87+
echo "==> Cross-checking against scalar..."
88+
${{ matrix.config.cc }} -O2 -Wall -I src \
89+
-o test_blitter_scalar test/test_blitter_simd.c src/blitter_simd_scalar.c
90+
./test_blitter_scalar
91+
7292
- name: Upload artifact
7393
uses: actions/upload-artifact@v4
7494
with:

0 commit comments

Comments
 (0)