about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2022-11-16 15:39:44 +0100
committerGitHub <noreply@github.com>2022-11-16 15:39:44 +0100
commit56a28a65f54b846abc93945a58a5e3b93b109dc6 (patch)
tree70f0c8fb0289513c3342f95d2f681cb888f59735 /compiler/rustc_codegen_llvm/src
parent63c748ee23ab7b6706655146f5b7c7f579811803 (diff)
parent11224000e8e9468b3c2a7999aa7566d361d81a4c (diff)
downloadrust-56a28a65f54b846abc93945a58a5e3b93b109dc6.tar.gz
rust-56a28a65f54b846abc93945a58a5e3b93b109dc6.zip
Rollup merge of #103750 - calebzulawski:master, r=workingjubilee
Fix some misleading target feature aliases

This is the first half of a fix for #100752.  It looks like these aliases were added in #78361 and slipped under the radar, as these features are not AVX512.  These features _do_ add AVX512 instructions when used _in combination_ with AVX512F, but without AVX512F, these features still provide 128-bit and 256-bit vector instructions.  A user might be mislead into thinking these features imply AVX512F (which is true of the actual AVX512 features).  This PR allows using the names as defined by LLVM, which matches Intel documentation.

A future PR should change the `std::arch` intrinsics to use these names, and finally remove these aliases from rustc.

r? ```@workingjubilee```

cc ```@Amanieu```
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
-rw-r--r--compiler/rustc_codegen_llvm/src/llvm_util.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/compiler/rustc_codegen_llvm/src/llvm_util.rs b/compiler/rustc_codegen_llvm/src/llvm_util.rs
index e1f54356228..4af1aaec0a1 100644
--- a/compiler/rustc_codegen_llvm/src/llvm_util.rs
+++ b/compiler/rustc_codegen_llvm/src/llvm_util.rs
@@ -163,6 +163,9 @@ pub fn to_llvm_features<'a>(sess: &Session, s: &'a str) -> SmallVec<[&'a str; 2]
         ("x86", "rdrand") => smallvec!["rdrnd"],
         ("x86", "bmi1") => smallvec!["bmi"],
         ("x86", "cmpxchg16b") => smallvec!["cx16"],
+        // FIXME: These aliases are misleading, and should be removed before avx512_target_feature is
+        // stabilized. They must remain until std::arch switches off them.
+        // rust#100752
         ("x86", "avx512vaes") => smallvec!["vaes"],
         ("x86", "avx512gfni") => smallvec!["gfni"],
         ("x86", "avx512vpclmulqdq") => smallvec!["vpclmulqdq"],