From bd513b42a12c282901e837b75a6116f1d99a2d5c Mon Sep 17 00:00:00 2001 From: Sander de Smalen Date: Mon, 9 Jul 2018 09:12:17 +0000 Subject: [PATCH] [AArch64][SVE] Asm: Support for UZP and TRN instructions. This patch adds support for: UZP1 Concatenate even elements from two vectors UZP2 Concatenate odd elements from two vectors TRN1 Interleave even elements from two vectors TRN2 Interleave odd elements from two vectors With variants for both data and predicate vectors, e.g. uzp1 z0.b, z1.b, z2.b trn2 p0.s, p1.s, p2.s llvm-svn: 336531 --- llvm/lib/Target/AArch64/AArch64SVEInstrInfo.td | 8 ++++ llvm/test/MC/AArch64/SVE/trn1-diagnostics.s | 43 ++++++++++++++++++++ llvm/test/MC/AArch64/SVE/trn1.s | 56 ++++++++++++++++++++++++++ llvm/test/MC/AArch64/SVE/trn2-diagnostics.s | 43 ++++++++++++++++++++ llvm/test/MC/AArch64/SVE/trn2.s | 56 ++++++++++++++++++++++++++ llvm/test/MC/AArch64/SVE/uzp1-diagnostics.s | 43 ++++++++++++++++++++ llvm/test/MC/AArch64/SVE/uzp1.s | 56 ++++++++++++++++++++++++++ llvm/test/MC/AArch64/SVE/uzp2-diagnostics.s | 43 ++++++++++++++++++++ llvm/test/MC/AArch64/SVE/uzp2.s | 56 ++++++++++++++++++++++++++ 9 files changed, 404 insertions(+) create mode 100644 llvm/test/MC/AArch64/SVE/trn1-diagnostics.s create mode 100644 llvm/test/MC/AArch64/SVE/trn1.s create mode 100644 llvm/test/MC/AArch64/SVE/trn2-diagnostics.s create mode 100644 llvm/test/MC/AArch64/SVE/trn2.s create mode 100644 llvm/test/MC/AArch64/SVE/uzp1-diagnostics.s create mode 100644 llvm/test/MC/AArch64/SVE/uzp1.s create mode 100644 llvm/test/MC/AArch64/SVE/uzp2-diagnostics.s create mode 100644 llvm/test/MC/AArch64/SVE/uzp2.s diff --git a/llvm/lib/Target/AArch64/AArch64SVEInstrInfo.td b/llvm/lib/Target/AArch64/AArch64SVEInstrInfo.td index a6067af..87617de 100644 --- a/llvm/lib/Target/AArch64/AArch64SVEInstrInfo.td +++ b/llvm/lib/Target/AArch64/AArch64SVEInstrInfo.td @@ -536,9 +536,17 @@ let Predicates = [HasSVE] in { defm ZIP1_ZZZ : sve_int_perm_bin_perm_zz<0b000, "zip1">; defm ZIP2_ZZZ : sve_int_perm_bin_perm_zz<0b001, "zip2">; + defm UZP1_ZZZ : sve_int_perm_bin_perm_zz<0b010, "uzp1">; + defm UZP2_ZZZ : sve_int_perm_bin_perm_zz<0b011, "uzp2">; + defm TRN1_ZZZ : sve_int_perm_bin_perm_zz<0b100, "trn1">; + defm TRN2_ZZZ : sve_int_perm_bin_perm_zz<0b101, "trn2">; defm ZIP1_PPP : sve_int_perm_bin_perm_pp<0b000, "zip1">; defm ZIP2_PPP : sve_int_perm_bin_perm_pp<0b001, "zip2">; + defm UZP1_PPP : sve_int_perm_bin_perm_pp<0b010, "uzp1">; + defm UZP2_PPP : sve_int_perm_bin_perm_pp<0b011, "uzp2">; + defm TRN1_PPP : sve_int_perm_bin_perm_pp<0b100, "trn1">; + defm TRN2_PPP : sve_int_perm_bin_perm_pp<0b101, "trn2">; def RDVLI_XI : sve_int_read_vl_a<0b0, 0b11111, "rdvl">; def ADDVL_XXI : sve_int_arith_vl<0b0, "addvl">; diff --git a/llvm/test/MC/AArch64/SVE/trn1-diagnostics.s b/llvm/test/MC/AArch64/SVE/trn1-diagnostics.s new file mode 100644 index 0000000..9e318c1 --- /dev/null +++ b/llvm/test/MC/AArch64/SVE/trn1-diagnostics.s @@ -0,0 +1,43 @@ +// RUN: not llvm-mc -triple=aarch64 -show-encoding -mattr=+sve 2>&1 < %s| FileCheck %s + +// Invalid element kind. +trn1 z10.h, z22.h, z31.x +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid vector kind qualifier +// CHECK-NEXT: trn1 z10.h, z22.h, z31.x +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +// Element size specifiers should match. +trn1 z10.h, z3.h, z15.b +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: trn1 z10.h, z3.h, z15.b +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +// Too few operands +trn1 z1.h, z2.h +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: too few operands for instruction +// CHECK-NEXT: trn1 z1.h, z2.h +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +// z32 is not a valid SVE data register +trn1 z1.s, z2.s, z32.s +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction +// CHECK-NEXT: trn1 z1.s, z2.s, z32.s +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +// p16 is not a valid SVE predicate register +trn1 p1.s, p2.s, p16.s +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction +// CHECK-NEXT: trn1 p1.s, p2.s, p16.s +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +// Combining data and predicate registers as operands +trn1 z1.s, z2.s, p3.s +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction +// CHECK-NEXT: trn1 z1.s, z2.s, p3.s +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +// Combining predicate and data registers as operands +trn1 p1.s, p2.s, z3.s +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction +// CHECK-NEXT: trn1 p1.s, p2.s, z3.s +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: diff --git a/llvm/test/MC/AArch64/SVE/trn1.s b/llvm/test/MC/AArch64/SVE/trn1.s new file mode 100644 index 0000000..b943b6d --- /dev/null +++ b/llvm/test/MC/AArch64/SVE/trn1.s @@ -0,0 +1,56 @@ +// 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 + +trn1 z31.b, z31.b, z31.b +// CHECK-INST: trn1 z31.b, z31.b, z31.b +// CHECK-ENCODING: [0xff,0x73,0x3f,0x05] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: ff 73 3f 05 + +trn1 z31.h, z31.h, z31.h +// CHECK-INST: trn1 z31.h, z31.h, z31.h +// CHECK-ENCODING: [0xff,0x73,0x7f,0x05] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: ff 73 7f 05 + +trn1 z31.s, z31.s, z31.s +// CHECK-INST: trn1 z31.s, z31.s, z31.s +// CHECK-ENCODING: [0xff,0x73,0xbf,0x05] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: ff 73 bf 05 + +trn1 z31.d, z31.d, z31.d +// CHECK-INST: trn1 z31.d, z31.d, z31.d +// CHECK-ENCODING: [0xff,0x73,0xff,0x05] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: ff 73 ff 05 + +trn1 p15.b, p15.b, p15.b +// CHECK-INST: trn1 p15.b, p15.b, p15.b +// CHECK-ENCODING: [0xef,0x51,0x2f,0x05] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: ef 51 2f 05 + +trn1 p15.s, p15.s, p15.s +// CHECK-INST: trn1 p15.s, p15.s, p15.s +// CHECK-ENCODING: [0xef,0x51,0xaf,0x05] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: ef 51 af 05 + +trn1 p15.h, p15.h, p15.h +// CHECK-INST: trn1 p15.h, p15.h, p15.h +// CHECK-ENCODING: [0xef,0x51,0x6f,0x05] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: ef 51 6f 05 + +trn1 p15.d, p15.d, p15.d +// CHECK-INST: trn1 p15.d, p15.d, p15.d +// CHECK-ENCODING: [0xef,0x51,0xef,0x05] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: ef 51 ef 05 diff --git a/llvm/test/MC/AArch64/SVE/trn2-diagnostics.s b/llvm/test/MC/AArch64/SVE/trn2-diagnostics.s new file mode 100644 index 0000000..48b37bf --- /dev/null +++ b/llvm/test/MC/AArch64/SVE/trn2-diagnostics.s @@ -0,0 +1,43 @@ +// RUN: not llvm-mc -triple=aarch64 -show-encoding -mattr=+sve 2>&1 < %s| FileCheck %s + +// Invalid element kind. +trn2 z6.h, z23.h, z31.x +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid vector kind qualifier +// CHECK-NEXT: trn2 z6.h, z23.h, z31.x +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +// Element size specifiers should match. +trn2 z0.h, z30.h, z24.b +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: trn2 z0.h, z30.h, z24.b +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +// Too few operands +trn2 z1.h, z2.h +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: too few operands for instruction +// CHECK-NEXT: trn2 z1.h, z2.h +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +// z32 is not a valid SVE data register +trn2 z1.s, z2.s, z32.s +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction +// CHECK-NEXT: trn2 z1.s, z2.s, z32.s +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +// p16 is not a valid SVE predicate register +trn2 p1.s, p2.s, p16.s +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction +// CHECK-NEXT: trn2 p1.s, p2.s, p16.s +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +// Combining data and predicate registers as operands +trn2 z1.s, z2.s, p3.s +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction +// CHECK-NEXT: trn2 z1.s, z2.s, p3.s +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +// Combining predicate and data registers as operands +trn2 p1.s, p2.s, z3.s +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction +// CHECK-NEXT: trn2 p1.s, p2.s, z3.s +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: diff --git a/llvm/test/MC/AArch64/SVE/trn2.s b/llvm/test/MC/AArch64/SVE/trn2.s new file mode 100644 index 0000000..213d3b6 --- /dev/null +++ b/llvm/test/MC/AArch64/SVE/trn2.s @@ -0,0 +1,56 @@ +// 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 + +trn2 z31.b, z31.b, z31.b +// CHECK-INST: trn2 z31.b, z31.b, z31.b +// CHECK-ENCODING: [0xff,0x77,0x3f,0x05] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: ff 77 3f 05 + +trn2 z31.h, z31.h, z31.h +// CHECK-INST: trn2 z31.h, z31.h, z31.h +// CHECK-ENCODING: [0xff,0x77,0x7f,0x05] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: ff 77 7f 05 + +trn2 z31.s, z31.s, z31.s +// CHECK-INST: trn2 z31.s, z31.s, z31.s +// CHECK-ENCODING: [0xff,0x77,0xbf,0x05] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: ff 77 bf 05 + +trn2 z31.d, z31.d, z31.d +// CHECK-INST: trn2 z31.d, z31.d, z31.d +// CHECK-ENCODING: [0xff,0x77,0xff,0x05] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: ff 77 ff 05 + +trn2 p15.b, p15.b, p15.b +// CHECK-INST: trn2 p15.b, p15.b, p15.b +// CHECK-ENCODING: [0xef,0x55,0x2f,0x05] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: ef 55 2f 05 + +trn2 p15.s, p15.s, p15.s +// CHECK-INST: trn2 p15.s, p15.s, p15.s +// CHECK-ENCODING: [0xef,0x55,0xaf,0x05] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: ef 55 af 05 + +trn2 p15.h, p15.h, p15.h +// CHECK-INST: trn2 p15.h, p15.h, p15.h +// CHECK-ENCODING: [0xef,0x55,0x6f,0x05] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: ef 55 6f 05 + +trn2 p15.d, p15.d, p15.d +// CHECK-INST: trn2 p15.d, p15.d, p15.d +// CHECK-ENCODING: [0xef,0x55,0xef,0x05] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: ef 55 ef 05 diff --git a/llvm/test/MC/AArch64/SVE/uzp1-diagnostics.s b/llvm/test/MC/AArch64/SVE/uzp1-diagnostics.s new file mode 100644 index 0000000..3842d60 --- /dev/null +++ b/llvm/test/MC/AArch64/SVE/uzp1-diagnostics.s @@ -0,0 +1,43 @@ +// RUN: not llvm-mc -triple=aarch64 -show-encoding -mattr=+sve 2>&1 < %s| FileCheck %s + +// Invalid element kind. +uzp1 z10.h, z22.h, z31.x +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid vector kind qualifier +// CHECK-NEXT: uzp1 z10.h, z22.h, z31.x +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +// Element size specifiers should match. +uzp1 z10.h, z3.h, z15.b +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: uzp1 z10.h, z3.h, z15.b +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +// Too few operands +uzp1 z1.h, z2.h +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: too few operands for instruction +// CHECK-NEXT: uzp1 z1.h, z2.h +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +// z32 is not a valid SVE data register +uzp1 z1.s, z2.s, z32.s +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction +// CHECK-NEXT: uzp1 z1.s, z2.s, z32.s +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +// p16 is not a valid SVE predicate register +uzp1 p1.s, p2.s, p16.s +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction +// CHECK-NEXT: uzp1 p1.s, p2.s, p16.s +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +// Combining data and predicate registers as operands +uzp1 z1.s, z2.s, p3.s +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction +// CHECK-NEXT: uzp1 z1.s, z2.s, p3.s +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +// Combining predicate and data registers as operands +uzp1 p1.s, p2.s, z3.s +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction +// CHECK-NEXT: uzp1 p1.s, p2.s, z3.s +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: diff --git a/llvm/test/MC/AArch64/SVE/uzp1.s b/llvm/test/MC/AArch64/SVE/uzp1.s new file mode 100644 index 0000000..a8eeaa2 --- /dev/null +++ b/llvm/test/MC/AArch64/SVE/uzp1.s @@ -0,0 +1,56 @@ +// 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 + +uzp1 z31.b, z31.b, z31.b +// CHECK-INST: uzp1 z31.b, z31.b, z31.b +// CHECK-ENCODING: [0xff,0x6b,0x3f,0x05] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: ff 6b 3f 05 + +uzp1 z31.h, z31.h, z31.h +// CHECK-INST: uzp1 z31.h, z31.h, z31.h +// CHECK-ENCODING: [0xff,0x6b,0x7f,0x05] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: ff 6b 7f 05 + +uzp1 z31.s, z31.s, z31.s +// CHECK-INST: uzp1 z31.s, z31.s, z31.s +// CHECK-ENCODING: [0xff,0x6b,0xbf,0x05] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: ff 6b bf 05 + +uzp1 z31.d, z31.d, z31.d +// CHECK-INST: uzp1 z31.d, z31.d, z31.d +// CHECK-ENCODING: [0xff,0x6b,0xff,0x05] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: ff 6b ff 05 + +uzp1 p15.b, p15.b, p15.b +// CHECK-INST: uzp1 p15.b, p15.b, p15.b +// CHECK-ENCODING: [0xef,0x49,0x2f,0x05] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: ef 49 2f 05 + +uzp1 p15.s, p15.s, p15.s +// CHECK-INST: uzp1 p15.s, p15.s, p15.s +// CHECK-ENCODING: [0xef,0x49,0xaf,0x05] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: ef 49 af 05 + +uzp1 p15.h, p15.h, p15.h +// CHECK-INST: uzp1 p15.h, p15.h, p15.h +// CHECK-ENCODING: [0xef,0x49,0x6f,0x05] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: ef 49 6f 05 + +uzp1 p15.d, p15.d, p15.d +// CHECK-INST: uzp1 p15.d, p15.d, p15.d +// CHECK-ENCODING: [0xef,0x49,0xef,0x05] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: ef 49 ef 05 diff --git a/llvm/test/MC/AArch64/SVE/uzp2-diagnostics.s b/llvm/test/MC/AArch64/SVE/uzp2-diagnostics.s new file mode 100644 index 0000000..ecb8b33 --- /dev/null +++ b/llvm/test/MC/AArch64/SVE/uzp2-diagnostics.s @@ -0,0 +1,43 @@ +// RUN: not llvm-mc -triple=aarch64 -show-encoding -mattr=+sve 2>&1 < %s| FileCheck %s + +// Invalid element kind. +uzp2 z6.h, z23.h, z31.x +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid vector kind qualifier +// CHECK-NEXT: uzp2 z6.h, z23.h, z31.x +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +// Element size specifiers should match. +uzp2 z0.h, z30.h, z24.b +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: uzp2 z0.h, z30.h, z24.b +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +// Too few operands +uzp2 z1.h, z2.h +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: too few operands for instruction +// CHECK-NEXT: uzp2 z1.h, z2.h +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +// z32 is not a valid SVE data register +uzp2 z1.s, z2.s, z32.s +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction +// CHECK-NEXT: uzp2 z1.s, z2.s, z32.s +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +// p16 is not a valid SVE predicate register +uzp2 p1.s, p2.s, p16.s +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction +// CHECK-NEXT: uzp2 p1.s, p2.s, p16.s +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +// Combining data and predicate registers as operands +uzp2 z1.s, z2.s, p3.s +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction +// CHECK-NEXT: uzp2 z1.s, z2.s, p3.s +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +// Combining predicate and data registers as operands +uzp2 p1.s, p2.s, z3.s +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction +// CHECK-NEXT: uzp2 p1.s, p2.s, z3.s +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: diff --git a/llvm/test/MC/AArch64/SVE/uzp2.s b/llvm/test/MC/AArch64/SVE/uzp2.s new file mode 100644 index 0000000..49573f1 --- /dev/null +++ b/llvm/test/MC/AArch64/SVE/uzp2.s @@ -0,0 +1,56 @@ +// 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 + +uzp2 z31.b, z31.b, z31.b +// CHECK-INST: uzp2 z31.b, z31.b, z31.b +// CHECK-ENCODING: [0xff,0x6f,0x3f,0x05] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: ff 6f 3f 05 + +uzp2 z31.h, z31.h, z31.h +// CHECK-INST: uzp2 z31.h, z31.h, z31.h +// CHECK-ENCODING: [0xff,0x6f,0x7f,0x05] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: ff 6f 7f 05 + +uzp2 z31.s, z31.s, z31.s +// CHECK-INST: uzp2 z31.s, z31.s, z31.s +// CHECK-ENCODING: [0xff,0x6f,0xbf,0x05] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: ff 6f bf 05 + +uzp2 z31.d, z31.d, z31.d +// CHECK-INST: uzp2 z31.d, z31.d, z31.d +// CHECK-ENCODING: [0xff,0x6f,0xff,0x05] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: ff 6f ff 05 + +uzp2 p15.b, p15.b, p15.b +// CHECK-INST: uzp2 p15.b, p15.b, p15.b +// CHECK-ENCODING: [0xef,0x4d,0x2f,0x05] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: ef 4d 2f 05 + +uzp2 p15.s, p15.s, p15.s +// CHECK-INST: uzp2 p15.s, p15.s, p15.s +// CHECK-ENCODING: [0xef,0x4d,0xaf,0x05] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: ef 4d af 05 + +uzp2 p15.h, p15.h, p15.h +// CHECK-INST: uzp2 p15.h, p15.h, p15.h +// CHECK-ENCODING: [0xef,0x4d,0x6f,0x05] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: ef 4d 6f 05 + +uzp2 p15.d, p15.d, p15.d +// CHECK-INST: uzp2 p15.d, p15.d, p15.d +// CHECK-ENCODING: [0xef,0x4d,0xef,0x05] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: ef 4d ef 05 -- 2.7.4