Skip to content

GCC backend subtree update #143239

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

Merged
merged 55 commits into from
Jun 30, 2025
Merged
Changes from 1 commit
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
6c982df
Remove get_dbg_loc from DebugInfoBuilderMethods
bjorn3 Jun 3, 2025
9eced6c
Remove type_test from IntrinsicCallBuilderMethods
bjorn3 Jun 3, 2025
46575f1
Only borrow EncodedMetadata in codegen_crate
bjorn3 May 30, 2025
7ed4c58
Move metadata object generation for dylibs to the linker code
bjorn3 May 30, 2025
0f7ec70
cg_gcc: convert to CanonAbi
workingjubilee May 21, 2025
906fc5c
Rollup merge of #141569 - workingjubilee:canonicalize-abi, r=bjorn3
matthiaskrgr Jun 3, 2025
620a4f3
Add new Tier-3 targets: `loongarch32-unknown-none*`
heiher Jan 9, 2025
3f2666c
store `target.min_global_align` as an `Align`
folkertdev Jun 7, 2025
10129e4
Use the in-tree `compiler-builtins`
tgross35 Jun 4, 2025
5f20249
Remove all unused feature gates from the compiler
bjorn3 Jun 8, 2025
732253f
Rollup merge of #142179 - folkertdev:min-global-align-parse, r=workin…
workingjubilee Jun 9, 2025
9f85857
Rollup merge of #142194 - bjorn3:less_unstable_features, r=jieyouxu
workingjubilee Jun 9, 2025
f485c26
-Zretpoline and -Zretpoline-external-thunk flags (target modifiers) t…
azhogin Jan 15, 2025
98e21c8
Rollup merge of #141993 - tgross35:use-in-tree-builtins, r=bjorn3
tgross35 Jun 9, 2025
fa425db
Simplify implementation of Rust intrinsics by using type parameters i…
sayantn May 30, 2025
f5c6288
intrinsics: rename min_align_of to align_of
RalfJung Jun 12, 2025
65042d6
add `extern "custom"` functions
folkertdev May 7, 2025
1ff33b5
Unimplement unsized_locals
mejrs Jun 12, 2025
ad90ea8
Rollup merge of #135927 - azhogin:azhogin/retpoline, r=davidtwco
matthiaskrgr Jun 13, 2025
3766fb2
Rollup merge of #140770 - folkertdev:custom-abi, r=tgross35
matthiaskrgr Jun 13, 2025
baaf8da
Auto merge of #142443 - matthiaskrgr:rollup-l1l6d0v, r=matthiaskrgr
bors Jun 13, 2025
4ffcf80
Rollup merge of #141811 - mejrs:bye_locals, r=compiler-errors
matthiaskrgr Jun 14, 2025
3c96f6e
Remove all support for wasm's legacy ABI
bjorn3 Dec 6, 2024
5b660c5
Auto merge of #142259 - sayantn:simplify-intrinsics, r=workingjubilee
bors Jun 14, 2025
29e0e4f
Rollup merge of #133952 - bjorn3:remove_wasm_legacy_abi, r=alexcrichton
fmease Jun 15, 2025
8f47346
Rollup merge of #141769 - bjorn3:codegen_metadata_module_rework, r=wo…
fmease Jun 15, 2025
308ca33
Fix RISC-V C function ABI when passing/returning structs containing f…
beetrees Apr 3, 2025
5615d05
Change __rust_no_alloc_shim_is_unstable to be a function
dpaoliello May 15, 2025
e9d795d
cranelift/gcc: `{Meta,Pointee,}Sized` in minicore
davidtwco Mar 5, 2025
2811b34
Auto merge of #137944 - davidtwco:sized-hierarchy, r=oli-obk
bors Jun 17, 2025
265f4a7
Auto merge of #141061 - dpaoliello:shimasfn, r=bjorn3
bors Jun 18, 2025
efb7997
Merge commit 'fda0bb9588912a3e0606e880ca9f6e913cf8a5a4' into subtree-…
GuillaumeGomez Jun 18, 2025
6bbf8b1
GCC backend: Remove `add_eval` if no function is created
GuillaumeGomez Jun 18, 2025
25eb2ee
move cfg(target_feature) computation into shared place
RalfJung May 10, 2025
63c9292
move -Ctarget-feature handling into shared code
RalfJung May 23, 2025
3a0881c
cg_gcc: properly populate cfg(target_features) with -Ctarget-features
RalfJung May 11, 2025
1aabebc
various minor target feature cleanups
RalfJung Jun 14, 2025
f8db66b
Remove dead instructions in terminate blocks
Mark-Simulacrum Jun 22, 2025
7014ca4
rustc_codegen_gcc: Fix clippy::manual_is_multiple_of
flip1995 Jun 27, 2025
a836612
Merge branch 'master' into sync_from_rust_2025_06_28
antoyo Jun 28, 2025
a80f3c4
Fix clippy warnings
antoyo Jun 28, 2025
38fa4a4
Fix sysroot Cargo.toml for compiler-builtins
antoyo Jun 28, 2025
e3bb127
Add support for copysignf16 intrinsic
antoyo Jun 28, 2025
fe8b5e6
Remove now useless patch for run-make test
antoyo Jun 28, 2025
99780df
Fix intrinsic copysignf128
antoyo Jun 29, 2025
769fb75
Fix exactudiv and exactsdiv for gcc without 128-bit integers
antoyo Jun 29, 2025
67d8469
Add support for a few missing LLVM intrinsics
antoyo Jun 29, 2025
88db589
Changed intrinsic generation to include full intrinsic names in panic…
FractalFir Jun 29, 2025
c57393e
Regenerated intrinsics
FractalFir Jun 29, 2025
4347a92
Fix handling of __builtin_ia32_rdtscp
antoyo Jun 29, 2025
15d23bd
Merge pull request #723 from rust-lang/sync_from_rust_2025_06_28
antoyo Jun 30, 2025
1926f60
Fix const_undef
antoyo Jun 30, 2025
ce73bab
Merge pull request #726 from rust-lang/fix/const_undef
antoyo Jun 30, 2025
4b5c44b
Merge pull request #725 from FractalFir/intrinsic_fix
antoyo Jun 30, 2025
666934a
Merge commit '4b5c44b14166083eef8d71f15f5ea1f53fc976a0' into subtree-…
GuillaumeGomez Jun 30, 2025
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
Prev Previous commit
Next Next commit
cg_gcc: properly populate cfg(target_features) with -Ctarget-features
  • Loading branch information
