RISC-V RVV optimization (UTF-16 inputs) - #406
Open
s1amese2003 wants to merge 1 commit into
Open
Conversation
Mirrors the SSE2/NEON backends. Enabled for the full V extension with RVV intrinsics spec 0.11+ (GCC 13+, Clang 16+). Also enables the test suite in the RISC-V CI workflow, which previously built but ran no tests, and adds a VLEN=256 QEMU pass.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What
Adds a RISC-V Vector (RVV) backend for the existing
char16_tSIMD fast path, mirroring the SSE2/NEON implementations (#198, #209): load 8 UTF-16 code units, check that all are ASCII digits, then narrow and hand the packed bytes to the existing SWAR parser.Enabled when the compiler targets the full V extension (
__riscv_v, which guarantees VLEN >= 128) and provides version 0.11+ of the RVV intrinsics (__riscv_v_intrinsic >= 11000, the version that introduced the__riscv_-prefixed spellings — GCC 13+, Clang 16+). Without the V extension the scalar path is used, as before.CI
-DFASTFLOAT_TEST=ON, so its ctest step had no tests to run (the other emulated-arch workflows, s390x and alpine, do pass it). This PR turns tests on so the new code is actually exercised under QEMU.vlen=256to cover a different hardware vector length;rvv_ta_all_1s=onpoisons tail lanes in both passes.Testing
-march=rv64gcv) at both VLEN=128 and VLEN=256, and natively on x86_64.vsetivli zero,8,e16,m1;vle16.v;vsub.vx;vmsgtu.vi 9;vfirst.m;vnsrl.wi 0;vse8.v.-Wall -Wextra, C++11 and C++17 modes), with-march=rv64gc(no V — scalar fallback), and for rv32gcv.I don't have RVV silicon, so I can't provide hardware benchmarks — happy to adjust anything if you can bench it on real hardware.
Fixes #343