Index: llvm/lib/Target/AArch64/AArch64SVEInstrInfo.td =================================================================== --- llvm/lib/Target/AArch64/AArch64SVEInstrInfo.td +++ llvm/lib/Target/AArch64/AArch64SVEInstrInfo.td @@ -3614,8 +3614,8 @@ let Predicates = [HasSVE2p1_or_HasSME] in { defm REVD_ZPmZ : sve2_int_perm_revd<"revd", AArch64revd_mt>; -defm SCLAMP_ZZZ : sve2_clamp<"sclamp", 0b0, int_aarch64_sve_sclamp>; -defm UCLAMP_ZZZ : sve2_clamp<"uclamp", 0b1, int_aarch64_sve_uclamp>; +defm SCLAMP_ZZZ : sve2_clamp<"sclamp", 0b0000, int_aarch64_sve_sclamp>; +defm UCLAMP_ZZZ : sve2_clamp<"uclamp", 0b0001, int_aarch64_sve_uclamp>; defm PSEL_PPPRI : sve2_int_perm_sel_p<"psel", int_aarch64_sve_psel>; } // End HasSVE2p1_or_HasSME @@ -3784,4 +3784,10 @@ defm PMOV_PZI : sve2p1_vector_to_pred<"pmov">; defm PMOV_ZIP : sve2p1_pred_to_vector<"pmov">; + +defm ZIPQ1_ZZZ : sve2p1_permute_vec_elems_q<0b1000, "zipq1">; +defm ZIPQ2_ZZZ : sve2p1_permute_vec_elems_q<0b1001, "zipq2">; +defm UZPQ1_ZZZ : sve2p1_permute_vec_elems_q<0b1010, "uzpq1">; +defm UZPQ2_ZZZ : sve2p1_permute_vec_elems_q<0b1011, "uzpq2">; +defm TBLQ_ZZZ : sve2p1_tblq<"tblq">; } // End HasSVE2p1_or_HasSME2p1 Index: llvm/lib/Target/AArch64/SMEInstrFormats.td =================================================================== --- llvm/lib/Target/AArch64/SMEInstrFormats.td +++ llvm/lib/Target/AArch64/SMEInstrFormats.td @@ -1083,38 +1083,6 @@ def : SVE_1_Op_Passthru_Pat(NAME)>; } -class sve2_clamp sz, bit U, ZPRRegOp zpr_ty> - : I<(outs zpr_ty:$Zd), (ins zpr_ty:$Zn, zpr_ty:$Zm, zpr_ty:$_Zd), - asm, "\t$Zd, $Zn, $Zm", "", []>, - Sched<[]> { - bits<5> Zm; - bits<5> Zn; - bits<5> Zd; - let Inst{31-24} = 0b01000100; - let Inst{23-22} = sz; - let Inst{21} = 0b0; - let Inst{20-16} = Zm; - let Inst{15-11} = 0b11000; - let Inst{10} = U; - let Inst{9-5} = Zn; - let Inst{4-0} = Zd; - - let Constraints = "$Zd = $_Zd"; - let DestructiveInstType = DestructiveOther; - let ElementSize = zpr_ty.ElementSize; -} - -multiclass sve2_clamp { - def _B : sve2_clamp; - def _H : sve2_clamp; - def _S : sve2_clamp; - def _D : sve2_clamp; - - def : SVE_3_Op_Pat(NAME # _B)>; - def : SVE_3_Op_Pat(NAME # _H)>; - def : SVE_3_Op_Pat(NAME # _S)>; - def : SVE_3_Op_Pat(NAME # _D)>; -} class sve2_int_perm_sel_p : I<(outs PPRAny:$Pd), (ins PPRAny:$Pn, ppr_ty:$Pm, Index: llvm/lib/Target/AArch64/SVEInstrFormats.td =================================================================== --- llvm/lib/Target/AArch64/SVEInstrFormats.td +++ llvm/lib/Target/AArch64/SVEInstrFormats.td @@ -9501,3 +9501,54 @@ def : InstAlias(NAME # _B) ZPRAny:$Zd, 0, PPR8:$Pn), 1>; } + + +class sve2_permuteq_or_clamp sz, bits<4> opc, ZPRRegOp zpr_ty, + RegisterOperand src1_ty> + : I<(outs zpr_ty:$Zd), (ins src1_ty:$Zn, zpr_ty:$Zm, zpr_ty:$_Zd), + asm, "\t$Zd, $Zn, $Zm", "", []>, + Sched<[]> { + bits<5> Zm; + bits<5> Zn; + bits<5> Zd; + let Inst{31-24} = 0b01000100; + let Inst{23-22} = sz; + let Inst{21} = 0b0; + let Inst{20-16} = Zm; + let Inst{15-14} = 0b11; + let Inst{13-10} = opc; + let Inst{9-5} = Zn; + let Inst{4-0} = Zd; + + let Constraints = "$Zd = $_Zd"; + let DestructiveInstType = DestructiveOther; + let ElementSize = zpr_ty.ElementSize; +} + +multiclass sve2_clamp opc, SDPatternOperator op> { + // bits 13-11 = 0 + def _B : sve2_permuteq_or_clamp; + def _H : sve2_permuteq_or_clamp; + def _S : sve2_permuteq_or_clamp; + def _D : sve2_permuteq_or_clamp; + + def : SVE_3_Op_Pat(NAME # _B)>; + def : SVE_3_Op_Pat(NAME # _H)>; + def : SVE_3_Op_Pat(NAME # _S)>; + def : SVE_3_Op_Pat(NAME # _D)>; +} + + +multiclass sve2p1_permute_vec_elems_q opc, string mnemonic> { + def _B : sve2_permuteq_or_clamp; + def _H : sve2_permuteq_or_clamp; + def _S : sve2_permuteq_or_clamp; + def _D : sve2_permuteq_or_clamp; +} + +multiclass sve2p1_tblq { + def _B : sve2_permuteq_or_clamp; + def _H : sve2_permuteq_or_clamp; + def _S : sve2_permuteq_or_clamp; + def _D : sve2_permuteq_or_clamp; +} Index: llvm/test/MC/AArch64/SVE2p1/tblq-diagnostics.s =================================================================== --- /dev/null +++ llvm/test/MC/AArch64/SVE2p1/tblq-diagnostics.s @@ -0,0 +1,14 @@ +// RUN: not llvm-mc -triple=aarch64 -show-encoding -mattr=+sve2p1 2>&1 < %s | FileCheck %s + +// --------------------------------------------------------------------------// +// Invalid vector suffix + +tblq z0.b, {z0.h}, z0.h +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction +// CHECK-NEXT: tblq z0.b, {z0.h}, z0.h +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +tblq z23.d, {z23.s}, z13.s +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction +// CHECK-NEXT: tblq z23.d, {z23.s}, z13.s +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: Index: llvm/test/MC/AArch64/SVE2p1/tblq.s =================================================================== --- /dev/null +++ llvm/test/MC/AArch64/SVE2p1/tblq.s @@ -0,0 +1,114 @@ +// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sme2p1 < %s \ +// RUN: | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST +// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sve2p1 < %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=+sme2p1 < %s \ +// RUN: | llvm-objdump -d --no-print-imm-hex --mattr=+sme2p1 - | FileCheck %s --check-prefix=CHECK-INST +// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sme2p1 < %s \ +// RUN: | llvm-objdump -d --mattr=-sme2p1,-sve2p1 - | FileCheck %s --check-prefix=CHECK-UNKNOWN +// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sme2p1 < %s \ +// RUN: | sed '/.text/d' | sed 's/.*encoding: //g' \ +// RUN: | llvm-mc -triple=aarch64 -mattr=+sme2p1 -disassemble -show-encoding \ +// RUN: | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST + + +tblq z0.h, {z0.h}, z0.h // 01000100-01000000-11111000-00000000 +// CHECK-INST: tblq z0.h, { z0.h }, z0.h +// CHECK-ENCODING: [0x00,0xf8,0x40,0x44] +// CHECK-ERROR: instruction requires: sme2p1 or sve2p1 +// CHECK-UNKNOWN: 4440f800 + +tblq z21.h, {z10.h}, z21.h // 01000100-01010101-11111001-01010101 +// CHECK-INST: tblq z21.h, { z10.h }, z21.h +// CHECK-ENCODING: [0x55,0xf9,0x55,0x44] +// CHECK-ERROR: instruction requires: sme2p1 or sve2p1 +// CHECK-UNKNOWN: 4455f955 + +tblq z23.h, {z13.h}, z8.h // 01000100-01001000-11111001-10110111 +// CHECK-INST: tblq z23.h, { z13.h }, z8.h +// CHECK-ENCODING: [0xb7,0xf9,0x48,0x44] +// CHECK-ERROR: instruction requires: sme2p1 or sve2p1 +// CHECK-UNKNOWN: 4448f9b7 + +tblq z31.h, {z31.h}, z31.h // 01000100-01011111-11111011-11111111 +// CHECK-INST: tblq z31.h, { z31.h }, z31.h +// CHECK-ENCODING: [0xff,0xfb,0x5f,0x44] +// CHECK-ERROR: instruction requires: sme2p1 or sve2p1 +// CHECK-UNKNOWN: 445ffbff + + +tblq z0.s, {z0.s}, z0.s // 01000100-10000000-11111000-00000000 +// CHECK-INST: tblq z0.s, { z0.s }, z0.s +// CHECK-ENCODING: [0x00,0xf8,0x80,0x44] +// CHECK-ERROR: instruction requires: sme2p1 or sve2p1 +// CHECK-UNKNOWN: 4480f800 + +tblq z21.s, {z10.s}, z21.s // 01000100-10010101-11111001-01010101 +// CHECK-INST: tblq z21.s, { z10.s }, z21.s +// CHECK-ENCODING: [0x55,0xf9,0x95,0x44] +// CHECK-ERROR: instruction requires: sme2p1 or sve2p1 +// CHECK-UNKNOWN: 4495f955 + +tblq z23.s, {z13.s}, z8.s // 01000100-10001000-11111001-10110111 +// CHECK-INST: tblq z23.s, { z13.s }, z8.s +// CHECK-ENCODING: [0xb7,0xf9,0x88,0x44] +// CHECK-ERROR: instruction requires: sme2p1 or sve2p1 +// CHECK-UNKNOWN: 4488f9b7 + +tblq z31.s, {z31.s}, z31.s // 01000100-10011111-11111011-11111111 +// CHECK-INST: tblq z31.s, { z31.s }, z31.s +// CHECK-ENCODING: [0xff,0xfb,0x9f,0x44] +// CHECK-ERROR: instruction requires: sme2p1 or sve2p1 +// CHECK-UNKNOWN: 449ffbff + + +tblq z0.d, {z0.d}, z0.d // 01000100-11000000-11111000-00000000 +// CHECK-INST: tblq z0.d, { z0.d }, z0.d +// CHECK-ENCODING: [0x00,0xf8,0xc0,0x44] +// CHECK-ERROR: instruction requires: sme2p1 or sve2p1 +// CHECK-UNKNOWN: 44c0f800 + +tblq z21.d, {z10.d}, z21.d // 01000100-11010101-11111001-01010101 +// CHECK-INST: tblq z21.d, { z10.d }, z21.d +// CHECK-ENCODING: [0x55,0xf9,0xd5,0x44] +// CHECK-ERROR: instruction requires: sme2p1 or sve2p1 +// CHECK-UNKNOWN: 44d5f955 + +tblq z23.d, {z13.d}, z8.d // 01000100-11001000-11111001-10110111 +// CHECK-INST: tblq z23.d, { z13.d }, z8.d +// CHECK-ENCODING: [0xb7,0xf9,0xc8,0x44] +// CHECK-ERROR: instruction requires: sme2p1 or sve2p1 +// CHECK-UNKNOWN: 44c8f9b7 + +tblq z31.d, {z31.d}, z31.d // 01000100-11011111-11111011-11111111 +// CHECK-INST: tblq z31.d, { z31.d }, z31.d +// CHECK-ENCODING: [0xff,0xfb,0xdf,0x44] +// CHECK-ERROR: instruction requires: sme2p1 or sve2p1 +// CHECK-UNKNOWN: 44dffbff + + +tblq z0.b, {z0.b}, z0.b // 01000100-00000000-11111000-00000000 +// CHECK-INST: tblq z0.b, { z0.b }, z0.b +// CHECK-ENCODING: [0x00,0xf8,0x00,0x44] +// CHECK-ERROR: instruction requires: sme2p1 or sve2p1 +// CHECK-UNKNOWN: 4400f800 + +tblq z21.b, {z10.b}, z21.b // 01000100-00010101-11111001-01010101 +// CHECK-INST: tblq z21.b, { z10.b }, z21.b +// CHECK-ENCODING: [0x55,0xf9,0x15,0x44] +// CHECK-ERROR: instruction requires: sme2p1 or sve2p1 +// CHECK-UNKNOWN: 4415f955 + +tblq z23.b, {z13.b}, z8.b // 01000100-00001000-11111001-10110111 +// CHECK-INST: tblq z23.b, { z13.b }, z8.b +// CHECK-ENCODING: [0xb7,0xf9,0x08,0x44] +// CHECK-ERROR: instruction requires: sme2p1 or sve2p1 +// CHECK-UNKNOWN: 4408f9b7 + +tblq z31.b, {z31.b}, z31.b // 01000100-00011111-11111011-11111111 +// CHECK-INST: tblq z31.b, { z31.b }, z31.b +// CHECK-ENCODING: [0xff,0xfb,0x1f,0x44] +// CHECK-ERROR: instruction requires: sme2p1 or sve2p1 +// CHECK-UNKNOWN: 441ffbff Index: llvm/test/MC/AArch64/SVE2p1/uzpq1-diagnostics.s =================================================================== --- /dev/null +++ llvm/test/MC/AArch64/SVE2p1/uzpq1-diagnostics.s @@ -0,0 +1,14 @@ +// RUN: not llvm-mc -triple=aarch64 -show-encoding -mattr=+sve2p1 2>&1 < %s | FileCheck %s + +// --------------------------------------------------------------------------// +// Invalid register suffixes + +uzpq1 z0.h, z0.h, z0.s +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: uzpq1 z0.h, z0.h, z0.s +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +uzpq1 z0.d, z0.s, z0.s +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: uzpq1 z0.d, z0.s, z0.s +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: Index: llvm/test/MC/AArch64/SVE2p1/uzpq1.s =================================================================== --- /dev/null +++ llvm/test/MC/AArch64/SVE2p1/uzpq1.s @@ -0,0 +1,115 @@ +// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sme2p1 < %s \ +// RUN: | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST +// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sve2p1 < %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=+sme2p1 < %s \ +// RUN: | llvm-objdump -d --no-print-imm-hex --mattr=+sme2p1 - | FileCheck %s --check-prefix=CHECK-INST +// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sme2p1 < %s \ +// RUN: | llvm-objdump -d --mattr=-sme2p1,-sve2p1 - | FileCheck %s --check-prefix=CHECK-UNKNOWN +// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sme2p1 < %s \ +// RUN: | sed '/.text/d' | sed 's/.*encoding: //g' \ +// RUN: | llvm-mc -triple=aarch64 -mattr=+sme2p1 -disassemble -show-encoding \ +// RUN: | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST + + +uzpq1 z0.h, z0.h, z0.h // 01000100-01000000-11101000-00000000 +// CHECK-INST: uzpq1 z0.h, z0.h, z0.h +// CHECK-ENCODING: [0x00,0xe8,0x40,0x44] +// CHECK-ERROR: instruction requires: sme2p1 or sve2p1 +// CHECK-UNKNOWN: 4440e800 + +uzpq1 z21.h, z10.h, z21.h // 01000100-01010101-11101001-01010101 +// CHECK-INST: uzpq1 z21.h, z10.h, z21.h +// CHECK-ENCODING: [0x55,0xe9,0x55,0x44] +// CHECK-ERROR: instruction requires: sme2p1 or sve2p1 +// CHECK-UNKNOWN: 4455e955 + +uzpq1 z23.h, z13.h, z8.h // 01000100-01001000-11101001-10110111 +// CHECK-INST: uzpq1 z23.h, z13.h, z8.h +// CHECK-ENCODING: [0xb7,0xe9,0x48,0x44] +// CHECK-ERROR: instruction requires: sme2p1 or sve2p1 +// CHECK-UNKNOWN: 4448e9b7 + +uzpq1 z31.h, z31.h, z31.h // 01000100-01011111-11101011-11111111 +// CHECK-INST: uzpq1 z31.h, z31.h, z31.h +// CHECK-ENCODING: [0xff,0xeb,0x5f,0x44] +// CHECK-ERROR: instruction requires: sme2p1 or sve2p1 +// CHECK-UNKNOWN: 445febff + + +uzpq1 z0.s, z0.s, z0.s // 01000100-10000000-11101000-00000000 +// CHECK-INST: uzpq1 z0.s, z0.s, z0.s +// CHECK-ENCODING: [0x00,0xe8,0x80,0x44] +// CHECK-ERROR: instruction requires: sme2p1 or sve2p1 +// CHECK-UNKNOWN: 4480e800 + +uzpq1 z21.s, z10.s, z21.s // 01000100-10010101-11101001-01010101 +// CHECK-INST: uzpq1 z21.s, z10.s, z21.s +// CHECK-ENCODING: [0x55,0xe9,0x95,0x44] +// CHECK-ERROR: instruction requires: sme2p1 or sve2p1 +// CHECK-UNKNOWN: 4495e955 + +uzpq1 z23.s, z13.s, z8.s // 01000100-10001000-11101001-10110111 +// CHECK-INST: uzpq1 z23.s, z13.s, z8.s +// CHECK-ENCODING: [0xb7,0xe9,0x88,0x44] +// CHECK-ERROR: instruction requires: sme2p1 or sve2p1 +// CHECK-UNKNOWN: 4488e9b7 + +uzpq1 z31.s, z31.s, z31.s // 01000100-10011111-11101011-11111111 +// CHECK-INST: uzpq1 z31.s, z31.s, z31.s +// CHECK-ENCODING: [0xff,0xeb,0x9f,0x44] +// CHECK-ERROR: instruction requires: sme2p1 or sve2p1 +// CHECK-UNKNOWN: 449febff + + +uzpq1 z0.d, z0.d, z0.d // 01000100-11000000-11101000-00000000 +// CHECK-INST: uzpq1 z0.d, z0.d, z0.d +// CHECK-ENCODING: [0x00,0xe8,0xc0,0x44] +// CHECK-ERROR: instruction requires: sme2p1 or sve2p1 +// CHECK-UNKNOWN: 44c0e800 + +uzpq1 z21.d, z10.d, z21.d // 01000100-11010101-11101001-01010101 +// CHECK-INST: uzpq1 z21.d, z10.d, z21.d +// CHECK-ENCODING: [0x55,0xe9,0xd5,0x44] +// CHECK-ERROR: instruction requires: sme2p1 or sve2p1 +// CHECK-UNKNOWN: 44d5e955 + +uzpq1 z23.d, z13.d, z8.d // 01000100-11001000-11101001-10110111 +// CHECK-INST: uzpq1 z23.d, z13.d, z8.d +// CHECK-ENCODING: [0xb7,0xe9,0xc8,0x44] +// CHECK-ERROR: instruction requires: sme2p1 or sve2p1 +// CHECK-UNKNOWN: 44c8e9b7 + +uzpq1 z31.d, z31.d, z31.d // 01000100-11011111-11101011-11111111 +// CHECK-INST: uzpq1 z31.d, z31.d, z31.d +// CHECK-ENCODING: [0xff,0xeb,0xdf,0x44] +// CHECK-ERROR: instruction requires: sme2p1 or sve2p1 +// CHECK-UNKNOWN: 44dfebff + + +uzpq1 z0.b, z0.b, z0.b // 01000100-00000000-11101000-00000000 +// CHECK-INST: uzpq1 z0.b, z0.b, z0.b +// CHECK-ENCODING: [0x00,0xe8,0x00,0x44] +// CHECK-ERROR: instruction requires: sme2p1 or sve2p1 +// CHECK-UNKNOWN: 4400e800 + +uzpq1 z21.b, z10.b, z21.b // 01000100-00010101-11101001-01010101 +// CHECK-INST: uzpq1 z21.b, z10.b, z21.b +// CHECK-ENCODING: [0x55,0xe9,0x15,0x44] +// CHECK-ERROR: instruction requires: sme2p1 or sve2p1 +// CHECK-UNKNOWN: 4415e955 + +uzpq1 z23.b, z13.b, z8.b // 01000100-00001000-11101001-10110111 +// CHECK-INST: uzpq1 z23.b, z13.b, z8.b +// CHECK-ENCODING: [0xb7,0xe9,0x08,0x44] +// CHECK-ERROR: instruction requires: sme2p1 or sve2p1 +// CHECK-UNKNOWN: 4408e9b7 + +uzpq1 z31.b, z31.b, z31.b // 01000100-00011111-11101011-11111111 +// CHECK-INST: uzpq1 z31.b, z31.b, z31.b +// CHECK-ENCODING: [0xff,0xeb,0x1f,0x44] +// CHECK-ERROR: instruction requires: sme2p1 or sve2p1 +// CHECK-UNKNOWN: 441febff + Index: llvm/test/MC/AArch64/SVE2p1/uzpq2-diagnostics.s =================================================================== --- /dev/null +++ llvm/test/MC/AArch64/SVE2p1/uzpq2-diagnostics.s @@ -0,0 +1,14 @@ +// RUN: not llvm-mc -triple=aarch64 -show-encoding -mattr=+sve2p1 2>&1 < %s | FileCheck %s + +// --------------------------------------------------------------------------// +// Invalid register suffixes + +uzpq2 z0.h, z0.h, z0.s +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: uzpq2 z0.h, z0.h, z0.s +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +uzpq2 z0.d, z0.s, z0.s +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: uzpq2 z0.d, z0.s, z0.s +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: Index: llvm/test/MC/AArch64/SVE2p1/uzpq2.s =================================================================== --- /dev/null +++ llvm/test/MC/AArch64/SVE2p1/uzpq2.s @@ -0,0 +1,115 @@ +// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sme2p1 < %s \ +// RUN: | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST +// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sve2p1 < %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=+sme2p1 < %s \ +// RUN: | llvm-objdump -d --no-print-imm-hex --mattr=+sme2p1 - | FileCheck %s --check-prefix=CHECK-INST +// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sme2p1 < %s \ +// RUN: | llvm-objdump -d --mattr=-sme2p1,-sve2p1 - | FileCheck %s --check-prefix=CHECK-UNKNOWN +// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sme2p1 < %s \ +// RUN: | sed '/.text/d' | sed 's/.*encoding: //g' \ +// RUN: | llvm-mc -triple=aarch64 -mattr=+sme2p1 -disassemble -show-encoding \ +// RUN: | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST + + +uzpq2 z0.h, z0.h, z0.h // 01000100-01000000-11101100-00000000 +// CHECK-INST: uzpq2 z0.h, z0.h, z0.h +// CHECK-ENCODING: [0x00,0xec,0x40,0x44] +// CHECK-ERROR: instruction requires: sme2p1 or sve2p1 +// CHECK-UNKNOWN: 4440ec00 + +uzpq2 z21.h, z10.h, z21.h // 01000100-01010101-11101101-01010101 +// CHECK-INST: uzpq2 z21.h, z10.h, z21.h +// CHECK-ENCODING: [0x55,0xed,0x55,0x44] +// CHECK-ERROR: instruction requires: sme2p1 or sve2p1 +// CHECK-UNKNOWN: 4455ed55 + +uzpq2 z23.h, z13.h, z8.h // 01000100-01001000-11101101-10110111 +// CHECK-INST: uzpq2 z23.h, z13.h, z8.h +// CHECK-ENCODING: [0xb7,0xed,0x48,0x44] +// CHECK-ERROR: instruction requires: sme2p1 or sve2p1 +// CHECK-UNKNOWN: 4448edb7 + +uzpq2 z31.h, z31.h, z31.h // 01000100-01011111-11101111-11111111 +// CHECK-INST: uzpq2 z31.h, z31.h, z31.h +// CHECK-ENCODING: [0xff,0xef,0x5f,0x44] +// CHECK-ERROR: instruction requires: sme2p1 or sve2p1 +// CHECK-UNKNOWN: 445fefff + + +uzpq2 z0.s, z0.s, z0.s // 01000100-10000000-11101100-00000000 +// CHECK-INST: uzpq2 z0.s, z0.s, z0.s +// CHECK-ENCODING: [0x00,0xec,0x80,0x44] +// CHECK-ERROR: instruction requires: sme2p1 or sve2p1 +// CHECK-UNKNOWN: 4480ec00 + +uzpq2 z21.s, z10.s, z21.s // 01000100-10010101-11101101-01010101 +// CHECK-INST: uzpq2 z21.s, z10.s, z21.s +// CHECK-ENCODING: [0x55,0xed,0x95,0x44] +// CHECK-ERROR: instruction requires: sme2p1 or sve2p1 +// CHECK-UNKNOWN: 4495ed55 + +uzpq2 z23.s, z13.s, z8.s // 01000100-10001000-11101101-10110111 +// CHECK-INST: uzpq2 z23.s, z13.s, z8.s +// CHECK-ENCODING: [0xb7,0xed,0x88,0x44] +// CHECK-ERROR: instruction requires: sme2p1 or sve2p1 +// CHECK-UNKNOWN: 4488edb7 + +uzpq2 z31.s, z31.s, z31.s // 01000100-10011111-11101111-11111111 +// CHECK-INST: uzpq2 z31.s, z31.s, z31.s +// CHECK-ENCODING: [0xff,0xef,0x9f,0x44] +// CHECK-ERROR: instruction requires: sme2p1 or sve2p1 +// CHECK-UNKNOWN: 449fefff + + +uzpq2 z0.d, z0.d, z0.d // 01000100-11000000-11101100-00000000 +// CHECK-INST: uzpq2 z0.d, z0.d, z0.d +// CHECK-ENCODING: [0x00,0xec,0xc0,0x44] +// CHECK-ERROR: instruction requires: sme2p1 or sve2p1 +// CHECK-UNKNOWN: 44c0ec00 + +uzpq2 z21.d, z10.d, z21.d // 01000100-11010101-11101101-01010101 +// CHECK-INST: uzpq2 z21.d, z10.d, z21.d +// CHECK-ENCODING: [0x55,0xed,0xd5,0x44] +// CHECK-ERROR: instruction requires: sme2p1 or sve2p1 +// CHECK-UNKNOWN: 44d5ed55 + +uzpq2 z23.d, z13.d, z8.d // 01000100-11001000-11101101-10110111 +// CHECK-INST: uzpq2 z23.d, z13.d, z8.d +// CHECK-ENCODING: [0xb7,0xed,0xc8,0x44] +// CHECK-ERROR: instruction requires: sme2p1 or sve2p1 +// CHECK-UNKNOWN: 44c8edb7 + +uzpq2 z31.d, z31.d, z31.d // 01000100-11011111-11101111-11111111 +// CHECK-INST: uzpq2 z31.d, z31.d, z31.d +// CHECK-ENCODING: [0xff,0xef,0xdf,0x44] +// CHECK-ERROR: instruction requires: sme2p1 or sve2p1 +// CHECK-UNKNOWN: 44dfefff + + +uzpq2 z0.b, z0.b, z0.b // 01000100-00000000-11101100-00000000 +// CHECK-INST: uzpq2 z0.b, z0.b, z0.b +// CHECK-ENCODING: [0x00,0xec,0x00,0x44] +// CHECK-ERROR: instruction requires: sme2p1 or sve2p1 +// CHECK-UNKNOWN: 4400ec00 + +uzpq2 z21.b, z10.b, z21.b // 01000100-00010101-11101101-01010101 +// CHECK-INST: uzpq2 z21.b, z10.b, z21.b +// CHECK-ENCODING: [0x55,0xed,0x15,0x44] +// CHECK-ERROR: instruction requires: sme2p1 or sve2p1 +// CHECK-UNKNOWN: 4415ed55 + +uzpq2 z23.b, z13.b, z8.b // 01000100-00001000-11101101-10110111 +// CHECK-INST: uzpq2 z23.b, z13.b, z8.b +// CHECK-ENCODING: [0xb7,0xed,0x08,0x44] +// CHECK-ERROR: instruction requires: sme2p1 or sve2p1 +// CHECK-UNKNOWN: 4408edb7 + +uzpq2 z31.b, z31.b, z31.b // 01000100-00011111-11101111-11111111 +// CHECK-INST: uzpq2 z31.b, z31.b, z31.b +// CHECK-ENCODING: [0xff,0xef,0x1f,0x44] +// CHECK-ERROR: instruction requires: sme2p1 or sve2p1 +// CHECK-UNKNOWN: 441fefff + Index: llvm/test/MC/AArch64/SVE2p1/zipq1-diagnostics.s =================================================================== --- /dev/null +++ llvm/test/MC/AArch64/SVE2p1/zipq1-diagnostics.s @@ -0,0 +1,14 @@ +// RUN: not llvm-mc -triple=aarch64 -show-encoding -mattr=+sve2p1 2>&1 < %s | FileCheck %s + +// --------------------------------------------------------------------------// +// Invalid register suffixes + +zipq1 z0.h, z0.h, z0.s +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: zipq1 z0.h, z0.h, z0.s +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +zipq1 z0.d, z0.s, z0.s +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: zipq1 z0.d, z0.s, z0.s +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: Index: llvm/test/MC/AArch64/SVE2p1/zipq1.s =================================================================== --- /dev/null +++ llvm/test/MC/AArch64/SVE2p1/zipq1.s @@ -0,0 +1,115 @@ +// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sme2p1 < %s \ +// RUN: | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST +// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sve2p1 < %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=+sme2p1 < %s \ +// RUN: | llvm-objdump -d --no-print-imm-hex --mattr=+sme2p1 - | FileCheck %s --check-prefix=CHECK-INST +// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sme2p1 < %s \ +// RUN: | llvm-objdump -d --mattr=-sme2p1,-sve2p1 - | FileCheck %s --check-prefix=CHECK-UNKNOWN +// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sme2p1 < %s \ +// RUN: | sed '/.text/d' | sed 's/.*encoding: //g' \ +// RUN: | llvm-mc -triple=aarch64 -mattr=+sme2p1 -disassemble -show-encoding \ +// RUN: | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST + + +zipq1 z0.h, z0.h, z0.h // 01000100-01000000-11100000-00000000 +// CHECK-INST: zipq1 z0.h, z0.h, z0.h +// CHECK-ENCODING: [0x00,0xe0,0x40,0x44] +// CHECK-ERROR: instruction requires: sme2p1 or sve2p1 +// CHECK-UNKNOWN: 4440e000 + +zipq1 z21.h, z10.h, z21.h // 01000100-01010101-11100001-01010101 +// CHECK-INST: zipq1 z21.h, z10.h, z21.h +// CHECK-ENCODING: [0x55,0xe1,0x55,0x44] +// CHECK-ERROR: instruction requires: sme2p1 or sve2p1 +// CHECK-UNKNOWN: 4455e155 + +zipq1 z23.h, z13.h, z8.h // 01000100-01001000-11100001-10110111 +// CHECK-INST: zipq1 z23.h, z13.h, z8.h +// CHECK-ENCODING: [0xb7,0xe1,0x48,0x44] +// CHECK-ERROR: instruction requires: sme2p1 or sve2p1 +// CHECK-UNKNOWN: 4448e1b7 + +zipq1 z31.h, z31.h, z31.h // 01000100-01011111-11100011-11111111 +// CHECK-INST: zipq1 z31.h, z31.h, z31.h +// CHECK-ENCODING: [0xff,0xe3,0x5f,0x44] +// CHECK-ERROR: instruction requires: sme2p1 or sve2p1 +// CHECK-UNKNOWN: 445fe3ff + + +zipq1 z0.s, z0.s, z0.s // 01000100-10000000-11100000-00000000 +// CHECK-INST: zipq1 z0.s, z0.s, z0.s +// CHECK-ENCODING: [0x00,0xe0,0x80,0x44] +// CHECK-ERROR: instruction requires: sme2p1 or sve2p1 +// CHECK-UNKNOWN: 4480e000 + +zipq1 z21.s, z10.s, z21.s // 01000100-10010101-11100001-01010101 +// CHECK-INST: zipq1 z21.s, z10.s, z21.s +// CHECK-ENCODING: [0x55,0xe1,0x95,0x44] +// CHECK-ERROR: instruction requires: sme2p1 or sve2p1 +// CHECK-UNKNOWN: 4495e155 + +zipq1 z23.s, z13.s, z8.s // 01000100-10001000-11100001-10110111 +// CHECK-INST: zipq1 z23.s, z13.s, z8.s +// CHECK-ENCODING: [0xb7,0xe1,0x88,0x44] +// CHECK-ERROR: instruction requires: sme2p1 or sve2p1 +// CHECK-UNKNOWN: 4488e1b7 + +zipq1 z31.s, z31.s, z31.s // 01000100-10011111-11100011-11111111 +// CHECK-INST: zipq1 z31.s, z31.s, z31.s +// CHECK-ENCODING: [0xff,0xe3,0x9f,0x44] +// CHECK-ERROR: instruction requires: sme2p1 or sve2p1 +// CHECK-UNKNOWN: 449fe3ff + + +zipq1 z0.d, z0.d, z0.d // 01000100-11000000-11100000-00000000 +// CHECK-INST: zipq1 z0.d, z0.d, z0.d +// CHECK-ENCODING: [0x00,0xe0,0xc0,0x44] +// CHECK-ERROR: instruction requires: sme2p1 or sve2p1 +// CHECK-UNKNOWN: 44c0e000 + +zipq1 z21.d, z10.d, z21.d // 01000100-11010101-11100001-01010101 +// CHECK-INST: zipq1 z21.d, z10.d, z21.d +// CHECK-ENCODING: [0x55,0xe1,0xd5,0x44] +// CHECK-ERROR: instruction requires: sme2p1 or sve2p1 +// CHECK-UNKNOWN: 44d5e155 + +zipq1 z23.d, z13.d, z8.d // 01000100-11001000-11100001-10110111 +// CHECK-INST: zipq1 z23.d, z13.d, z8.d +// CHECK-ENCODING: [0xb7,0xe1,0xc8,0x44] +// CHECK-ERROR: instruction requires: sme2p1 or sve2p1 +// CHECK-UNKNOWN: 44c8e1b7 + +zipq1 z31.d, z31.d, z31.d // 01000100-11011111-11100011-11111111 +// CHECK-INST: zipq1 z31.d, z31.d, z31.d +// CHECK-ENCODING: [0xff,0xe3,0xdf,0x44] +// CHECK-ERROR: instruction requires: sme2p1 or sve2p1 +// CHECK-UNKNOWN: 44dfe3ff + + +zipq1 z0.b, z0.b, z0.b // 01000100-00000000-11100000-00000000 +// CHECK-INST: zipq1 z0.b, z0.b, z0.b +// CHECK-ENCODING: [0x00,0xe0,0x00,0x44] +// CHECK-ERROR: instruction requires: sme2p1 or sve2p1 +// CHECK-UNKNOWN: 4400e000 + +zipq1 z21.b, z10.b, z21.b // 01000100-00010101-11100001-01010101 +// CHECK-INST: zipq1 z21.b, z10.b, z21.b +// CHECK-ENCODING: [0x55,0xe1,0x15,0x44] +// CHECK-ERROR: instruction requires: sme2p1 or sve2p1 +// CHECK-UNKNOWN: 4415e155 + +zipq1 z23.b, z13.b, z8.b // 01000100-00001000-11100001-10110111 +// CHECK-INST: zipq1 z23.b, z13.b, z8.b +// CHECK-ENCODING: [0xb7,0xe1,0x08,0x44] +// CHECK-ERROR: instruction requires: sme2p1 or sve2p1 +// CHECK-UNKNOWN: 4408e1b7 + +zipq1 z31.b, z31.b, z31.b // 01000100-00011111-11100011-11111111 +// CHECK-INST: zipq1 z31.b, z31.b, z31.b +// CHECK-ENCODING: [0xff,0xe3,0x1f,0x44] +// CHECK-ERROR: instruction requires: sme2p1 or sve2p1 +// CHECK-UNKNOWN: 441fe3ff + Index: llvm/test/MC/AArch64/SVE2p1/zipq2-diagnostics.s =================================================================== --- /dev/null +++ llvm/test/MC/AArch64/SVE2p1/zipq2-diagnostics.s @@ -0,0 +1,14 @@ +// RUN: not llvm-mc -triple=aarch64 -show-encoding -mattr=+sve2p1 2>&1 < %s | FileCheck %s + +// --------------------------------------------------------------------------// +// Invalid register suffixes + +zipq2 z0.h, z0.h, z0.s +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: zipq2 z0.h, z0.h, z0.s +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +zipq2 z0.d, z0.s, z0.s +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: zipq2 z0.d, z0.s, z0.s +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: Index: llvm/test/MC/AArch64/SVE2p1/zipq2.s =================================================================== --- /dev/null +++ llvm/test/MC/AArch64/SVE2p1/zipq2.s @@ -0,0 +1,115 @@ +// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sme2p1 < %s \ +// RUN: | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST +// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sve2p1 < %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=+sme2p1 < %s \ +// RUN: | llvm-objdump -d --no-print-imm-hex --mattr=+sme2p1 - | FileCheck %s --check-prefix=CHECK-INST +// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sme2p1 < %s \ +// RUN: | llvm-objdump -d --mattr=-sme2p1,-sve2p1 - | FileCheck %s --check-prefix=CHECK-UNKNOWN +// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sme2p1 < %s \ +// RUN: | sed '/.text/d' | sed 's/.*encoding: //g' \ +// RUN: | llvm-mc -triple=aarch64 -mattr=+sme2p1 -disassemble -show-encoding \ +// RUN: | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST + + +zipq2 z0.h, z0.h, z0.h // 01000100-01000000-11100100-00000000 +// CHECK-INST: zipq2 z0.h, z0.h, z0.h +// CHECK-ENCODING: [0x00,0xe4,0x40,0x44] +// CHECK-ERROR: instruction requires: sme2p1 or sve2p1 +// CHECK-UNKNOWN: 4440e400 + +zipq2 z21.h, z10.h, z21.h // 01000100-01010101-11100101-01010101 +// CHECK-INST: zipq2 z21.h, z10.h, z21.h +// CHECK-ENCODING: [0x55,0xe5,0x55,0x44] +// CHECK-ERROR: instruction requires: sme2p1 or sve2p1 +// CHECK-UNKNOWN: 4455e555 + +zipq2 z23.h, z13.h, z8.h // 01000100-01001000-11100101-10110111 +// CHECK-INST: zipq2 z23.h, z13.h, z8.h +// CHECK-ENCODING: [0xb7,0xe5,0x48,0x44] +// CHECK-ERROR: instruction requires: sme2p1 or sve2p1 +// CHECK-UNKNOWN: 4448e5b7 + +zipq2 z31.h, z31.h, z31.h // 01000100-01011111-11100111-11111111 +// CHECK-INST: zipq2 z31.h, z31.h, z31.h +// CHECK-ENCODING: [0xff,0xe7,0x5f,0x44] +// CHECK-ERROR: instruction requires: sme2p1 or sve2p1 +// CHECK-UNKNOWN: 445fe7ff + + +zipq2 z0.s, z0.s, z0.s // 01000100-10000000-11100100-00000000 +// CHECK-INST: zipq2 z0.s, z0.s, z0.s +// CHECK-ENCODING: [0x00,0xe4,0x80,0x44] +// CHECK-ERROR: instruction requires: sme2p1 or sve2p1 +// CHECK-UNKNOWN: 4480e400 + +zipq2 z21.s, z10.s, z21.s // 01000100-10010101-11100101-01010101 +// CHECK-INST: zipq2 z21.s, z10.s, z21.s +// CHECK-ENCODING: [0x55,0xe5,0x95,0x44] +// CHECK-ERROR: instruction requires: sme2p1 or sve2p1 +// CHECK-UNKNOWN: 4495e555 + +zipq2 z23.s, z13.s, z8.s // 01000100-10001000-11100101-10110111 +// CHECK-INST: zipq2 z23.s, z13.s, z8.s +// CHECK-ENCODING: [0xb7,0xe5,0x88,0x44] +// CHECK-ERROR: instruction requires: sme2p1 or sve2p1 +// CHECK-UNKNOWN: 4488e5b7 + +zipq2 z31.s, z31.s, z31.s // 01000100-10011111-11100111-11111111 +// CHECK-INST: zipq2 z31.s, z31.s, z31.s +// CHECK-ENCODING: [0xff,0xe7,0x9f,0x44] +// CHECK-ERROR: instruction requires: sme2p1 or sve2p1 +// CHECK-UNKNOWN: 449fe7ff + + +zipq2 z0.d, z0.d, z0.d // 01000100-11000000-11100100-00000000 +// CHECK-INST: zipq2 z0.d, z0.d, z0.d +// CHECK-ENCODING: [0x00,0xe4,0xc0,0x44] +// CHECK-ERROR: instruction requires: sme2p1 or sve2p1 +// CHECK-UNKNOWN: 44c0e400 + +zipq2 z21.d, z10.d, z21.d // 01000100-11010101-11100101-01010101 +// CHECK-INST: zipq2 z21.d, z10.d, z21.d +// CHECK-ENCODING: [0x55,0xe5,0xd5,0x44] +// CHECK-ERROR: instruction requires: sme2p1 or sve2p1 +// CHECK-UNKNOWN: 44d5e555 + +zipq2 z23.d, z13.d, z8.d // 01000100-11001000-11100101-10110111 +// CHECK-INST: zipq2 z23.d, z13.d, z8.d +// CHECK-ENCODING: [0xb7,0xe5,0xc8,0x44] +// CHECK-ERROR: instruction requires: sme2p1 or sve2p1 +// CHECK-UNKNOWN: 44c8e5b7 + +zipq2 z31.d, z31.d, z31.d // 01000100-11011111-11100111-11111111 +// CHECK-INST: zipq2 z31.d, z31.d, z31.d +// CHECK-ENCODING: [0xff,0xe7,0xdf,0x44] +// CHECK-ERROR: instruction requires: sme2p1 or sve2p1 +// CHECK-UNKNOWN: 44dfe7ff + + +zipq2 z0.b, z0.b, z0.b // 01000100-00000000-11100100-00000000 +// CHECK-INST: zipq2 z0.b, z0.b, z0.b +// CHECK-ENCODING: [0x00,0xe4,0x00,0x44] +// CHECK-ERROR: instruction requires: sme2p1 or sve2p1 +// CHECK-UNKNOWN: 4400e400 + +zipq2 z21.b, z10.b, z21.b // 01000100-00010101-11100101-01010101 +// CHECK-INST: zipq2 z21.b, z10.b, z21.b +// CHECK-ENCODING: [0x55,0xe5,0x15,0x44] +// CHECK-ERROR: instruction requires: sme2p1 or sve2p1 +// CHECK-UNKNOWN: 4415e555 + +zipq2 z23.b, z13.b, z8.b // 01000100-00001000-11100101-10110111 +// CHECK-INST: zipq2 z23.b, z13.b, z8.b +// CHECK-ENCODING: [0xb7,0xe5,0x08,0x44] +// CHECK-ERROR: instruction requires: sme2p1 or sve2p1 +// CHECK-UNKNOWN: 4408e5b7 + +zipq2 z31.b, z31.b, z31.b // 01000100-00011111-11100111-11111111 +// CHECK-INST: zipq2 z31.b, z31.b, z31.b +// CHECK-ENCODING: [0xff,0xe7,0x1f,0x44] +// CHECK-ERROR: instruction requires: sme2p1 or sve2p1 +// CHECK-UNKNOWN: 441fe7ff +