-
Notifications
You must be signed in to change notification settings - Fork 301
Feat/mulhilo #1344
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
DiamonDinoia
wants to merge
3
commits into
xtensor-stack:master
Choose a base branch
from
DiamonDinoia:feat/mulhilo
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Feat/mulhilo #1344
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,85 @@ | ||
| # RISC-V RVV cross-compilation build using qemu 11 + gcc 15 (Arch Linux). | ||
| # | ||
| # Why this workflow exists alongside cross-rvv.yml: | ||
| # | ||
| # QEMU's RISC-V Vector emulation is dramatically slower than scalar in | ||
| # qemu < 11 (see QEMU issue #2137 for documented 100x+ slowdowns of | ||
| # auto-vectorised RVV loops under TCG). At vlen=128 the slowdown is large | ||
| # enough that gcc's RVV codegen for our test suite causes the qemu-user | ||
| # emulator to make no observable progress within the 6h GHA timeout — | ||
| # i.e. the apt-shipped qemu-user-static (8.2.x in noble, 9.x in plucky) | ||
| # can't run xsimd's full test_xsimd at vlen=128. | ||
| # | ||
| # Empirically: | ||
| # qemu 8.2.2 (Ubuntu 24.04 apt) : test_xsimd at vlen=128 times out | ||
| # qemu 9.2.1 (Ubuntu 25.04 plucky) : ditto | ||
| # qemu 10.0.8 (Debian trixie) : ditto | ||
| # qemu 11.0.0 (Arch) + gcc 15.1 : 367 cases / 5664 asserts in <10 min | ||
| # | ||
| # So vlen=128 RVV coverage lives in this workflow, which runs the build | ||
| # and test inside an `archlinux:latest` container (qemu 11 + gcc 15.1). | ||
| # The matching ubuntu-runner workflow `cross-rvv.yml` keeps multi-compiler | ||
| # matrix coverage (gcc-14, clang-17/18) for vlens >= 256, where the apt | ||
| # qemu is fast enough. | ||
| # | ||
| # 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 (qemu 11) | ||
| on: [push, pull_request] | ||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.job }}-${{ github.ref }} | ||
| cancel-in-progress: true | ||
| jobs: | ||
| build: | ||
| runs-on: ubuntu-latest | ||
| container: archlinux:latest | ||
| name: 'RISC-V RVV${{ matrix.vector_bits }} (qemu 11)' | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| vector_bits: | ||
| - 128 | ||
| - 256 | ||
| - 512 | ||
| steps: | ||
| - name: Setup toolchain and qemu | ||
| run: | | ||
| pacman -Sy --noconfirm | ||
| pacman -S --noconfirm --needed \ | ||
| qemu-user-static riscv64-linux-gnu-gcc riscv64-linux-gnu-glibc \ | ||
| cmake ninja git ca-certificates | ||
| qemu-riscv64-static --version | ||
| riscv64-linux-gnu-gcc --version | head -1 | ||
| - 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/toolchains/gcc-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 | ||
| # Invoke qemu-riscv64-static explicitly. Inside the archlinux:latest | ||
| # container we don't have permission to register binfmt_misc with the | ||
| # host kernel, so exec'ing the riscv64 ELF directly fails with | ||
| # "Exec format error". | ||
| 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" | ||
| qemu-riscv64-static ./test/test_xsimd | ||
| working-directory: _build | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -40,6 +40,12 @@ Binary operations: | |
| +---------------------------------------+----------------------------------------------------+ | ||
| | :cpp:func:`mul` | per slot multiply | | ||
| +---------------------------------------+----------------------------------------------------+ | ||
| | :cpp:func:`mullo` | low N bits of the 2N-bit integer product | | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. indentation seems odd. |
||
| +---------------------------------------+----------------------------------------------------+ | ||
| | :cpp:func:`mulhi` | high N bits of the 2N-bit integer product | | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same here |
||
| +---------------------------------------+----------------------------------------------------+ | ||
| | :cpp:func:`mulhilo` | pair {hi, lo} of the 2N-bit integer product | | ||
| +---------------------------------------+----------------------------------------------------+ | ||
| | :cpp:func:`div` | per slot division | | ||
| +---------------------------------------+----------------------------------------------------+ | ||
| | :cpp:func:`mod` | per slot modulo | | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess there's no way to have all compilers running on archlinux?