Skip to content

Conversation

@GuillaumeGomez
Copy link
Member

@GuillaumeGomez GuillaumeGomez commented Jan 12, 2026

Taking over #580.

I copied all intrinsics generated from old llvmint and llvmint2 repositories directly into llvm.rs, so only remains the actual LLVM intrinsics.

fn old_archs(arch: &str, name: &str) -> ArchCheckResult {
ArchCheckResult::Ok(match arch {
"AMDGPU" => match name {
"div.fixup.f32" => "__builtin_amdgpu_div_fixup",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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) };
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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) };

?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed, good catch.

@GuillaumeGomez GuillaumeGomez force-pushed the simplify-intrinsics-generation branch from 10e5b14 to 916382c Compare January 16, 2026 15:52
@GuillaumeGomez
Copy link
Member Author

Updated!

@GuillaumeGomez GuillaumeGomez force-pushed the simplify-intrinsics-generation branch from 916382c to 7b33794 Compare January 16, 2026 15:57
@GuillaumeGomez GuillaumeGomez force-pushed the simplify-intrinsics-generation branch from 7b33794 to c848b28 Compare January 16, 2026 16:14
@GuillaumeGomez GuillaumeGomez merged commit 40973ef into rust-lang:master Jan 16, 2026
38 checks passed
@GuillaumeGomez GuillaumeGomez deleted the simplify-intrinsics-generation branch January 16, 2026 16:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants