Add RISC-V target detection#156
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
base64 did not recognize RISC-V explicitly in its CMake target detection, so riscv configurations could depend on generic fallback behavior and unclear SIMD exclusion. This patch makes the baseline RISC-V path explicit while keeping the existing portable codec path.
What changed
__riscvand__riscv_xlen.riscv64,rv64,riscv32,rv32, and genericriscv*values fromCMAKE_SYSTEM_PROCESSOR.BASE64_TARGET_RISCVfor RISC-V CMake configurations.Verification
cmake -S . -B build-codex-native -DBASE64_BUILD_TESTS=ON -DBASE64_BUILD_CLI=ON -DBASE64_WERROR=OFF.cmake --build build-codex-native --parallel 2.ctest --test-dir build-codex-native --output-on-failure; bothtest_base64andbenchmarkpassed.CMAKE_SYSTEM_NAME=Linux,CMAKE_SYSTEM_PROCESSOR=riscv64, andCMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARY.cmake --build build-codex-riscv64-4 --parallel 2.config.h:BASE64_TARGET_RISCV=1;BASE64_WITH_SSSE3,BASE64_WITH_SSE41,BASE64_WITH_SSE42,BASE64_WITH_AVX,BASE64_WITH_AVX2,BASE64_WITH_AVX512,BASE64_WITH_NEON32, andBASE64_WITH_NEON64were all0.compile_commands.json: no-mavx,-mssse3,-msse4,-mfpu=neon,-march=arm, or/arch:AVXflags were present.Notes
This is a conservative CMake portability patch. It does not add RVV codecs or RISC-V-specific Base64 SIMD acceleration. A real riscv64 cross-build or hardware run was not performed on the local Windows host because no RISC-V toolchain is available here.