summaryrefslogtreecommitdiffstats
path: root/llvm/test
diff options
context:
space:
mode:
authorSaleem Abdulrasool <compnerd@compnerd.org>2016-04-02 19:29:52 +0000
committerSaleem Abdulrasool <compnerd@compnerd.org>2016-04-02 19:29:52 +0000
commit85b43639b1d4d2598d0c1f1f9a3b0c33edd838c8 (patch)
treeaf6ab3d7f11cbbbe3897424bdb2548c201f3d10a /llvm/test
parent8fe7ce590361b8d88c85a4941563665649a8b73f (diff)
downloadbcm5719-llvm-85b43639b1d4d2598d0c1f1f9a3b0c33edd838c8.tar.gz
bcm5719-llvm-85b43639b1d4d2598d0c1f1f9a3b0c33edd838c8.zip
AArch64: support .cpu directive
Add support for the AArch64 .cpu directive. This is a slightly involved directive since the parameter is actually a variable encoded string. The general structure is: <cpu>[[+-]<feature>]* We now map some of the supported string names for features for internal representation of feature flags. If we encounter one which we do not support, bail out as we cannot validate the assembly any longer. Resolves PR27010. llvm-svn: 265240
Diffstat (limited to 'llvm/test')
-rw-r--r--llvm/test/MC/AArch64/directive-cpu.s63
1 files changed, 63 insertions, 0 deletions
diff --git a/llvm/test/MC/AArch64/directive-cpu.s b/llvm/test/MC/AArch64/directive-cpu.s
new file mode 100644
index 00000000000..8e7d4533744
--- /dev/null
+++ b/llvm/test/MC/AArch64/directive-cpu.s
@@ -0,0 +1,63 @@
+// RUN: not llvm-mc -triple aarch64-unknown-none-eabi -filetype asm -o - %s 2>&1 | FileCheck %s
+
+ .cpu generic
+
+ fminnm d0, d0, d1
+
+ .cpu generic+fp
+
+ fminnm d0, d0, d1
+
+ .cpu generic+nofp
+
+ fminnm d0, d0, d1
+
+ .cpu generic+simd
+
+ addp v0.4s, v0.4s, v0.4s
+
+ .cpu generic+nosimd
+
+ addp v0.4s, v0.4s, v0.4s
+
+ .cpu generic+crc
+
+ crc32cx w0, w1, x3
+
+ .cpu generic+nocrc
+
+ crc32cx w0, w1, x3
+
+ .cpu generic+crypto+nocrc
+
+ aesd v0.16b, v2.16b
+
+ .cpu generic+nocrypto+crc
+
+ aesd v0.16b, v2.16b
+
+// NOTE: the errors precede the actual output! The errors appear in order
+// though, so validate by hoisting them to the top and preservering relative
+// ordering
+
+// CHECK: error: instruction requires: fp-armv8
+// CHECK: fminnm d0, d0, d1
+// CHECK: ^
+
+// CHECK: error: instruction requires: neon
+// CHECK: addp v0.4s, v0.4s, v0.4s
+// CHECK: ^
+
+// CHECK: error: instruction requires: crc
+// CHECK: crc32cx w0, w1, x3
+// CHECK: ^
+
+// CHECK: error: instruction requires: crypto
+// CHECK: aesd v0.16b, v2.16b
+// CHECK: ^
+
+// CHECK: fminnm d0, d0, d1
+// CHECK: fminnm d0, d0, d1
+// CHECK: addp v0.4s, v0.4s, v0.4s
+// CHECK: crc32cx w0, w1, x3
+// CHECK: aesd v0.16b, v2.16b
OpenPOWER on IntegriCloud