about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorAntoni Boucher <bouanto@zoho.com>2024-09-27 12:37:56 -0400
committerAntoni Boucher <bouanto@zoho.com>2024-09-27 14:04:23 -0400
commit12575df6ba2d897f7d8a91c252ca0af4451f5024 (patch)
tree610a6182dec695a1c8ede38e4130026328474d78 /src
parent117cf3e3cd292c6c18454dcab3eec73ef090b323 (diff)
downloadrust-12575df6ba2d897f7d8a91c252ca0af4451f5024.tar.gz
rust-12575df6ba2d897f7d8a91c252ca0af4451f5024.zip
Cleanup
Diffstat (limited to 'src')
-rw-r--r--src/base.rs4
-rw-r--r--src/declare.rs14
2 files changed, 3 insertions, 15 deletions
diff --git a/src/base.rs b/src/base.rs
index b8f511b73a0..2eaab3ed00c 100644
--- a/src/base.rs
+++ b/src/base.rs
@@ -116,10 +116,6 @@ pub fn compile_codegen_unit(
             context.add_command_line_option("-mavx");
         }
 
-        /*for feature in tcx.sess.opts.cg.target_feature.split(',') {
-            println!("Feature: {}", feature);
-        }*/
-
         for arg in &tcx.sess.opts.cg.llvm_args {
             context.add_command_line_option(arg);
         }
diff --git a/src/declare.rs b/src/declare.rs
index cbf82918a9c..aa7709488e6 100644
--- a/src/declare.rs
+++ b/src/declare.rs
@@ -170,17 +170,9 @@ fn declare_raw_fn<'gcc>(
     if name.starts_with("llvm.") {
         let intrinsic = match name {
             "llvm.fma.f16" => {
-                let param1 = cx.context.new_parameter(None, cx.double_type, "x");
-                let param2 = cx.context.new_parameter(None, cx.double_type, "y");
-                let param3 = cx.context.new_parameter(None, cx.double_type, "z");
-                cx.context.new_function(
-                    None,
-                    FunctionType::Extern,
-                    cx.double_type,
-                    &[param1, param2, param3],
-                    "fma",
-                    false,
-                )
+                // fma is not a target builtin, but a normal builtin, so we handle it differently
+                // here.
+                cx.context.get_builtin_function("fma")
             }
             _ => llvm::intrinsic(name, cx),
         };