rust/compiler/rustc_codegen_ssa/src
bors 327c7ee436 Auto merge of #133099 - RalfJung:forbidden-hardfloat-features, r=workingjubilee
forbid toggling x87 and fpregs on hard-float targets

Part of https://github.com/rust-lang/rust/issues/116344, follow-up to https://github.com/rust-lang/rust/pull/129884:

The `x87`  target feature on x86 and the `fpregs` target feature on ARM must not be disabled on a hardfloat target, as that would change the float ABI. However, *enabling* `fpregs` on ARM is [explicitly requested](https://github.com/rust-lang/rust/issues/130988) as it seems to be useful. Therefore, we need to refine the distinction of "forbidden" target features and "allowed" target features: all (un)stable target features can determine on a per-target basis whether they should be allowed to be toggled or not. `fpregs` then checks whether the current target has the `soft-float` feature, and if yes, `fpregs` is permitted -- otherwise, it is not. (Same for `x87` on x86).

Also fixes https://github.com/rust-lang/rust/issues/132351. Since `fpregs` and `x87` can be enabled on some builds and disabled on others, it would make sense that one can query it via `cfg`. Therefore, I made them behave in `cfg` like any other unstable target feature.

The first commit prepares the infrastructure, but does not change behavior. The second commit then wires up `fpregs` and `x87` with that new infrastructure.

r? `@workingjubilee`
2024-12-13 19:43:00 +00:00
..
back Auto merge of #129181 - beetrees:asm-spans, r=pnkfelix,compiler-errors 2024-12-12 02:34:06 +00:00
debuginfo Remove polymorphization 2024-12-06 16:42:09 -05:00
mir emit .weak_definition instead of .weak on macos 2024-12-10 21:41:05 +01:00
traits Auto merge of #133099 - RalfJung:forbidden-hardfloat-features, r=workingjubilee 2024-12-13 19:43:00 +00:00
assert_module_sources.rs Reformat use declarations. 2024-07-29 08:26:52 +10:00
base.rs additional TypingEnv cleanups 2024-11-19 21:36:23 +01:00
codegen_attrs.rs Auto merge of #128004 - folkertdev:naked-fn-asm, r=Amanieu 2024-12-11 21:51:07 +00:00
common.rs Test fixing raw-dylib 2024-09-24 10:10:31 -07:00
errors.rs fix: rust-lang/rust#47446 2024-11-15 15:25:19 +01:00
lib.rs Emit diagnostics for incorrect deployment targets 2024-11-01 17:07:19 +01:00
meth.rs compiler: Directly use rustc_abi in codegen 2024-11-03 12:30:32 -08:00
mono_item.rs codegen #[naked] functions using global_asm! 2024-12-10 21:41:03 +01:00
size_of_val.rs compiler: Directly use rustc_abi in codegen 2024-11-03 12:30:32 -08:00
target_features.rs apply review feedback 2024-12-11 22:18:51 +01:00