Skip to content

Commit 5e370a2

Browse files
committed
use an aarch64 target feature that apple does not enable by default
1 parent 9fc1242 commit 5e370a2

File tree

2 files changed

+15
-11
lines changed

2 files changed

+15
-11
lines changed

tests/assembly/naked-fn-aarch64-global-target-feature.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//@ add-core-stubs
22
//@ assembly-output: emit-asm
3-
//@ compile-flags: --target aarch64-unknown-linux-gnu -Ctarget-feature=+lse
4-
//@ needs-llvm-components: aarch64
3+
//@ only-aarch64
4+
//@ compile-flags: -Ctarget-feature=+lse
55

66
#![crate_type = "lib"]
77
#![feature(no_core, naked_functions)]

tests/assembly/naked-fn-target-feature.rs

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -59,18 +59,22 @@ unsafe extern "C" fn vpclmulqdq() {
5959
naked_asm!("vpclmulqdq zmm1, zmm2, zmm3, 4")
6060
}
6161

62-
// aarch64-elf-LABEL: aes:
63-
// aarch64-elf: aese
64-
// aarch64-macho-LABEL: aes:
65-
// aarch64-macho: aese
66-
// aarch64-coff-LABEL: aes:
67-
// aarch64-coff: aese
62+
// i8mm is not enabled by default
63+
//
64+
// note that aarch64-apple-darwin enables more features than aarch64-unknown-linux-gnu
65+
//
66+
// aarch64-elf-LABEL: i8mm:
67+
// aarch64-elf: usdot
68+
// aarch64-macho-LABEL: i8mm:
69+
// aarch64-macho: usdot
70+
// aarch64-coff-LABEL: i8mm:
71+
// aarch64-coff: usdot
6872
#[no_mangle]
6973
#[naked]
7074
#[cfg(target_arch = "aarch64")]
71-
#[target_feature(enable = "aes")]
72-
unsafe extern "C" fn aes() {
73-
naked_asm!("aese.16b v0, v1")
75+
#[target_feature(enable = "i8mm")]
76+
unsafe extern "C" fn i8mm() {
77+
naked_asm!("usdot v0.4s, v1.16b, v2.4b[3]")
7478
}
7579

7680
// riscv64: sh1add:

0 commit comments

Comments
 (0)