Skip to content

Commit dab1434

Browse files
authored
Rollup merge of #105026 - oToToT:aarch64-v8a, r=davidtwco
v8a as default aarch64 target After llvm/llvm-project@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 llvm/llvm-project#57904 (comment).
2 parents e960b5e + 382dba5 commit dab1434

File tree

2 files changed

+42
-0
lines changed

2 files changed

+42
-0
lines changed

compiler/rustc_codegen_llvm/src/llvm_util.rs

+5
Original file line numberDiff line numberDiff line change
@@ -494,6 +494,11 @@ pub(crate) fn global_llvm_features(sess: &Session, diagnostics: bool) -> Vec<Str
494494
.flatten();
495495
features.extend(feats);
496496

497+
// FIXME: Move v8a to target definition list when earliest supported LLVM is 14.
498+
if get_version() >= (14, 0, 0) && sess.target.arch == "aarch64" {
499+
features.push("+v8a".into());
500+
}
501+
497502
if diagnostics && let Some(f) = check_tied_features(sess, &featsmap) {
498503
sess.emit_err(TargetFeatureDisableOrEnable {
499504
features: f,
+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
// assembly-output: emit-asm
2+
// compile-flags: --target aarch64-unknown-linux-gnu
3+
// needs-llvm-components: aarch64
4+
5+
#![feature(no_core, lang_items, rustc_attrs)]
6+
#![crate_type = "rlib"]
7+
#![no_core]
8+
9+
#[rustc_builtin_macro]
10+
macro_rules! asm {
11+
() => {};
12+
}
13+
14+
#[lang = "sized"]
15+
trait Sized {}
16+
17+
// CHECK-LABEL: ttbr0_el2:
18+
#[no_mangle]
19+
pub fn ttbr0_el2() {
20+
// CHECK: //APP
21+
// CHECK-NEXT: msr TTBR0_EL2, x0
22+
// CHECK-NEXT: //NO_APP
23+
unsafe {
24+
asm!("msr ttbr0_el2, x0");
25+
}
26+
}
27+
28+
// CHECK-LABEL: vttbr_el2:
29+
#[no_mangle]
30+
pub fn vttbr_el2() {
31+
// CHECK: //APP
32+
// CHECK-NEXT: msr VTTBR_EL2, x0
33+
// CHECK-NEXT: //NO_APP
34+
unsafe {
35+
asm!("msr vttbr_el2, x0");
36+
}
37+
}

0 commit comments

Comments
 (0)