Skip to content
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

Rollup of 9 pull requests #128767

Closed
wants to merge 39 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
e6d5702
Specify the integer type of the `powi` LLVM intrinsic
tgross35 Jul 12, 2024
82b40c4
Add math intrinsics for `f16` and `f128`
tgross35 Jun 19, 2024
fc43c01
Add math functions for `f16` and `f128`
tgross35 Jun 27, 2024
e18036c
Add `core` functions for `f16` and `f128` that require math routines
tgross35 Jul 17, 2024
4383642
Update comments for `{f16, f32, f64, f128}::midpoint`
tgross35 Jul 18, 2024
8e2ca0c
Add a disclaimer about x86 `f128` math functions
tgross35 Jul 30, 2024
b46237b
Enable msvc for zero-extend-abi-param-passing
ChrisDenton Aug 4, 2024
2e5341a
Enable msvc for no-duplicate-libs
ChrisDenton Aug 4, 2024
d8c2b76
run-make: enable msvc for link-dedup
ChrisDenton Aug 4, 2024
3268b2e
Enable msvc for link-args-order
ChrisDenton Aug 4, 2024
1737845
Enable msvc for run-make/rust-lld
ChrisDenton Aug 4, 2024
131d453
rewrite raw-dylib-alt-calling-conventions to rmake
Oneirical Jul 23, 2024
f31f8c4
rewrite raw-dylib-c to rmake
Oneirical Jul 23, 2024
011727f
rewrite redundant-libs to rmake
Oneirical Jul 23, 2024
1967951
add test for symbol visibility of `#[naked]` functions
folkertdev Jul 29, 2024
1054054
rewrite simd-ffi to rmake
Oneirical Aug 5, 2024
0ac3d2e
Add implied target features to target_feature attribute
calebzulawski Jul 26, 2024
a42ec98
Add test to ensure implied target features work with asm, and fix fai…
calebzulawski Jul 26, 2024
82fd5e9
Fix codegen tests
calebzulawski Jul 26, 2024
5077f33
Add missing features
calebzulawski Jul 29, 2024
a3ffd8d
Add +sse4.2 due to #128426
calebzulawski Jul 31, 2024
d00d42f
Bless tests
calebzulawski Jul 31, 2024
0cdc508
Refactor and fill out target feature lists
calebzulawski Aug 2, 2024
d327fdb
Don't use LLVM's target features
calebzulawski Aug 3, 2024
9869a99
Don't use LLVM to compute -Ctarget-feature
calebzulawski Aug 4, 2024
ee7d957
Remove redundant implied features
calebzulawski Aug 4, 2024
9c00b34
Add implied features to non-target-feature functions
calebzulawski Aug 4, 2024
a141d76
Hide implicit target features from diagnostics when possible
calebzulawski Aug 5, 2024
7a78383
Fix typo
calebzulawski Aug 5, 2024
4fad881
Disallow enabling features without their implied features
calebzulawski Aug 6, 2024
e4f1b6c
Rollup merge of #128107 - Oneirical:tomato-hartester, r=jieyouxu
tgross35 Aug 7, 2024
9c09e87
Rollup merge of #128221 - calebzulawski:implied-target-features, r=Am…
tgross35 Aug 7, 2024
2e45a70
Rollup merge of #128362 - folkertdev:naked-function-symbol-visibility…
tgross35 Aug 7, 2024
6329d89
Rollup merge of #128417 - tgross35:f16-f128-math, r=dtolnay
tgross35 Aug 7, 2024
fd1bbf6
Rollup merge of #128638 - ChrisDenton:link-dedup, r=jieyouxu
tgross35 Aug 7, 2024
38ebf04
Rollup merge of #128647 - ChrisDenton:link-args-order, r=jieyouxu
tgross35 Aug 7, 2024
5d986d7
Rollup merge of #128649 - ChrisDenton:param-passing, r=jieyouxu
tgross35 Aug 7, 2024
fc593bf
Rollup merge of #128656 - ChrisDenton:rust-lld, r=lqd
tgross35 Aug 7, 2024
76169ec
Rollup merge of #128700 - Oneirical:i-ffind-these-tests-quite-simdple…
tgross35 Aug 7, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_gcc/src/attributes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ pub fn from_fn_attrs<'gcc, 'tcx>(
let function_features = codegen_fn_attrs
.target_features
.iter()
.map(|features| features.as_str())
.map(|features| features.name.as_str())
.collect::<Vec<&str>>();

if let Some(features) = check_tied_features(
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_codegen_gcc/src/gcc_util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ pub(crate) fn global_gcc_features(sess: &Session, diagnostics: bool) -> Vec<Stri

let feature = backend_feature_name(s)?;
// Warn against use of GCC specific feature names on the CLI.
if diagnostics && !supported_features.iter().any(|&(v, _)| v == feature) {
let rust_feature = supported_features.iter().find_map(|&(rust_feature, _)| {
if diagnostics && !supported_features.iter().any(|&(v, _, _)| v == feature) {
let rust_feature = supported_features.iter().find_map(|&(rust_feature, _, _)| {
let gcc_features = to_gcc_features(sess, rust_feature);
if gcc_features.contains(&feature) && !gcc_features.contains(&rust_feature) {
Some(rust_feature)
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_gcc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,7 @@ pub fn target_features(
sess.target
.supported_target_features()
.iter()
.filter_map(|&(feature, gate)| {
.filter_map(|&(feature, gate, _)| {
if sess.is_nightly_build() || allow_unstable || gate.is_stable() {
Some(feature)
} else {
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_llvm/src/attributes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ pub fn from_fn_attrs<'ll, 'tcx>(
to_add.extend(tune_cpu_attr(cx));

let function_features =
codegen_fn_attrs.target_features.iter().map(|f| f.as_str()).collect::<Vec<&str>>();
codegen_fn_attrs.target_features.iter().map(|f| f.name.as_str()).collect::<Vec<&str>>();

if let Some(f) = llvm_util::check_tied_features(
cx.tcx.sess,
Expand Down
7 changes: 5 additions & 2 deletions compiler/rustc_codegen_llvm/src/back/write.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,14 @@ pub fn write_output_file<'ll>(
}
}

pub fn create_informational_target_machine(sess: &Session) -> OwnedTargetMachine {
pub fn create_informational_target_machine(
sess: &Session,
only_base_features: bool,
) -> OwnedTargetMachine {
let config = TargetMachineFactoryConfig { split_dwarf_file: None, output_obj_file: None };
// Can't use query system here quite yet because this function is invoked before the query
// system/tcx is set up.
let features = llvm_util::global_llvm_features(sess, false);
let features = llvm_util::global_llvm_features(sess, false, only_base_features);
target_machine_factory(sess, config::OptLevel::No, &features)(config)
.unwrap_or_else(|err| llvm_err(sess.dcx(), err).raise())
}
Expand Down
10 changes: 5 additions & 5 deletions compiler/rustc_codegen_llvm/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ pub unsafe fn create_module<'ll>(

// Ensure the data-layout values hardcoded remain the defaults.
{
let tm = crate::back::write::create_informational_target_machine(tcx.sess);
let tm = crate::back::write::create_informational_target_machine(tcx.sess, false);
unsafe {
llvm::LLVMRustSetDataLayoutFromTargetMachine(llmod, &tm);
}
Expand Down Expand Up @@ -775,10 +775,10 @@ impl<'ll> CodegenCx<'ll, '_> {
ifn!("llvm.debugtrap", fn() -> void);
ifn!("llvm.frameaddress", fn(t_i32) -> ptr);

ifn!("llvm.powi.f16", fn(t_f16, t_i32) -> t_f16);
ifn!("llvm.powi.f32", fn(t_f32, t_i32) -> t_f32);
ifn!("llvm.powi.f64", fn(t_f64, t_i32) -> t_f64);
ifn!("llvm.powi.f128", fn(t_f128, t_i32) -> t_f128);
ifn!("llvm.powi.f16.i32", fn(t_f16, t_i32) -> t_f16);
ifn!("llvm.powi.f32.i32", fn(t_f32, t_i32) -> t_f32);
ifn!("llvm.powi.f64.i32", fn(t_f64, t_i32) -> t_f64);
ifn!("llvm.powi.f128.i32", fn(t_f128, t_i32) -> t_f128);

ifn!("llvm.pow.f16", fn(t_f16, t_f16) -> t_f16);
ifn!("llvm.pow.f32", fn(t_f32, t_f32) -> t_f32);
Expand Down
8 changes: 4 additions & 4 deletions compiler/rustc_codegen_llvm/src/intrinsic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ fn get_simple_intrinsic<'ll>(
sym::sqrtf64 => "llvm.sqrt.f64",
sym::sqrtf128 => "llvm.sqrt.f128",

sym::powif16 => "llvm.powi.f16",
sym::powif32 => "llvm.powi.f32",
sym::powif64 => "llvm.powi.f64",
sym::powif128 => "llvm.powi.f128",
sym::powif16 => "llvm.powi.f16.i32",
sym::powif32 => "llvm.powi.f32.i32",
sym::powif64 => "llvm.powi.f64.i32",
sym::powif128 => "llvm.powi.f128.i32",

sym::sinf16 => "llvm.sin.f16",
sym::sinf32 => "llvm.sin.f32",
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_codegen_llvm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ impl CodegenBackend for LlvmCodegenBackend {

fn provide(&self, providers: &mut Providers) {
providers.global_backend_features =
|tcx, ()| llvm_util::global_llvm_features(tcx.sess, true)
|tcx, ()| llvm_util::global_llvm_features(tcx.sess, true, false)
}

fn print(&self, req: &PrintRequest, out: &mut String, sess: &Session) {
Expand Down Expand Up @@ -434,7 +434,7 @@ impl ModuleLlvm {
ModuleLlvm {
llmod_raw,
llcx,
tm: ManuallyDrop::new(create_informational_target_machine(tcx.sess)),
tm: ManuallyDrop::new(create_informational_target_machine(tcx.sess, false)),
}
}
}
Expand Down
Loading
Loading