-
-
Notifications
You must be signed in to change notification settings - Fork 14.3k
Use rust rather than LLVM target features in the target spec #149173
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
Conversation
|
Some changes occurred in compiler/rustc_codegen_gcc These commits modify compiler targets. |
|
r? @chenyukang rustbot has assigned @chenyukang. Use |
|
I haven't looked at the code yet, but I like the general direction! The doc comment for https://doc.rust-lang.org/nightly/nightly-rustc/rustc_target/spec/struct.TargetOptions.html#structfield.features should also be updated. |
This comment has been minimized.
This comment has been minimized.
|
haven't touched this part, so @rustbot reroll |
|
@rustbot reroll |
|
r? @RalfJung |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another nice step towards pushing LLVM target features out of the core of the compiler. :)
|
Thanks, LGTM! r=me after squashing the history so we don't have "fix" commits. |
This works better with non-LLVM codegen backends.
658763b to
fedbccd
Compare
|
@bors r=RalfJung |
…r=RalfJung Use rust rather than LLVM target features in the target spec This works better with non-LLVM codegen backends.
Rollup of 9 pull requests Successful merges: - #147936 (Offload intrinsic) - #148358 (Fix some issues around `rustc_public`) - #148452 (Mangle symbols with a mangled name close to PDB limits with v0 instead of legacy mangling to avoid linker errors) - #148751 (Build gnullvm toolchains on Windows natively) - #148951 (rustc_target: aarch64: Remove deprecated FEAT_TME) - #149173 (Use rust rather than LLVM target features in the target spec) - #149307 (Deny const auto traits) - #149312 (Mark riscv64gc-unknown-linux-musl as tier 2 target) - #149341 (Add `Copy` to some AST enums.) r? `@ghost` `@rustbot` modify labels: rollup
Rollup of 12 pull requests Successful merges: - #147936 (Offload intrinsic) - #148358 (Fix some issues around `rustc_public`) - #148452 (Mangle symbols with a mangled name close to PDB limits with v0 instead of legacy mangling to avoid linker errors) - #148751 (Build gnullvm toolchains on Windows natively) - #148951 (rustc_target: aarch64: Remove deprecated FEAT_TME) - #149149 ([rustdoc] misc search index cleanups) - #149173 (Use rust rather than LLVM target features in the target spec) - #149307 (Deny const auto traits) - #149312 (Mark riscv64gc-unknown-linux-musl as tier 2 target) - #149317 (Handle inline asm in has_ffi_unwind_calls) - #149326 (Remove unused `Clone` derive on `DelayedLint`) - #149341 (Add `Copy` to some AST enums.) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of #149173 - bjorn3:target_spec_rust_features, r=RalfJung Use rust rather than LLVM target features in the target spec This works better with non-LLVM codegen backends.
Rollup of 12 pull requests Successful merges: - rust-lang/rust#147936 (Offload intrinsic) - rust-lang/rust#148358 (Fix some issues around `rustc_public`) - rust-lang/rust#148452 (Mangle symbols with a mangled name close to PDB limits with v0 instead of legacy mangling to avoid linker errors) - rust-lang/rust#148751 (Build gnullvm toolchains on Windows natively) - rust-lang/rust#148951 (rustc_target: aarch64: Remove deprecated FEAT_TME) - rust-lang/rust#149149 ([rustdoc] misc search index cleanups) - rust-lang/rust#149173 (Use rust rather than LLVM target features in the target spec) - rust-lang/rust#149307 (Deny const auto traits) - rust-lang/rust#149312 (Mark riscv64gc-unknown-linux-musl as tier 2 target) - rust-lang/rust#149317 (Handle inline asm in has_ffi_unwind_calls) - rust-lang/rust#149326 (Remove unused `Clone` derive on `DelayedLint`) - rust-lang/rust#149341 (Add `Copy` to some AST enums.) r? `@ghost` `@rustbot` modify labels: rollup
Rollup of 12 pull requests Successful merges: - rust-lang/rust#147936 (Offload intrinsic) - rust-lang/rust#148358 (Fix some issues around `rustc_public`) - rust-lang/rust#148452 (Mangle symbols with a mangled name close to PDB limits with v0 instead of legacy mangling to avoid linker errors) - rust-lang/rust#148751 (Build gnullvm toolchains on Windows natively) - rust-lang/rust#148951 (rustc_target: aarch64: Remove deprecated FEAT_TME) - rust-lang/rust#149149 ([rustdoc] misc search index cleanups) - rust-lang/rust#149173 (Use rust rather than LLVM target features in the target spec) - rust-lang/rust#149307 (Deny const auto traits) - rust-lang/rust#149312 (Mark riscv64gc-unknown-linux-musl as tier 2 target) - rust-lang/rust#149317 (Handle inline asm in has_ffi_unwind_calls) - rust-lang/rust#149326 (Remove unused `Clone` derive on `DelayedLint`) - rust-lang/rust#149341 (Add `Copy` to some AST enums.) r? `@ghost` `@rustbot` modify labels: rollup
…r=RalfJung Use rust rather than LLVM target features in the target spec This works better with non-LLVM codegen backends.
Rollup of 12 pull requests Successful merges: - rust-lang#147936 (Offload intrinsic) - rust-lang#148358 (Fix some issues around `rustc_public`) - rust-lang#148452 (Mangle symbols with a mangled name close to PDB limits with v0 instead of legacy mangling to avoid linker errors) - rust-lang#148751 (Build gnullvm toolchains on Windows natively) - rust-lang#148951 (rustc_target: aarch64: Remove deprecated FEAT_TME) - rust-lang#149149 ([rustdoc] misc search index cleanups) - rust-lang#149173 (Use rust rather than LLVM target features in the target spec) - rust-lang#149307 (Deny const auto traits) - rust-lang#149312 (Mark riscv64gc-unknown-linux-musl as tier 2 target) - rust-lang#149317 (Handle inline asm in has_ffi_unwind_calls) - rust-lang#149326 (Remove unused `Clone` derive on `DelayedLint`) - rust-lang#149341 (Add `Copy` to some AST enums.) r? `@ghost` `@rustbot` modify labels: rollup
Rollup of 12 pull requests Successful merges: - rust-lang/rust#147936 (Offload intrinsic) - rust-lang/rust#148358 (Fix some issues around `rustc_public`) - rust-lang/rust#148452 (Mangle symbols with a mangled name close to PDB limits with v0 instead of legacy mangling to avoid linker errors) - rust-lang/rust#148751 (Build gnullvm toolchains on Windows natively) - rust-lang/rust#148951 (rustc_target: aarch64: Remove deprecated FEAT_TME) - rust-lang/rust#149149 ([rustdoc] misc search index cleanups) - rust-lang/rust#149173 (Use rust rather than LLVM target features in the target spec) - rust-lang/rust#149307 (Deny const auto traits) - rust-lang/rust#149312 (Mark riscv64gc-unknown-linux-musl as tier 2 target) - rust-lang/rust#149317 (Handle inline asm in has_ffi_unwind_calls) - rust-lang/rust#149326 (Remove unused `Clone` derive on `DelayedLint`) - rust-lang/rust#149341 (Add `Copy` to some AST enums.) r? `@ghost` `@rustbot` modify labels: rollup
…-fix, r=Amanieu Fix d32 usage in Arm target specs Fixes rust-lang#149399 - after checking with an LLVM engineer Rust's feature implications do correctly map to LLVM's. The target specs originally had +vfp3,+d16, but were mistakenly fixed to +vfp3,-d32 which disables vfp3 again. Some targets specify +vfp2,-d32, and since vfp2 shouldn't imply d32 the -d32 is unneeded. The list of Arm features is quite old and since Arm is now a target maintainer of many of them we'll go in and update them. We should probably add vfp3d16 and similar as rust has no way to express these right now after d16 was removed. The LLVM features expand like this: ``` vfp4 -> vfp3 + fp16 + vfp4d16 + vfp4sp vfp4d16 -> vfp3d16 + fp16 + fp64 + vfp4d16sp vfp4sp -> vfp3sp + fp16 + d32 + vfp4d16sp vfp4d16sp -> vfp3d16sp + fp16 vfp3 -> vfp2 + vfp3d16 + vfp3sp vfp3d16 -> vfp2 + fp64 + vfp3d16sp vfp3sp -> vfp2 + d32 + vfp3d16sp vfp3d16sp -> vfp2sp vfp2 -> vfp2sp + fp64 vfp2sp -> fpregs ``` `-neon` might be unnecessary too in many of these cases, but some default CPUs that Rust specifies will turn Neon on so that needs a bit more care. I can't see any LLVM cpus that enable D32. Old description: > Fixes rust-lang#149399 - this implication was likely a mistake and isn't enforced by LLVM. This is is a breaking change and any users specifying `vfp2/3/4` via `-Ctarget-features` or the `target_feature` attribute will need to add `d32` in to get the same behaviour. The target features are unstable so this is ok for Rust, and this is necessary as otherwise there's no way to specify a `vfp2-d16` configuration, for example. > > I expect these targets would have been broken by rust-lang#149173 as `-d32` would have disabled any `+vfpX` feature before it. With the removal of the implication the `-d32` went back to being unnecessary, but I've removed it anyway. > > As `@RalfJung` pointed out, thumbv7a-nuttx-eabihf looks to have been relying on this implication so I've added `+d32` to it's target spec.
…-fix, r=Amanieu Fix d32 usage in Arm target specs Fixes rust-lang#149399 - after checking with an LLVM engineer Rust's feature implications do correctly map to LLVM's. The target specs originally had +vfp3,+d16, but were mistakenly fixed to +vfp3,-d32 which disables vfp3 again. Some targets specify +vfp2,-d32, and since vfp2 shouldn't imply d32 the -d32 is unneeded. The list of Arm features is quite old and since Arm is now a target maintainer of many of them we'll go in and update them. We should probably add vfp3d16 and similar as rust has no way to express these right now after d16 was removed. The LLVM features expand like this: ``` vfp4 -> vfp3 + fp16 + vfp4d16 + vfp4sp vfp4d16 -> vfp3d16 + fp16 + fp64 + vfp4d16sp vfp4sp -> vfp3sp + fp16 + d32 + vfp4d16sp vfp4d16sp -> vfp3d16sp + fp16 vfp3 -> vfp2 + vfp3d16 + vfp3sp vfp3d16 -> vfp2 + fp64 + vfp3d16sp vfp3sp -> vfp2 + d32 + vfp3d16sp vfp3d16sp -> vfp2sp vfp2 -> vfp2sp + fp64 vfp2sp -> fpregs ``` `-neon` might be unnecessary too in many of these cases, but some default CPUs that Rust specifies will turn Neon on so that needs a bit more care. I can't see any LLVM cpus that enable D32. Old description: > Fixes rust-lang#149399 - this implication was likely a mistake and isn't enforced by LLVM. This is is a breaking change and any users specifying `vfp2/3/4` via `-Ctarget-features` or the `target_feature` attribute will need to add `d32` in to get the same behaviour. The target features are unstable so this is ok for Rust, and this is necessary as otherwise there's no way to specify a `vfp2-d16` configuration, for example. > > I expect these targets would have been broken by rust-lang#149173 as `-d32` would have disabled any `+vfpX` feature before it. With the removal of the implication the `-d32` went back to being unnecessary, but I've removed it anyway. > > As ``@RalfJung`` pointed out, thumbv7a-nuttx-eabihf looks to have been relying on this implication so I've added `+d32` to it's target spec.
This works better with non-LLVM codegen backends.