RalfJung committed Jun 19, 2025
commit 3a0881c11b8c5b47d03599d7f62a7b053cf173a0
39 changes: 17 additions & 22 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,9 @@ use rustc_codegen_ssa::back::write::{
CodegenContext, FatLtoInput, ModuleConfig, TargetMachineFactoryFn,
};
use rustc_codegen_ssa::base::codegen_crate;
use rustc_codegen_ssa::target_features::cfg_target_feature;
use rustc_codegen_ssa::traits::{CodegenBackend, ExtraBackendMethods, WriteBackendMethods};
use rustc_codegen_ssa::{
CodegenResults, CompiledModule, ModuleCodegen, TargetConfig, target_features,
};
use rustc_codegen_ssa::{CodegenResults, CompiledModule, ModuleCodegen, TargetConfig};
use rustc_data_structures::fx::FxIndexMap;
use rustc_data_structures::sync::IntoDynSyncSend;
use rustc_errors::DiagCtxtHandle;
Expand Down Expand Up @@ -478,25 +477,21 @@ fn to_gcc_opt_level(optlevel: Option<OptLevel>) -> OptimizationLevel {

/// Returns the features that should be set in `cfg(target_feature)`.
fn target_config(sess: &Session, target_info: &LockedTargetInfo) -> TargetConfig {
let (unstable_target_features, target_features) = target_features::cfg_target_feature(
sess,
/* FIXME: we ignore `-Ctarget-feature` */ "",
|feature| {
// TODO: we disable Neon for now since we don't support the LLVM intrinsics for it.
if feature == "neon" {
return false;
}
target_info.cpu_supports(feature)
// cSpell:disable
/*
adx, aes, avx, avx2, avx512bf16, avx512bitalg, avx512bw, avx512cd, avx512dq, avx512er, avx512f, avx512fp16, avx512ifma,
avx512pf, avx512vbmi, avx512vbmi2, avx512vl, avx512vnni, avx512vp2intersect, avx512vpopcntdq,
bmi1, bmi2, cmpxchg16b, ermsb, f16c, fma, fxsr, gfni, lzcnt, movbe, pclmulqdq, popcnt, rdrand, rdseed, rtm,
sha, sse, sse2, sse3, sse4.1, sse4.2, sse4a, ssse3, tbm, vaes, vpclmulqdq, xsave, xsavec, xsaveopt, xsaves
*/
// cSpell:enable
},
);
let (unstable_target_features, target_features) = cfg_target_feature(sess, |feature| {
// TODO: we disable Neon for now since we don't support the LLVM intrinsics for it.
if feature == "neon" {
return false;
}
target_info.cpu_supports(feature)
// cSpell:disable
/*
adx, aes, avx, avx2, avx512bf16, avx512bitalg, avx512bw, avx512cd, avx512dq, avx512er, avx512f, avx512fp16, avx512ifma,
avx512pf, avx512vbmi, avx512vbmi2, avx512vl, avx512vnni, avx512vp2intersect, avx512vpopcntdq,
bmi1, bmi2, cmpxchg16b, ermsb, f16c, fma, fxsr, gfni, lzcnt, movbe, pclmulqdq, popcnt, rdrand, rdseed, rtm,
sha, sse, sse2, sse3, sse4.1, sse4.2, sse4a, ssse3, tbm, vaes, vpclmulqdq, xsave, xsavec, xsaveopt, xsaves
*/
// cSpell:enable
});

let has_reliable_f16 = target_info.supports_target_dependent_type(CType::Float16);
let has_reliable_f128 = target_info.supports_target_dependent_type(CType::Float128);
Expand Down