From 12575df6ba2d897f7d8a91c252ca0af4451f5024 Mon Sep 17 00:00:00 2001 From: Antoni Boucher Date: Fri, 27 Sep 2024 12:37:56 -0400 Subject: [PATCH] Cleanup --- Cargo.lock | 10 ++++++---- Cargo.toml | 4 ++-- build_system/src/build.rs | 10 +--------- src/base.rs | 4 ---- src/declare.rs | 14 +++----------- 5 files changed, 12 insertions(+), 30 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 42528419a25..f2a368395b2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -79,16 +79,18 @@ dependencies = [ [[package]] name = "gccjit" -version = "2.1.0" -source = "git+https://github.com/rust-lang/gccjit.rs#4fbe2023250357378fb2faf6f484b34cb8f8ebc3" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4bb376e98c82d9284c3a17fc1d6bf9bc921055418950238d7a553c27a7e1f6ab" dependencies = [ "gccjit_sys", ] [[package]] name = "gccjit_sys" -version = "0.2.0" -source = "git+https://github.com/rust-lang/gccjit.rs#4fbe2023250357378fb2faf6f484b34cb8f8ebc3" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93b4b1be553b5df790bf25ca2a1d6add81727dc29f8d5c8742468ed306d621d1" dependencies = [ "libc", ] diff --git a/Cargo.toml b/Cargo.toml index 67a90cc34ee..22b953cd2d1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -22,8 +22,8 @@ master = ["gccjit/master"] default = ["master"] [dependencies] -#gccjit = "2.1" -gccjit = { git = "https://github.com/rust-lang/gccjit.rs" } +gccjit = "2.2" +#gccjit = { git = "https://github.com/rust-lang/gccjit.rs" } # Local copy. #gccjit = { path = "../gccjit.rs" } diff --git a/build_system/src/build.rs b/build_system/src/build.rs index d5d099fb14c..d0ced211a61 100644 --- a/build_system/src/build.rs +++ b/build_system/src/build.rs @@ -131,15 +131,7 @@ pub fn build_sysroot(env: &HashMap, config: &ConfigInfo) -> Resu rustflags.push_str(" -Csymbol-mangling-version=v0"); } - let mut args: Vec<&dyn AsRef> = vec![ - &"cargo", - &"build", - &"--target", - &config.target, - // TODO: remove this feature? - &"--features", - &"std/compiler-builtins-no-f16-f128", - ]; + let mut args: Vec<&dyn AsRef> = vec![&"cargo", &"build", &"--target", &config.target]; for feature in &config.features { args.push(&"--features"); args.push(feature); 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 @@ fn module_codegen( 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), };