Skip to content

Commit 3996139

Browse files
committed
Tie fp and neon
1 parent ba14a83 commit 3996139

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

compiler/rustc_codegen_llvm/src/llvm_util.rs

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -188,8 +188,6 @@ pub fn to_llvm_features<'a>(sess: &Session, s: &'a str) -> SmallVec<[&'a str; 2]
188188
("x86", "avx512gfni") => smallvec!["gfni"],
189189
("x86", "avx512vpclmulqdq") => smallvec!["vpclmulqdq"],
190190
("aarch64", "fp") => smallvec!["fp-armv8"],
191-
("aarch64", "fp16") => smallvec!["fullfp16"],
192-
("aarch64", "fhm") => smallvec!["fp16fml"],
193191
("aarch64", "rcpc2") => smallvec!["rcpc-immo"],
194192
("aarch64", "dpb") => smallvec!["ccpp"],
195193
("aarch64", "dpb2") => smallvec!["ccdp"],
@@ -198,6 +196,19 @@ pub fn to_llvm_features<'a>(sess: &Session, s: &'a str) -> SmallVec<[&'a str; 2]
198196
("aarch64", "pmuv3") => smallvec!["perfmon"],
199197
("aarch64", "paca") => smallvec!["pauth"],
200198
("aarch64", "pacg") => smallvec!["pauth"],
199+
// Rust ties fp and neon together. In LLVM neon implicitly enables fp,
200+
// but we manually enable neon when a feature only implicitly enables fp
201+
("aarch64", "f32mm") => smallvec!["f32mm", "neon"],
202+
("aarch64", "f64mm") => smallvec!["f64mm", "neon"],
203+
("aarch64", "fhm") => smallvec!["fp16fml", "neon"],
204+
("aarch64", "fp16") => smallvec!["fullfp16", "neon"],
205+
("aarch64", "jsconv") => smallvec!["jsconv", "neon"],
206+
("aarch64", "sve") => smallvec!["sve", "neon"],
207+
("aarch64", "sve2") => smallvec!["sve2", "neon"],
208+
("aarch64", "sve2-aes") => smallvec!["sve2-aes", "neon"],
209+
("aarch64", "sve2-sm4") => smallvec!["sve2-sm4", "neon"],
210+
("aarch64", "sve2-sha3") => smallvec!["sve2-sha3", "neon"],
211+
("aarch64", "sve2-bitperm") => smallvec!["sve2-bitperm", "neon"],
201212
(_, s) => smallvec![s],
202213
}
203214
}
@@ -490,7 +501,7 @@ pub(crate) fn global_llvm_features(sess: &Session, diagnostics: bool) -> Vec<Str
490501
if RUSTC_SPECIFIC_FEATURES.contains(&feature) {
491502
return SmallVec::<[_; 2]>::new();
492503
}
493-
// ... otherwise though we run through `to_llvm_feature when
504+
// ... otherwise though we run through `to_llvm_features` when
494505
// passing requests down to LLVM. This means that all in-language
495506
// features also work on the command line instead of having two
496507
// different names when the LLVM name and the Rust name differ.

src/test/run-make-fulldeps/simd-ffi/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ define MK_TARGETS
4141
# now.
4242
$(1): simd.rs
4343
$$(RUSTC) --target=$(1) --emit=llvm-ir,asm simd.rs \
44-
-C target-feature='+neon,+sse2' -C extra-filename=-$(1)
44+
-C target-feature='+fp,+neon,+sse2' -C extra-filename=-$(1)
4545
endef
4646

4747
$(foreach targetxxx,$(TARGETS),$(eval $(call MK_TARGETS,$(targetxxx))))

0 commit comments

Comments
 (0)