[llvm] 008c755 - [AArch64][SME] Support .arch and .arch_extension assembler directives
Cullen Rhodes via llvm-commits
llvm-commits at lists.llvm.org
Wed Jul 21 01:40:56 PDT 2021
Author: Cullen Rhodes
Date: 2021-07-21T08:40:27Z
New Revision: 008c755d76c9deed356c0e9d34e377686ed08795
URL: https://github.com/llvm/llvm-project/commit/008c755d76c9deed356c0e9d34e377686ed08795
DIFF: https://github.com/llvm/llvm-project/commit/008c755d76c9deed356c0e9d34e377686ed08795.diff
LOG: [AArch64][SME] Support .arch and .arch_extension assembler directives
Reviewed By: david-arm
Differential Revision: https://reviews.llvm.org/D105566
Added:
llvm/test/MC/AArch64/SME/directives-negative.s
llvm/test/MC/AArch64/SME/directives.s
Modified:
llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp b/llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp
index 7067050b1947a..6dd1e4577eca0 100644
--- a/llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp
+++ b/llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp
@@ -3211,6 +3211,9 @@ static const struct Extension {
{"pauth", {AArch64::FeaturePAuth}},
{"flagm", {AArch64::FeatureFlagM}},
{"rme", {AArch64::FeatureRME}},
+ {"sme", {AArch64::FeatureSME}},
+ {"sme-f64", {AArch64::FeatureSMEF64}},
+ {"sme-i64", {AArch64::FeatureSMEI64}},
// FIXME: Unsupported extensions
{"lor", {}},
{"rdma", {}},
diff --git a/llvm/test/MC/AArch64/SME/directives-negative.s b/llvm/test/MC/AArch64/SME/directives-negative.s
new file mode 100644
index 0000000000000..8a6909d7b63d6
--- /dev/null
+++ b/llvm/test/MC/AArch64/SME/directives-negative.s
@@ -0,0 +1,37 @@
+// RUN: not llvm-mc -triple aarch64 -o - %s 2>&1 | FileCheck %s
+
+.arch_extension sme
+.arch_extension nosme
+smstart
+// CHECK: error: instruction requires: sme
+// CHECK-NEXT: smstart
+
+.arch_extension sme-f64
+.arch_extension nosme-f64
+fmopa za0.d, p0/m, p0/m, z0.d, z0.d
+// CHECK: error: instruction requires: sme-f64
+// CHECK-NEXT: fmopa za0.d, p0/m, p0/m, z0.d, z0.d
+
+.arch_extension sme-i64
+.arch_extension nosme-i64
+addha za0.d, p0/m, p0/m, z0.d
+// CHECK: error: instruction requires: sme-i64
+// CHECK-NEXT: addha za0.d, p0/m, p0/m, z0.d
+
+.arch armv8-a+sme
+.arch armv8-a+nosme
+smstart
+// CHECK: error: instruction requires: sme
+// CHECK-NEXT: smstart
+
+.arch armv8-a+sme-f64
+.arch armv8-a+nosme-f64
+fmopa za0.d, p0/m, p0/m, z0.d, z0.d
+// CHECK: error: instruction requires: sme-f64
+// CHECK-NEXT: fmopa za0.d, p0/m, p0/m, z0.d, z0.d
+
+.arch armv8-a+sme-i64
+.arch armv8-a+nosme-i64
+addha za0.d, p0/m, p0/m, z0.d
+// CHECK: error: instruction requires: sme-i64
+// CHECK-NEXT: addha za0.d, p0/m, p0/m, z0.d
diff --git a/llvm/test/MC/AArch64/SME/directives.s b/llvm/test/MC/AArch64/SME/directives.s
new file mode 100644
index 0000000000000..92a38adb7b3d4
--- /dev/null
+++ b/llvm/test/MC/AArch64/SME/directives.s
@@ -0,0 +1,35 @@
+// RUN: llvm-mc -triple aarch64 -o - %s 2>&1 | FileCheck %s
+
+.arch_extension sme
+smstart
+// CHECK: smstart
+
+.arch_extension nosme
+
+.arch_extension sme-f64
+fmopa za0.d, p0/m, p0/m, z0.d, z0.d
+// CHECK: fmopa za0.d, p0/m, p0/m, z0.d, z0.d
+
+.arch_extension nosme-f64
+
+.arch_extension sme-i64
+addha za0.d, p0/m, p0/m, z0.d
+// CHECK: addha za0.d, p0/m, p0/m, z0.d
+
+.arch_extension nosme-i64
+
+.arch armv8-a+sme
+smstart
+// CHECK: smstart
+
+.arch armv8-a+nosme
+
+.arch armv8-a+sme-f64
+fmopa za0.d, p0/m, p0/m, z0.d, z0.d
+// CHECK: fmopa za0.d, p0/m, p0/m, z0.d, z0.d
+
+.arch armv8-a+nosme-f64
+
+.arch armv8-a+sme-i64
+addha za0.d, p0/m, p0/m, z0.d
+// CHECK: addha za0.d, p0/m, p0/m, z0.d
More information about the llvm-commits
mailing list