-
Notifications
You must be signed in to change notification settings - Fork 86
Simplify intrinsics generation #823
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Simplify intrinsics generation #823
Conversation
37df741 to
85d29b8
Compare
src/intrinsic/llvm.rs
Outdated
| fn old_archs(arch: &str, name: &str) -> ArchCheckResult { | ||
| ArchCheckResult::Ok(match arch { | ||
| "AMDGPU" => match name { | ||
| "div.fixup.f32" => "__builtin_amdgpu_div_fixup", |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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. :)
tools/generate_intrinsics.py
Outdated
| /// 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) }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be:
| 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) }; |
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed, good catch.
10e5b14 to
916382c
Compare
|
Updated! |
916382c to
7b33794
Compare
7b33794 to
c848b28
Compare
Taking over #580.
I copied all intrinsics generated from old
llvmintandllvmint2repositories directly intollvm.rs, so only remains the actual LLVM intrinsics.