diff --git a/llvm/lib/Target/AArch64/MCTargetDesc/AArch64MCTargetDesc.cpp b/llvm/lib/Target/AArch64/MCTargetDesc/AArch64MCTargetDesc.cpp index 7ecc3a58c841d..d216bd7f3ffed 100644 --- a/llvm/lib/Target/AArch64/MCTargetDesc/AArch64MCTargetDesc.cpp +++ b/llvm/lib/Target/AArch64/MCTargetDesc/AArch64MCTargetDesc.cpp @@ -57,16 +57,7 @@ createAArch64MCSubtargetInfo(const Triple &TT, StringRef CPU, StringRef FS) { CPU = "apple-a12"; } - // Most of the NEON instruction set isn't supported in streaming mode on SME - // targets, disable NEON unless explicitly requested. - bool RequestedNEON = FS.contains("neon"); - bool RequestedStreamingSVE = FS.contains("streaming-sve"); - MCSubtargetInfo *STI = - createAArch64MCSubtargetInfoImpl(TT, CPU, /*TuneCPU*/ CPU, FS); - if (RequestedStreamingSVE && !RequestedNEON && - STI->hasFeature(AArch64::FeatureNEON)) - STI->ToggleFeature(AArch64::FeatureNEON); - return STI; + return createAArch64MCSubtargetInfoImpl(TT, CPU, /*TuneCPU*/ CPU, FS); } void AArch64_MC::initLLVMToCVRegMapping(MCRegisterInfo *MRI) { diff --git a/llvm/test/MC/AArch64/SME/streaming-mode-neon-bf16.s b/llvm/test/MC/AArch64/SME/streaming-mode-neon-bf16.s index d0733e1499657..6aa983ba1093c 100644 --- a/llvm/test/MC/AArch64/SME/streaming-mode-neon-bf16.s +++ b/llvm/test/MC/AArch64/SME/streaming-mode-neon-bf16.s @@ -1,16 +1,18 @@ -// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+streaming-sve,+bf16 < %s \ +// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=-neon,+sme < %s \ +// RUN: | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST +// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=-neon,+streaming-sve,+bf16 < %s \ // RUN: | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST // RUN: not llvm-mc -triple=aarch64 -show-encoding -mattr=-neon < %s 2>&1 \ // RUN: | FileCheck %s --check-prefix=CHECK-ERROR -// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+streaming-sve,+bf16 < %s \ +// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=-neon,+streaming-sve,+bf16 < %s \ // RUN: | llvm-objdump --mattr=+bf16 -d - | FileCheck %s --check-prefix=CHECK-INST // Disassemble encoding and check the re-encoding (-show-encoding) matches. -// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+streaming-sve,+bf16 < %s \ +// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=-neon,+streaming-sve,+bf16 < %s \ // RUN: | sed '/.text/d' | sed 's/.*encoding: //g' \ -// RUN: | llvm-mc -triple=aarch64 -mattr=+streaming-sve,+bf16 -disassemble -show-encoding \ +// RUN: | llvm-mc -triple=aarch64 -mattr=-neon,+streaming-sve,+bf16 -disassemble -show-encoding \ // RUN: | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST bfcvt h5, s3 // CHECK-INST: bfcvt h5, s3 // CHECK-ENCODING: [0x65,0x40,0x63,0x1e] -// CHECK-ERROR: instruction requires: bf16 +// CHECK-ERROR: instruction requires: bf16 neon or sme diff --git a/llvm/test/MC/AArch64/SME/streaming-mode-neon-negative.s b/llvm/test/MC/AArch64/SME/streaming-mode-neon-negative.s index 03b35123e5867..512906e8a669a 100644 --- a/llvm/test/MC/AArch64/SME/streaming-mode-neon-negative.s +++ b/llvm/test/MC/AArch64/SME/streaming-mode-neon-negative.s @@ -1,4 +1,4 @@ -// RUN: not llvm-mc -triple=aarch64 -show-encoding -mattr=+streaming-sve,+bf16 2>&1 < %s| FileCheck %s +// RUN: not llvm-mc -triple=aarch64 -show-encoding -mattr=-neon,+sme 2>&1 < %s| FileCheck %s // ------------------------------------------------------------------------- // // Check FABD is illegal in streaming mode diff --git a/llvm/test/MC/AArch64/SME/streaming-mode-neon.s b/llvm/test/MC/AArch64/SME/streaming-mode-neon.s index 88f5cedbb06d4..b744b49766351 100644 --- a/llvm/test/MC/AArch64/SME/streaming-mode-neon.s +++ b/llvm/test/MC/AArch64/SME/streaming-mode-neon.s @@ -1,13 +1,15 @@ -// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+streaming-sve < %s \ +// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=-neon,+sme < %s \ +// RUN: | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST +// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=-neon,+streaming-sve < %s \ // RUN: | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST // RUN: not llvm-mc -triple=aarch64 -show-encoding -mattr=-neon < %s 2>&1 \ // RUN: | FileCheck %s --check-prefix=CHECK-ERROR -// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+streaming-sve < %s \ +// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=-neon,+streaming-sve < %s \ // RUN: | llvm-objdump -d - | FileCheck %s --check-prefix=CHECK-INST // Disassemble encoding and check the re-encoding (-show-encoding) matches. -// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+streaming-sve < %s \ +// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=-neon,+streaming-sve < %s \ // RUN: | sed '/.text/d' | sed 's/.*encoding: //g' \ -// RUN: | llvm-mc -triple=aarch64 -mattr=+streaming-sve -disassemble -show-encoding \ +// RUN: | llvm-mc -triple=aarch64 -mattr=-neon,+streaming-sve -disassemble -show-encoding \ // RUN: | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST // Scalar FP instructions diff --git a/llvm/test/MC/AArch64/SME/streaming-sve-feature.s b/llvm/test/MC/AArch64/SME/streaming-sve-feature.s index e35505ca39c58..90b1b6bd64ad6 100644 --- a/llvm/test/MC/AArch64/SME/streaming-sve-feature.s +++ b/llvm/test/MC/AArch64/SME/streaming-sve-feature.s @@ -1,5 +1,5 @@ -// RUN: llvm-mc -triple=aarch64 -mattr=+streaming-sve,+neon < %s 2>&1 | FileCheck %s -// RUN: not llvm-mc -triple=aarch64 -mattr=+streaming-sve < %s 2>&1 | FileCheck %s --check-prefix=CHECK-ERROR +// RUN: llvm-mc -triple=aarch64 -mattr=+sme < %s 2>&1 | FileCheck %s +// RUN: not llvm-mc -triple=aarch64 -mattr=-neon,+sme < %s 2>&1 | FileCheck %s --check-prefix=CHECK-ERROR // Verify NEON is disabled when targeting streaming mode, if it's not // explicitly requested.