Simplify intrinsics generation#823
Merged
GuillaumeGomez merged 3 commits intorust-lang:masterfrom Jan 16, 2026
Merged
Conversation
37df741 to
85d29b8
Compare
antoyo
reviewed
Jan 16, 2026
| fn old_archs(arch: &str, name: &str) -> ArchCheckResult { | ||
| ArchCheckResult::Ok(match arch { | ||
| "AMDGPU" => match name { | ||
| "div.fixup.f32" => "__builtin_amdgpu_div_fixup", |
Contributor
There was a problem hiding this comment.
Are those coming from arch.rs? If so, please move them to a new file to not clutter this one. Also mention in this new file that those were auto-generated in the past and should not be edited manually.
Member
Author
There was a problem hiding this comment.
I was hesitating to do that so definitely agree. :)
| /// Translate a given LLVM intrinsic name to an equivalent GCC one. | ||
| fn map_arch_intrinsic(full_name:&str)-> &'static str { | ||
| let Some(name) = full_name.strip_prefix("llvm.") else { unimplemented!("***** unsupported LLVM intrinsic {}", full_name) }; | ||
| let Some((arch, name)) = name.split_once('.') else { unimplemented!("***** unsupported LLVM intrinsic {}", name) }; |
Contributor
There was a problem hiding this comment.
Shouldn't this be:
Suggested change
| let Some((arch, name)) = name.split_once('.') else { unimplemented!("***** unsupported LLVM intrinsic {}", name) }; | |
| let Some((arch, name)) = name.split_once('.') else { unimplemented!("***** unsupported LLVM intrinsic llvm.{}", name) }; |
?
Member
Author
There was a problem hiding this comment.
Indeed, good catch.
10e5b14 to
916382c
Compare
Member
Author
|
Updated! |
916382c to
7b33794
Compare
7b33794 to
c848b28
Compare
antoyo
approved these changes
Jan 16, 2026
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.
Taking over #580.
I copied all intrinsics generated from old
llvmintandllvmint2repositories directly intollvm.rs, so only remains the actual LLVM intrinsics.