Force riscv builds onto the scalar path - #371
Open
carlosqwqqwq wants to merge 1 commit into
Open
Conversation
Member
|
We are planning to archive this repo. Please reach out to axel@cern.ch if you want to fork and maintain. |
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
Vc already has a portable Scalar implementation, but simulated or cross-target
riscv64validation from anx86_64host compiler can still inherit hostSSE/AVXpreprocessor state. That leads the headers to select x86 implementations even when the build system has already chosen the genericsupport_dummy.cpppath. This patch makes the Scalar fallback explicit for RISC-V and prevents the host x86 ABI from leaking into simulatedriscv64builds.What changed
CMakeLists.txtsoriscv*is treated as an explicit Scalar-only target instead of a generic unknown warning path.Vc/global.hso__riscvforcesVc_IMPL_Scalarbefore any hostSSE/AVXauto-detection can run.Vc/common/vectorabi.hso simulated or cross-target RISC-V builds do not inherit the host__x86_64__ABI deduction.Verification
Vc_ENABLE_INSTALL=OFF.cmake --build build-codex-native-061 --parallel 4.riscv64CMake configuration withCMAKE_SYSTEM_NAME=Linux,CMAKE_SYSTEM_PROCESSOR=riscv64,CMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARY, forced__riscv=1/__riscv_xlen=64, andVc_ENABLE_INSTALL=OFF.riscv64static library successfully withcmake --build build-codex-riscv-061 --parallel 4.build.ninjathat the build only compilessrc/support_dummy.cppandsrc/const.cpp, with nosupport_x86.cpp,cpuid.cpp,trigonometric_SSE2.cpp,sse_sorthelper, oravx_sorthelpersources and no-msse*/-mavx*/-mfma/-mbmiflags.Vc/global.hunder forced__riscv=1/__riscv_xlen=64and confirmed onlyVc_IMPL_Scalar=1is defined.__riscv=1/__riscv_xlen=64and confirmedVc::float_v::Size == 1andVc::VectorAbi::DeduceCompatible<float>::typeresolves toScalar.Notes
This is a conservative portability patch. It does not implement a RISC-V SIMD or RVV backend. The goal is to ensure that RISC-V targets reliably select the existing Scalar implementation instead of inheriting host x86 vector assumptions during simulated or cross-target builds.