Commit Graph

8 Commits

Author SHA1 Message Date
Mara Bos c7e9029b80
Rollup merge of #78361 - DevJPM:master, r=workingjubilee
Updated the list of white-listed target features for x86

This PR both adds in-source documentation on what to look out for when adding a new (X86) feature set and [adds all that are detectable at run-time in Rust stable as of 1.27.0](https://github.com/rust-lang/stdarch/blob/master/crates/std_detect/src/detect/arch/x86.rs).

This should only enable the use of the corresponding LLVM intrinsics.
Actual intrinsics need to be added separately in rust-lang/stdarch.

It also re-orders the run-time-detect test statements to be more consistent
with the actual list of intrinsics whitelisted and removes underscores not present
in the actual names (which might be mistaken as being part of the name)

The reference for LLVM's feature names used is [this file](https://github.com/llvm/llvm-project/blob/master/llvm/include/llvm/Support/X86TargetParser.def).

This PR was motivated as the compiler end's part for allowing #67329 to be adressed over on rust-lang/stdarch
2020-11-18 15:46:19 +01:00
DevJPM 72b83af2ff Re-enable LLVM 9 target features with LLVM 9 being the minimum now
With #78848 merged, the minimum supported LLVM version is now 9
which means we can actually use the target features introduced in LLVM 9
2020-11-15 11:34:08 +01:00
Joe Richey ad552bc17e
Add compiler support for LLVM's x86 ERMSB feature
This change is needed for compiler-builtins to check for this feature
when implementing memcpy/memset. See:
  https://github.com/rust-lang/compiler-builtins/pull/365

The change just does compile-time detection. I think that runtime
detection will have to come in a follow-up CL to std-detect.

Like all the CPU feature flags, this just references #44839

Signed-off-by: Joe Richey <joerichey@google.com>
2020-10-26 03:46:54 -07:00
DevJPM 3daa93f555 Updated documentation, x86 feature detection testing, and removed LLVM 9 exclusive features
Updated the added documentation in llvm_util.rs to note which copies of LLVM need to be inspected.
Removed avx512bf16 and avx512vp2intersect because they are unsupported before LLVM 9 with the build with external LLVM 8 being supported
Re-introduced detection testing previously removed for un-requestable features tsc and mmx
2020-10-26 08:36:14 +01:00
DevJPM 9feb567399 Updated the list of white-listed target features for x86
This PR both adds in-source documentation on what to look out for
when adding a new (X86) feature set and adds all that are detectable at run-time in Rust stable
as of 1.27.0.

This should only enable the use of the corresponding LLVM intrinsics.
Actual intrinsics need to be added separately in rust-lang/stdarch.

It also re-orders the run-time-detect test statements to be more consistent
with the actual list of intrinsics whitelisted and removes underscores not present
in the actual names (which might be mistaken as being part of the name)
2020-10-25 17:06:40 +01:00
est31 4fa5578774 Replace target.target with target and target.ptr_width with target.pointer_width
Preparation for a subsequent change that replaces
rustc_target::config::Config with its wrapped Target.

On its own, this commit breaks the build. I don't like making
build-breaking commits, but in this instance I believe that it
makes review easier, as the "real" changes of this PR can be
seen much more easily.

Result of running:

find compiler/ -type f -exec sed -i -e 's/target\.target\([)\.,; ]\)/target\1/g' {} \;
find compiler/ -type f -exec sed -i -e 's/target\.target$/target/g' {} \;
find compiler/ -type f -exec sed -i -e 's/target.ptr_width/target.pointer_width/g' {} \;
./x.py fmt
2020-10-15 12:02:24 +02:00
bjorn3 46f2f023b0 Move supported_target_features query provider to cg_ssa 2020-10-09 19:35:17 +02:00
bjorn3 17d1cbbbe0 Move target feature whitelist from cg_llvm to cg_ssa
These target features have to be supported or at least emulated by
alternative codegen backends anyway as they are used by common crates.
By moving this list to cg_ssa, other codegen backends don't have to copy
this code.
2020-10-04 11:49:00 +02:00