Rollup merge of #105026 - oToToT:aarch64-v8a, r=davidtwco

v8a as default aarch64 target

After https://github.com/llvm/llvm-project/commit/8689f5e landed, LLVM takes the intersection of v8a and v8r as default. This commit brings back v8a support by explicitly specifying v8a in the feature list.

This should solve #97724.

p.s. a bit more context can also be found in https://github.com/llvm/llvm-project/issues/57904#issuecomment-1329555590.
This commit is contained in:
Matthias Krüger 2022-12-02 21:22:47 +01:00 committed by GitHub
commit dab14348e9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 42 additions and 0 deletions

View File

@ -494,6 +494,11 @@ pub(crate) fn global_llvm_features(sess: &Session, diagnostics: bool) -> Vec<Str
.flatten(); .flatten();
features.extend(feats); features.extend(feats);
// FIXME: Move v8a to target definition list when earliest supported LLVM is 14.
if get_version() >= (14, 0, 0) && sess.target.arch == "aarch64" {
features.push("+v8a".into());
}
if diagnostics && let Some(f) = check_tied_features(sess, &featsmap) { if diagnostics && let Some(f) = check_tied_features(sess, &featsmap) {
sess.emit_err(TargetFeatureDisableOrEnable { sess.emit_err(TargetFeatureDisableOrEnable {
features: f, features: f,

View File

@ -0,0 +1,37 @@
// assembly-output: emit-asm
// compile-flags: --target aarch64-unknown-linux-gnu
// needs-llvm-components: aarch64
#![feature(no_core, lang_items, rustc_attrs)]
#![crate_type = "rlib"]
#![no_core]
#[rustc_builtin_macro]
macro_rules! asm {
() => {};
}
#[lang = "sized"]
trait Sized {}
// CHECK-LABEL: ttbr0_el2:
#[no_mangle]
pub fn ttbr0_el2() {
// CHECK: //APP
// CHECK-NEXT: msr TTBR0_EL2, x0
// CHECK-NEXT: //NO_APP
unsafe {
asm!("msr ttbr0_el2, x0");
}
}
// CHECK-LABEL: vttbr_el2:
#[no_mangle]
pub fn vttbr_el2() {
// CHECK: //APP
// CHECK-NEXT: msr VTTBR_EL2, x0
// CHECK-NEXT: //NO_APP
unsafe {
asm!("msr vttbr_el2, x0");
}
}