Allow the C910V target to build with upstream GCC - #6068
Draft
hugomeiland wants to merge 1 commit into
Draft
hugomeiland wants to merge 1 commit into
hugomeiland wants to merge 1 commit into
Conversation
Upstream GCC 14 rejects the Xuantie march string and the unprefixed RVV 0.7 mnemonics. Probe for xtheadvector and keep the vendor flags when that probe fails, so the existing C910V toolchain path is unchanged. Co-authored-by: Cursor <cursoragent@cursor.com>
This branch has not been deployed
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.
Summary
TARGET=C910Vwith upstream GCC 14+ (-march=rv64gc_xtheadvector -mabi=lp64d) as well as the existing Xuantie toolchain. A compile probe keeps the current Xuantie march string and-mtune=c920whenxtheadvectoris rejected, so the C910V CI path is unchanged.th.*via gas macros inkernel/riscv64/c910v_asm.h. The macros are empty on the Xuantie toolchain.dsdot_vector.ccalled the raw 0.7 intrinsic names. Those calls now go throughRISCV_RVV(), matching the other C910 vector kernels. The reduction keeps the 4-argument 0.7 form underRISCV_0p10_INTRINSICSand the 3-argument form otherwise.The C910 vector unit implements T-Head's draft
xtheadvectorextension, which has a known security issue (GhostWrite, CVE-2024-44067). Kernels that include the published mitigation disable that extension, so these kernels only run wherextheadvectoris still exposed. This pull request does not change that. It only makes the existing C910V kernels buildable with upstream GCC.TARGET=C910Vis still required. Autodetection looks for a model name containingT-HEAD C910, which some boards do not provide.Test plan
make TARGET=C910V. Configured asCORE=C910Vwith-march=rv64gc_xtheadvector. The SGEMM kernel containsth.vsetvli.OPENBLAS_NUM_THREADS=2) completed with no failures. Level 2 and Level 3 inputs stop on the first failure; each driver reachedEND OF TESTS.Made with Cursor