[PATCH] D107902: [AArch64][SME] Disable NEON in streaming mode
Cullen Rhodes via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Aug 13 04:50:13 PDT 2021
c-rhodes updated this revision to Diff 366240.
c-rhodes retitled this revision from "[AArch64][SME] Disable NEON on generic CPU for streaming mode" to "[AArch64][SME] Disable NEON in streaming mode".
c-rhodes edited the summary of this revision.
c-rhodes added a comment.
Disable NEON when compiling with `+streaming-sve` regardless of CPU.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D107902/new/
https://reviews.llvm.org/D107902
Files:
llvm/lib/Target/AArch64/MCTargetDesc/AArch64MCTargetDesc.cpp
llvm/test/MC/AArch64/SME/streaming-sve-feature.s
Index: llvm/test/MC/AArch64/SME/streaming-sve-feature.s
===================================================================
--- /dev/null
+++ llvm/test/MC/AArch64/SME/streaming-sve-feature.s
@@ -0,0 +1,8 @@
+// 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
+
+// Verify NEON is disabled when targeting streaming mode, if it's not
+// explicitly requested.
+add v0.8b, v1.8b, v2.8b
+// CHECK: add v0.8b, v1.8b, v2.8b
+// CHECK-ERROR: error: instruction requires: neon
Index: llvm/lib/Target/AArch64/MCTargetDesc/AArch64MCTargetDesc.cpp
===================================================================
--- llvm/lib/Target/AArch64/MCTargetDesc/AArch64MCTargetDesc.cpp
+++ llvm/lib/Target/AArch64/MCTargetDesc/AArch64MCTargetDesc.cpp
@@ -57,7 +57,16 @@
CPU = "apple-a12";
}
- return createAArch64MCSubtargetInfoImpl(TT, CPU, /*TuneCPU*/ CPU, FS);
+ // 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;
}
void AArch64_MC::initLLVMToCVRegMapping(MCRegisterInfo *MRI) {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D107902.366240.patch
Type: text/x-patch
Size: 1574 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210813/3315d417/attachment.bin>
More information about the llvm-commits
mailing list