summaryrefslogtreecommitdiffstats
path: root/llvm/test
diff options
context:
space:
mode:
authorSander de Smalen <sander.desmalen@arm.com>2018-07-13 09:25:43 +0000
committerSander de Smalen <sander.desmalen@arm.com>2018-07-13 09:25:43 +0000
commit7c3c0f24a3cebaa7744b38ed1ca018427edd2074 (patch)
treea67e872352865c2ec74e71b471e71621ee73e959 /llvm/test
parent9fe0bf3be7d8dbe9f75fc083f9855f4190409bc9 (diff)
downloadbcm5719-llvm-7c3c0f24a3cebaa7744b38ed1ca018427edd2074.tar.gz
bcm5719-llvm-7c3c0f24a3cebaa7744b38ed1ca018427edd2074.zip
[AArch64][SVE] Asm: Vector Unpack Low/High instructions.
This patch adds support for the following unpack instructions: - PUNPKLO, PUNPKHI Unpack elements from low/high half and place into elements of twice their size. e.g. punpklo p0.h, p0.b - UUNPKLO, UUNPKHI Unpack elements from low/high half and SUNPKLO, SUNPKHI place into elements of twice their size after zero- or sign-extending the values. e.g. uunpklo z0.h, z0.b llvm-svn: 336982
Diffstat (limited to 'llvm/test')
-rw-r--r--llvm/test/MC/AArch64/SVE/punpkhi-diagnostics.s15
-rw-r--r--llvm/test/MC/AArch64/SVE/punpkhi.s20
-rw-r--r--llvm/test/MC/AArch64/SVE/punpklo-diagnostics.s15
-rw-r--r--llvm/test/MC/AArch64/SVE/punpklo.s20
-rw-r--r--llvm/test/MC/AArch64/SVE/sunpkhi-diagnostics.s20
-rw-r--r--llvm/test/MC/AArch64/SVE/sunpkhi.s26
-rw-r--r--llvm/test/MC/AArch64/SVE/sunpklo-diagnostics.s20
-rw-r--r--llvm/test/MC/AArch64/SVE/sunpklo.s26
-rw-r--r--llvm/test/MC/AArch64/SVE/uunpkhi-diagnostics.s20
-rw-r--r--llvm/test/MC/AArch64/SVE/uunpkhi.s26
-rw-r--r--llvm/test/MC/AArch64/SVE/uunpklo-diagnostics.s20
-rw-r--r--llvm/test/MC/AArch64/SVE/uunpklo.s26
12 files changed, 254 insertions, 0 deletions
diff --git a/llvm/test/MC/AArch64/SVE/punpkhi-diagnostics.s b/llvm/test/MC/AArch64/SVE/punpkhi-diagnostics.s
new file mode 100644
index 00000000000..b797e5a11f1
--- /dev/null
+++ b/llvm/test/MC/AArch64/SVE/punpkhi-diagnostics.s
@@ -0,0 +1,15 @@
+// RUN: not llvm-mc -triple=aarch64 -show-encoding -mattr=+sve 2>&1 < %s| FileCheck %s
+
+
+// ------------------------------------------------------------------------- //
+// Invalid element widths.
+
+punpkhi p0.b, p0.b
+// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid predicate register
+// CHECK-NEXT: punpkhi p0.b, p0.b
+// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
+
+punpkhi p0.s, p0.h
+// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid predicate register
+// CHECK-NEXT: punpkhi p0.s, p0.h
+// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
diff --git a/llvm/test/MC/AArch64/SVE/punpkhi.s b/llvm/test/MC/AArch64/SVE/punpkhi.s
new file mode 100644
index 00000000000..54cbc4b5115
--- /dev/null
+++ b/llvm/test/MC/AArch64/SVE/punpkhi.s
@@ -0,0 +1,20 @@
+// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sve < %s \
+// RUN: | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST
+// RUN: not llvm-mc -triple=aarch64 -show-encoding < %s 2>&1 \
+// RUN: | FileCheck %s --check-prefix=CHECK-ERROR
+// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sve < %s \
+// RUN: | llvm-objdump -d -mattr=+sve - | FileCheck %s --check-prefix=CHECK-INST
+// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sve < %s \
+// RUN: | llvm-objdump -d - | FileCheck %s --check-prefix=CHECK-UNKNOWN
+
+punpkhi p0.h, p0.b
+// CHECK-INST: punpkhi p0.h, p0.b
+// CHECK-ENCODING: [0x00,0x40,0x31,0x05]
+// CHECK-ERROR: instruction requires: sve
+// CHECK-UNKNOWN: 00 40 31 05 <unknown>
+
+punpkhi p15.h, p15.b
+// CHECK-INST: punpkhi p15.h, p15.b
+// CHECK-ENCODING: [0xef,0x41,0x31,0x05]
+// CHECK-ERROR: instruction requires: sve
+// CHECK-UNKNOWN: ef 41 31 05 <unknown>
diff --git a/llvm/test/MC/AArch64/SVE/punpklo-diagnostics.s b/llvm/test/MC/AArch64/SVE/punpklo-diagnostics.s
new file mode 100644
index 00000000000..bd8045ed3e2
--- /dev/null
+++ b/llvm/test/MC/AArch64/SVE/punpklo-diagnostics.s
@@ -0,0 +1,15 @@
+// RUN: not llvm-mc -triple=aarch64 -show-encoding -mattr=+sve 2>&1 < %s| FileCheck %s
+
+
+// ------------------------------------------------------------------------- //
+// Invalid element widths.
+
+punpklo p0.b, p0.b
+// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid predicate register
+// CHECK-NEXT: punpklo p0.b, p0.b
+// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
+
+punpklo p0.s, p0.h
+// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid predicate register
+// CHECK-NEXT: punpklo p0.s, p0.h
+// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
diff --git a/llvm/test/MC/AArch64/SVE/punpklo.s b/llvm/test/MC/AArch64/SVE/punpklo.s
new file mode 100644
index 00000000000..ed0fd25ce72
--- /dev/null
+++ b/llvm/test/MC/AArch64/SVE/punpklo.s
@@ -0,0 +1,20 @@
+// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sve < %s \
+// RUN: | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST
+// RUN: not llvm-mc -triple=aarch64 -show-encoding < %s 2>&1 \
+// RUN: | FileCheck %s --check-prefix=CHECK-ERROR
+// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sve < %s \
+// RUN: | llvm-objdump -d -mattr=+sve - | FileCheck %s --check-prefix=CHECK-INST
+// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sve < %s \
+// RUN: | llvm-objdump -d - | FileCheck %s --check-prefix=CHECK-UNKNOWN
+
+punpklo p0.h, p0.b
+// CHECK-INST: punpklo p0.h, p0.b
+// CHECK-ENCODING: [0x00,0x40,0x30,0x05]
+// CHECK-ERROR: instruction requires: sve
+// CHECK-UNKNOWN: 00 40 30 05 <unknown>
+
+punpklo p15.h, p15.b
+// CHECK-INST: punpklo p15.h, p15.b
+// CHECK-ENCODING: [0xef,0x41,0x30,0x05]
+// CHECK-ERROR: instruction requires: sve
+// CHECK-UNKNOWN: ef 41 30 05 <unknown>
diff --git a/llvm/test/MC/AArch64/SVE/sunpkhi-diagnostics.s b/llvm/test/MC/AArch64/SVE/sunpkhi-diagnostics.s
new file mode 100644
index 00000000000..768ef1236bf
--- /dev/null
+++ b/llvm/test/MC/AArch64/SVE/sunpkhi-diagnostics.s
@@ -0,0 +1,20 @@
+// RUN: not llvm-mc -triple=aarch64 -show-encoding -mattr=+sve 2>&1 < %s| FileCheck %s
+
+
+// ------------------------------------------------------------------------- //
+// Invalid element widths.
+
+sunpkhi z0.b, z0.b
+// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width
+// CHECK-NEXT: sunpkhi z0.b, z0.b
+// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
+
+sunpkhi z0.s, z0.b
+// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width
+// CHECK-NEXT: sunpkhi z0.s, z0.b
+// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
+
+sunpkhi z0.d, z0.h
+// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width
+// CHECK-NEXT: sunpkhi z0.d, z0.h
+// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
diff --git a/llvm/test/MC/AArch64/SVE/sunpkhi.s b/llvm/test/MC/AArch64/SVE/sunpkhi.s
new file mode 100644
index 00000000000..9dabf0d3fb9
--- /dev/null
+++ b/llvm/test/MC/AArch64/SVE/sunpkhi.s
@@ -0,0 +1,26 @@
+// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sve < %s \
+// RUN: | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST
+// RUN: not llvm-mc -triple=aarch64 -show-encoding < %s 2>&1 \
+// RUN: | FileCheck %s --check-prefix=CHECK-ERROR
+// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sve < %s \
+// RUN: | llvm-objdump -d -mattr=+sve - | FileCheck %s --check-prefix=CHECK-INST
+// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sve < %s \
+// RUN: | llvm-objdump -d - | FileCheck %s --check-prefix=CHECK-UNKNOWN
+
+sunpkhi z31.h, z31.b
+// CHECK-INST: sunpkhi z31.h, z31.b
+// CHECK-ENCODING: [0xff,0x3b,0x71,0x05]
+// CHECK-ERROR: instruction requires: sve
+// CHECK-UNKNOWN: ff 3b 71 05 <unknown>
+
+sunpkhi z31.s, z31.h
+// CHECK-INST: sunpkhi z31.s, z31.h
+// CHECK-ENCODING: [0xff,0x3b,0xb1,0x05]
+// CHECK-ERROR: instruction requires: sve
+// CHECK-UNKNOWN: ff 3b b1 05 <unknown>
+
+sunpkhi z31.d, z31.s
+// CHECK-INST: sunpkhi z31.d, z31.s
+// CHECK-ENCODING: [0xff,0x3b,0xf1,0x05]
+// CHECK-ERROR: instruction requires: sve
+// CHECK-UNKNOWN: ff 3b f1 05 <unknown>
diff --git a/llvm/test/MC/AArch64/SVE/sunpklo-diagnostics.s b/llvm/test/MC/AArch64/SVE/sunpklo-diagnostics.s
new file mode 100644
index 00000000000..92de4278e23
--- /dev/null
+++ b/llvm/test/MC/AArch64/SVE/sunpklo-diagnostics.s
@@ -0,0 +1,20 @@
+// RUN: not llvm-mc -triple=aarch64 -show-encoding -mattr=+sve 2>&1 < %s| FileCheck %s
+
+
+// ------------------------------------------------------------------------- //
+// Invalid element widths.
+
+sunpklo z0.b, z0.b
+// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width
+// CHECK-NEXT: sunpklo z0.b, z0.b
+// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
+
+sunpklo z0.s, z0.b
+// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width
+// CHECK-NEXT: sunpklo z0.s, z0.b
+// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
+
+sunpklo z0.d, z0.h
+// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width
+// CHECK-NEXT: sunpklo z0.d, z0.h
+// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
diff --git a/llvm/test/MC/AArch64/SVE/sunpklo.s b/llvm/test/MC/AArch64/SVE/sunpklo.s
new file mode 100644
index 00000000000..5c809892d38
--- /dev/null
+++ b/llvm/test/MC/AArch64/SVE/sunpklo.s
@@ -0,0 +1,26 @@
+// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sve < %s \
+// RUN: | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST
+// RUN: not llvm-mc -triple=aarch64 -show-encoding < %s 2>&1 \
+// RUN: | FileCheck %s --check-prefix=CHECK-ERROR
+// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sve < %s \
+// RUN: | llvm-objdump -d -mattr=+sve - | FileCheck %s --check-prefix=CHECK-INST
+// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sve < %s \
+// RUN: | llvm-objdump -d - | FileCheck %s --check-prefix=CHECK-UNKNOWN
+
+sunpklo z31.h, z31.b
+// CHECK-INST: sunpklo z31.h, z31.b
+// CHECK-ENCODING: [0xff,0x3b,0x70,0x05]
+// CHECK-ERROR: instruction requires: sve
+// CHECK-UNKNOWN: ff 3b 70 05 <unknown>
+
+sunpklo z31.s, z31.h
+// CHECK-INST: sunpklo z31.s, z31.h
+// CHECK-ENCODING: [0xff,0x3b,0xb0,0x05]
+// CHECK-ERROR: instruction requires: sve
+// CHECK-UNKNOWN: ff 3b b0 05 <unknown>
+
+sunpklo z31.d, z31.s
+// CHECK-INST: sunpklo z31.d, z31.s
+// CHECK-ENCODING: [0xff,0x3b,0xf0,0x05]
+// CHECK-ERROR: instruction requires: sve
+// CHECK-UNKNOWN: ff 3b f0 05 <unknown>
diff --git a/llvm/test/MC/AArch64/SVE/uunpkhi-diagnostics.s b/llvm/test/MC/AArch64/SVE/uunpkhi-diagnostics.s
new file mode 100644
index 00000000000..bdae37a32ae
--- /dev/null
+++ b/llvm/test/MC/AArch64/SVE/uunpkhi-diagnostics.s
@@ -0,0 +1,20 @@
+// RUN: not llvm-mc -triple=aarch64 -show-encoding -mattr=+sve 2>&1 < %s| FileCheck %s
+
+
+// ------------------------------------------------------------------------- //
+// Invalid element widths.
+
+uunpkhi z0.b, z0.b
+// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width
+// CHECK-NEXT: uunpkhi z0.b, z0.b
+// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
+
+uunpkhi z0.s, z0.b
+// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width
+// CHECK-NEXT: uunpkhi z0.s, z0.b
+// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
+
+uunpkhi z0.d, z0.h
+// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width
+// CHECK-NEXT: uunpkhi z0.d, z0.h
+// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
diff --git a/llvm/test/MC/AArch64/SVE/uunpkhi.s b/llvm/test/MC/AArch64/SVE/uunpkhi.s
new file mode 100644
index 00000000000..39404904ca9
--- /dev/null
+++ b/llvm/test/MC/AArch64/SVE/uunpkhi.s
@@ -0,0 +1,26 @@
+// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sve < %s \
+// RUN: | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST
+// RUN: not llvm-mc -triple=aarch64 -show-encoding < %s 2>&1 \
+// RUN: | FileCheck %s --check-prefix=CHECK-ERROR
+// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sve < %s \
+// RUN: | llvm-objdump -d -mattr=+sve - | FileCheck %s --check-prefix=CHECK-INST
+// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sve < %s \
+// RUN: | llvm-objdump -d - | FileCheck %s --check-prefix=CHECK-UNKNOWN
+
+uunpkhi z31.h, z31.b
+// CHECK-INST: uunpkhi z31.h, z31.b
+// CHECK-ENCODING: [0xff,0x3b,0x73,0x05]
+// CHECK-ERROR: instruction requires: sve
+// CHECK-UNKNOWN: ff 3b 73 05 <unknown>
+
+uunpkhi z31.s, z31.h
+// CHECK-INST: uunpkhi z31.s, z31.h
+// CHECK-ENCODING: [0xff,0x3b,0xb3,0x05]
+// CHECK-ERROR: instruction requires: sve
+// CHECK-UNKNOWN: ff 3b b3 05 <unknown>
+
+uunpkhi z31.d, z31.s
+// CHECK-INST: uunpkhi z31.d, z31.s
+// CHECK-ENCODING: [0xff,0x3b,0xf3,0x05]
+// CHECK-ERROR: instruction requires: sve
+// CHECK-UNKNOWN: ff 3b f3 05 <unknown>
diff --git a/llvm/test/MC/AArch64/SVE/uunpklo-diagnostics.s b/llvm/test/MC/AArch64/SVE/uunpklo-diagnostics.s
new file mode 100644
index 00000000000..00f8a72fbc2
--- /dev/null
+++ b/llvm/test/MC/AArch64/SVE/uunpklo-diagnostics.s
@@ -0,0 +1,20 @@
+// RUN: not llvm-mc -triple=aarch64 -show-encoding -mattr=+sve 2>&1 < %s| FileCheck %s
+
+
+// ------------------------------------------------------------------------- //
+// Invalid element widths.
+
+uunpklo z0.b, z0.b
+// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width
+// CHECK-NEXT: uunpklo z0.b, z0.b
+// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
+
+uunpklo z0.s, z0.b
+// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width
+// CHECK-NEXT: uunpklo z0.s, z0.b
+// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
+
+uunpklo z0.d, z0.h
+// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width
+// CHECK-NEXT: uunpklo z0.d, z0.h
+// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
diff --git a/llvm/test/MC/AArch64/SVE/uunpklo.s b/llvm/test/MC/AArch64/SVE/uunpklo.s
new file mode 100644
index 00000000000..f825f6c4698
--- /dev/null
+++ b/llvm/test/MC/AArch64/SVE/uunpklo.s
@@ -0,0 +1,26 @@
+// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sve < %s \
+// RUN: | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST
+// RUN: not llvm-mc -triple=aarch64 -show-encoding < %s 2>&1 \
+// RUN: | FileCheck %s --check-prefix=CHECK-ERROR
+// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sve < %s \
+// RUN: | llvm-objdump -d -mattr=+sve - | FileCheck %s --check-prefix=CHECK-INST
+// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sve < %s \
+// RUN: | llvm-objdump -d - | FileCheck %s --check-prefix=CHECK-UNKNOWN
+
+uunpklo z31.h, z31.b
+// CHECK-INST: uunpklo z31.h, z31.b
+// CHECK-ENCODING: [0xff,0x3b,0x72,0x05]
+// CHECK-ERROR: instruction requires: sve
+// CHECK-UNKNOWN: ff 3b 72 05 <unknown>
+
+uunpklo z31.s, z31.h
+// CHECK-INST: uunpklo z31.s, z31.h
+// CHECK-ENCODING: [0xff,0x3b,0xb2,0x05]
+// CHECK-ERROR: instruction requires: sve
+// CHECK-UNKNOWN: ff 3b b2 05 <unknown>
+
+uunpklo z31.d, z31.s
+// CHECK-INST: uunpklo z31.d, z31.s
+// CHECK-ENCODING: [0xff,0x3b,0xf2,0x05]
+// CHECK-ERROR: instruction requires: sve
+// CHECK-UNKNOWN: ff 3b f2 05 <unknown>
OpenPOWER on IntegriCloud