Keep the default RISC-V build on the SISD fallback path#86
Open
carlosqwqqwq wants to merge 1 commit into
Open
Conversation
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.
Why
spoaalready has a non-SIMD fallback path inAlignmentEngine::Create(...): if the SIMD backend cannot be created, it falls back toSisdAlignmentEngine::Create(...).The problem is that the default CMake path could still inject x86-oriented optimization flags such as
-march=nativeor-msse4.1. When a build is configured forriscv64, those host-oriented flags do not represent the declared target and make the default build configuration misleading.This patch makes the existing conservative RISC-V path explicit:
riscv64stays on the current SISD fallback unless SIMDe is intentionally enabled for porting work.What changed
CMakeLists.txt:riscv*fromCMAKE_SYSTEM_PROCESSOR;README.md:riscv64CMake build skips x86-specific optimization flags and uses the SISD fallback path.Verification
cmake -S . -B build-native -G Ninja -DCMAKE_BUILD_TYPE=Release -Dspoa_build_exe=OFF -Dspoa_build_tests=OFFcmake --build build-native --parallel 4riscv64configure/build:cmake -S . -B build-riscv-sim -G Ninja -DCMAKE_BUILD_TYPE=Release -Dspoa_build_exe=OFF -Dspoa_build_tests=OFF -DCMAKE_SYSTEM_NAME=Linux -DCMAKE_SYSTEM_PROCESSOR=riscv64 -DCMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARYcmake --build build-riscv-sim --parallel 4riscv64configuration now prints:RISC-V target detected; spoa will use the SISD fallback unless SIMDe is enabledSkipping x86-specific optimization flags for RISC-V targetbuild-riscv-sim/build.ninja:simd_alignment_engine_dispatcher.cpp;-march=native,-msse4.1,cpu_features,spoa_avx2,spoa_sse4.1, orspoa_sse2.riscv64install + consumer flow indockcross/linux-riscv64:20260515-5fd14ac:-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_SYSTEM_PROCESSOR=riscv64and the real/usr/xcc/riscv64-unknown-linux-gnu/bin/riscv64-unknown-linux-gnu-g++toolchain;spoato a temporary prefix and built a minimalspoa::spoaconsumer against the installed package config;fileandreadelf -h, which reported a realRISC-VELF (Machine: RISC-V);-march=native,-msse4.1,cpu_features,spoa_avx2,spoa_sse4.1, orspoa_sse2;qemu-riscv64, which printedspoa-ok consensus_len=86 prefix=CATAAAAGAACGTAGGTCGCCTGT.Notes
riscv64.