Skip to content

Tentative support for avx512vl extensions to 256 bit registers #2882

Tentative support for avx512vl extensions to 256 bit registers

Tentative support for avx512vl extensions to 256 bit registers #2882

Workflow file for this run

# RISC-V RVV cross-compilation build (Ubuntu apt qemu, multi-compiler matrix).
#
# vlen=128 is intentionally NOT covered here. Ubuntu's qemu-user-static
# (8.2.x in noble, 9.x in plucky) hangs on the xsimd test_xsimd binary at
# vlen=128 — see QEMU issue #2137 (RVV TCG slowdowns) for the underlying
# emulator behaviour. Until ubuntu-latest ships qemu 11+, vlen=128 coverage
# lives in cross-rvv-arch.yml, which runs inside an archlinux:latest
# container with qemu 11. Vlens >= 256 run fast enough under the apt qemu
# to stay within the test step's timeout.
#
# References:
# QEMU 11.0.0 release notes: https://www.qemu.org/2026/04/22/qemu-11-0-0/
# QEMU RVV slowdowns issue: https://gitlab.com/qemu-project/qemu/-/issues/2137
# Ubuntu RVV vstart bug: https://bugs.launchpad.net/ubuntu/+source/qemu/+bug/2095169
name: RISC-V RVV cross-compilation build
on: [push, pull_request]
concurrency:
group: ${{ github.workflow }}-${{ github.job }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
name: 'RISC-V RVV${{ matrix.vector_bits }}'
strategy:
fail-fast: false
matrix:
sys:
- { compiler: 'gcc', gcc_runtime: '14'}
- { compiler: 'clang', version: '17', gcc_runtime: '14'}
- { compiler: 'clang', version: '18', gcc_runtime: '14'}
vector_bits:
- 256
- 512
steps:
- name: Setup GCC
run: |
sudo apt-get -y -qq update
sudo apt-get -y -qq --no-install-suggests --no-install-recommends install gcc-${{ matrix.sys.gcc_runtime }}-riscv64-linux-gnu g++-${{ matrix.sys.gcc_runtime }}-riscv64-linux-gnu
sudo update-alternatives --install /usr/bin/riscv64-linux-gnu-gcc riscv64-linux-gnu-gcc /usr/bin/riscv64-linux-gnu-gcc-${{ matrix.sys.gcc_runtime }} 20
sudo update-alternatives --install /usr/bin/riscv64-linux-gnu-g++ riscv64-linux-gnu-g++ /usr/bin/riscv64-linux-gnu-g++-${{ matrix.sys.gcc_runtime }} 20
- name: Setup LLVM
if: ${{ matrix.sys.compiler == 'clang' }}
run: |
# Install given LLVM version
curl -o llvm.sh https://apt.llvm.org/llvm.sh
chmod u+x llvm.sh
sudo ./llvm.sh ${{ matrix.sys.version }}
sudo ln -srf $(which clang-${{ matrix.sys.version }}) /usr/bin/clang
sudo ln -srf $(which clang++-${{ matrix.sys.version }}) /usr/bin/clang++
rm llvm.sh
- name: Setup QEMU
# Use the qemu-user-static package shipped by the runner image rather
# than docker/setup-qemu-action: tonistiigi/binfmt pins an even older
# qemu (~6.x/7.x) whose RVV implementation miscompiles vmulh* and is
# known to hang test_xsimd until the 6h GHA timeout.
run: |
sudo apt-get -y -qq update
sudo apt-get -y -qq --no-install-suggests --no-install-recommends install qemu-user-static
qemu-riscv64-static --version
- name: Setup Ninja
run: |
sudo apt-get -y -qq install ninja-build
- name: Checkout xsimd
uses: actions/checkout@v6
- name: Setup
run: >
cmake -S . -B _build
-GNinja
-DBUILD_TESTS=ON
-DDOWNLOAD_DOCTEST=ON
-DCMAKE_BUILD_TYPE=Release
-DTARGET_ARCH=generic
-DCMAKE_C_FLAGS="-march=rv64gcv_zvl${{ matrix.vector_bits }}b_zba_zbb_zbs -mrvv-vector-bits=zvl"
-DCMAKE_CXX_FLAGS="-march=rv64gcv_zvl${{ matrix.vector_bits }}b_zba_zbb_zbs -mrvv-vector-bits=zvl"
-DCMAKE_TOOLCHAIN_FILE=${{ github.workspace }}/.github/toolchains/${{ matrix.sys.compiler }}-riscv64-linux-gnu.cmake
- name: Build
run: cmake --build _build
- name: Set CPU feature test expectations
run: |
echo "XSIMD_TEST_CPU_ASSUME_SSE4_2=0" >> "$GITHUB_ENV"
echo "XSIMD_TEST_CPU_ASSUME_SVE=0" >> "$GITHUB_ENV"
echo "XSIMD_TEST_CPU_ASSUME_RVV=1" >> "$GITHUB_ENV"
- name: Testing xsimd
timeout-minutes: 15
run: >
QEMU_CPU="rv64,zba=true,zbb=true,zbs=true,v=true,vlen=${{ matrix.vector_bits }},elen=64,vext_spec=v1.0"
QEMU_LD_PREFIX="/usr/riscv64-linux-gnu"
./test/test_xsimd
working-directory: ${{ github.workspace }}/_build