Index: llvm/trunk/lib/Target/AArch64/AArch64SVEInstrInfo.td =================================================================== --- llvm/trunk/lib/Target/AArch64/AArch64SVEInstrInfo.td +++ llvm/trunk/lib/Target/AArch64/AArch64SVEInstrInfo.td @@ -1228,6 +1228,42 @@ defm SBCLB_ZZZ : sve2_int_addsub_long_carry<0b10, "sbclb">; defm SBCLT_ZZZ : sve2_int_addsub_long_carry<0b11, "sbclt">; + // SVE2 bitwise shift right narrow + defm SQSHRUNB_ZZI : sve2_int_bin_cons_shift_imm_right_narrow<0b0000, "sqshrunb">; + defm SQSHRUNT_ZZI : sve2_int_bin_cons_shift_imm_right_narrow<0b0001, "sqshrunt">; + defm SQRSHRUNB_ZZI : sve2_int_bin_cons_shift_imm_right_narrow<0b0010, "sqrshrunb">; + defm SQRSHRUNT_ZZI : sve2_int_bin_cons_shift_imm_right_narrow<0b0011, "sqrshrunt">; + defm SHRNB_ZZI : sve2_int_bin_cons_shift_imm_right_narrow<0b0100, "shrnb">; + defm SHRNT_ZZI : sve2_int_bin_cons_shift_imm_right_narrow<0b0101, "shrnt">; + defm RSHRNB_ZZI : sve2_int_bin_cons_shift_imm_right_narrow<0b0110, "rshrnb">; + defm RSHRNT_ZZI : sve2_int_bin_cons_shift_imm_right_narrow<0b0111, "rshrnt">; + defm SQSHRNB_ZZI : sve2_int_bin_cons_shift_imm_right_narrow<0b1000, "sqshrnb">; + defm SQSHRNT_ZZI : sve2_int_bin_cons_shift_imm_right_narrow<0b1001, "sqshrnt">; + defm SQRSHRNB_ZZI : sve2_int_bin_cons_shift_imm_right_narrow<0b1010, "sqrshrnb">; + defm SQRSHRNT_ZZI : sve2_int_bin_cons_shift_imm_right_narrow<0b1011, "sqrshrnt">; + defm UQSHRNB_ZZI : sve2_int_bin_cons_shift_imm_right_narrow<0b1100, "uqshrnb">; + defm UQSHRNT_ZZI : sve2_int_bin_cons_shift_imm_right_narrow<0b1101, "uqshrnt">; + defm UQRSHRNB_ZZI : sve2_int_bin_cons_shift_imm_right_narrow<0b1110, "uqrshrnb">; + defm UQRSHRNT_ZZI : sve2_int_bin_cons_shift_imm_right_narrow<0b1111, "uqrshrnt">; + + // SVE2 integer add/subtract narrow high part + defm ADDHNB_ZZZ : sve2_int_addsub_narrow_high<0b000, "addhnb">; + defm ADDHNT_ZZZ : sve2_int_addsub_narrow_high<0b001, "addhnt">; + defm RADDHNB_ZZZ : sve2_int_addsub_narrow_high<0b010, "raddhnb">; + defm RADDHNT_ZZZ : sve2_int_addsub_narrow_high<0b011, "raddhnt">; + defm SUBHNB_ZZZ : sve2_int_addsub_narrow_high<0b100, "subhnb">; + defm SUBHNT_ZZZ : sve2_int_addsub_narrow_high<0b101, "subhnt">; + defm RSUBHNB_ZZZ : sve2_int_addsub_narrow_high<0b110, "rsubhnb">; + defm RSUBHNT_ZZZ : sve2_int_addsub_narrow_high<0b111, "rsubhnt">; + + // SVE2 saturating extract narrow + defm SQXTNB_ZZ : sve2_int_sat_extract_narrow<0b000, "sqxtnb">; + defm SQXTNT_ZZ : sve2_int_sat_extract_narrow<0b001, "sqxtnt">; + defm UQXTNB_ZZ : sve2_int_sat_extract_narrow<0b010, "uqxtnb">; + defm UQXTNT_ZZ : sve2_int_sat_extract_narrow<0b011, "uqxtnt">; + defm SQXTUNB_ZZ : sve2_int_sat_extract_narrow<0b100, "sqxtunb">; + defm SQXTUNT_ZZ : sve2_int_sat_extract_narrow<0b101, "sqxtunt">; + // Predicated shifts defm SQSHL_ZPmI : sve_int_bin_pred_shift_imm_left< 0b0110, "sqshl">; defm UQSHL_ZPmI : sve_int_bin_pred_shift_imm_left< 0b0111, "uqshl">; Index: llvm/trunk/lib/Target/AArch64/SVEInstrFormats.td =================================================================== --- llvm/trunk/lib/Target/AArch64/SVEInstrFormats.td +++ llvm/trunk/lib/Target/AArch64/SVEInstrFormats.td @@ -2348,6 +2348,88 @@ } //===----------------------------------------------------------------------===// +// SVE2 Narrowing Group +//===----------------------------------------------------------------------===// + +class sve2_int_bin_cons_shift_imm_narrow tsz8_64, bits<4> opc, + string asm, ZPRRegOp zprty1, + ZPRRegOp zprty2, Operand immtype> +: I<(outs zprty1:$Zd), (ins zprty2:$Zn, immtype:$imm), + asm, "\t$Zd, $Zn, $imm", + "", []>, Sched<[]> { + bits<5> Zd; + bits<5> Zn; + bits<5> imm; + let Inst{31-23} = 0b010001010; + let Inst{22} = tsz8_64{2}; + let Inst{21} = 0b1; + let Inst{20-19} = tsz8_64{1-0}; + let Inst{18-16} = imm{2-0}; // imm3 + let Inst{15-14} = 0b00; + let Inst{13-10} = opc; + let Inst{9-5} = Zn; + let Inst{4-0} = Zd; +} + +multiclass sve2_int_bin_cons_shift_imm_right_narrow opc, string asm> { + def _B : sve2_int_bin_cons_shift_imm_narrow<{0,0,1}, opc, asm, ZPR8, ZPR16, + vecshiftR8>; + def _H : sve2_int_bin_cons_shift_imm_narrow<{0,1,?}, opc, asm, ZPR16, ZPR32, + vecshiftR16> { + let Inst{19} = imm{3}; + } + def _S : sve2_int_bin_cons_shift_imm_narrow<{1,?,?}, opc, asm, ZPR32, ZPR64, + vecshiftR32> { + let Inst{20-19} = imm{4-3}; + } +} + +class sve2_int_addsub_narrow_high sz, bits<3> opc, string asm, + ZPRRegOp zprty1, ZPRRegOp zprty2> +: I<(outs zprty1:$Zd), (ins zprty2:$Zn, zprty2:$Zm), + asm, "\t$Zd, $Zn, $Zm", "", []>, Sched<[]> { + bits<5> Zd; + bits<5> Zn; + bits<5> Zm; + let Inst{31-24} = 0b01000101; + let Inst{23-22} = sz; + let Inst{21} = 0b1; + let Inst{20-16} = Zm; + let Inst{15-13} = 0b011; + let Inst{12-10} = opc; // S, R, T + let Inst{9-5} = Zn; + let Inst{4-0} = Zd; +} + +multiclass sve2_int_addsub_narrow_high opc, string asm> { + def _B : sve2_int_addsub_narrow_high<0b01, opc, asm, ZPR8, ZPR16>; + def _H : sve2_int_addsub_narrow_high<0b10, opc, asm, ZPR16, ZPR32>; + def _S : sve2_int_addsub_narrow_high<0b11, opc, asm, ZPR32, ZPR64>; +} + +class sve2_int_sat_extract_narrow tsz8_64, bits<3> opc, string asm, + ZPRRegOp zprty1, ZPRRegOp zprty2> +: I<(outs zprty1:$Zd), (ins zprty2:$Zn), + asm, "\t$Zd, $Zn", "", []>, Sched<[]> { + bits<5> Zd; + bits<5> Zn; + let Inst{31-23} = 0b010001010; + let Inst{22} = tsz8_64{2}; + let Inst{21} = 0b1; + let Inst{20-19} = tsz8_64{1-0}; + let Inst{18-13} = 0b000010; + let Inst{12-10} = opc; + let Inst{9-5} = Zn; + let Inst{4-0} = Zd; +} + +multiclass sve2_int_sat_extract_narrow opc, string asm> { + def _B : sve2_int_sat_extract_narrow<0b001, opc, asm, ZPR8, ZPR16>; + def _H : sve2_int_sat_extract_narrow<0b010, opc, asm, ZPR16, ZPR32>; + def _S : sve2_int_sat_extract_narrow<0b100, opc, asm, ZPR32, ZPR64>; +} + +//===----------------------------------------------------------------------===// // SVE Integer Arithmetic - Unary Predicated Group //===----------------------------------------------------------------------===// Index: llvm/trunk/test/MC/AArch64/SVE2/addhnb-diagnostics.s =================================================================== --- llvm/trunk/test/MC/AArch64/SVE2/addhnb-diagnostics.s +++ llvm/trunk/test/MC/AArch64/SVE2/addhnb-diagnostics.s @@ -0,0 +1,40 @@ +// RUN: not llvm-mc -triple=aarch64 -show-encoding -mattr=+sve2 2>&1 < %s| FileCheck %s + + +// ------------------------------------------------------------------------- // +// Invalid element width + +addhnb z0.b, z1.b, z2.b +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: addhnb z0.b, z1.b, z2.b +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +addhnb z0.h, z1.h, z2.h +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: addhnb z0.h, z1.h, z2.h +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +addhnb z0.s, z1.s, z2.s +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: addhnb z0.s, z1.s, z2.s +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +addhnb z0.d, z1.d, z2.d +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: addhnb z0.d, z1.d, z2.d +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +// --------------------------------------------------------------------------// +// Negative tests for instructions that are incompatible with movprfx + +movprfx z0, z7 +addhnb z0.s, z1.d, z31.d +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a movprfx, suggest replacing movprfx with mov +// CHECK-NEXT: addhnb z0.s, z1.d, z31.d +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +movprfx z0.s, p0/z, z7.s +addhnb z0.s, z1.d, z31.d +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a movprfx, suggest replacing movprfx with mov +// CHECK-NEXT: addhnb z0.s, z1.d, z31.d +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: Index: llvm/trunk/test/MC/AArch64/SVE2/addhnb.s =================================================================== --- llvm/trunk/test/MC/AArch64/SVE2/addhnb.s +++ llvm/trunk/test/MC/AArch64/SVE2/addhnb.s @@ -0,0 +1,27 @@ +// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sve2 < %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=+sve2 < %s \ +// RUN: | llvm-objdump -d -mattr=+sve2 - | FileCheck %s --check-prefix=CHECK-INST +// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sve2 < %s \ +// RUN: | llvm-objdump -d - | FileCheck %s --check-prefix=CHECK-UNKNOWN + + +addhnb z0.b, z1.h, z31.h +// CHECK-INST: addhnb z0.b, z1.h, z31.h +// CHECK-ENCODING: [0x20,0x60,0x7f,0x45] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: 20 60 7f 45 + +addhnb z0.h, z1.s, z31.s +// CHECK-INST: addhnb z0.h, z1.s, z31.s +// CHECK-ENCODING: [0x20,0x60,0xbf,0x45] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: 20 60 bf 45 + +addhnb z0.s, z1.d, z31.d +// CHECK-INST: addhnb z0.s, z1.d, z31.d +// CHECK-ENCODING: [0x20,0x60,0xff,0x45] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: 20 60 ff 45 Index: llvm/trunk/test/MC/AArch64/SVE2/addhnt-diagnostics.s =================================================================== --- llvm/trunk/test/MC/AArch64/SVE2/addhnt-diagnostics.s +++ llvm/trunk/test/MC/AArch64/SVE2/addhnt-diagnostics.s @@ -0,0 +1,40 @@ +// RUN: not llvm-mc -triple=aarch64 -show-encoding -mattr=+sve2 2>&1 < %s| FileCheck %s + + +// ------------------------------------------------------------------------- // +// Invalid element width + +addhnt z0.b, z1.b, z2.b +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: addhnt z0.b, z1.b, z2.b +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +addhnt z0.h, z1.h, z2.h +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: addhnt z0.h, z1.h, z2.h +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +addhnt z0.s, z1.s, z2.s +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: addhnt z0.s, z1.s, z2.s +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +addhnt z0.d, z1.d, z2.d +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: addhnt z0.d, z1.d, z2.d +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +// --------------------------------------------------------------------------// +// Negative tests for instructions that are incompatible with movprfx + +movprfx z0, z7 +addhnt z0.s, z1.d, z31.d +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a movprfx, suggest replacing movprfx with mov +// CHECK-NEXT: addhnt z0.s, z1.d, z31.d +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +movprfx z0.s, p0/z, z7.s +addhnt z0.s, z1.d, z31.d +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a movprfx, suggest replacing movprfx with mov +// CHECK-NEXT: addhnt z0.s, z1.d, z31.d +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: Index: llvm/trunk/test/MC/AArch64/SVE2/addhnt.s =================================================================== --- llvm/trunk/test/MC/AArch64/SVE2/addhnt.s +++ llvm/trunk/test/MC/AArch64/SVE2/addhnt.s @@ -0,0 +1,27 @@ +// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sve2 < %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=+sve2 < %s \ +// RUN: | llvm-objdump -d -mattr=+sve2 - | FileCheck %s --check-prefix=CHECK-INST +// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sve2 < %s \ +// RUN: | llvm-objdump -d - | FileCheck %s --check-prefix=CHECK-UNKNOWN + + +addhnt z0.b, z1.h, z31.h +// CHECK-INST: addhnt z0.b, z1.h, z31.h +// CHECK-ENCODING: [0x20,0x64,0x7f,0x45] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: 20 64 7f 45 + +addhnt z0.h, z1.s, z31.s +// CHECK-INST: addhnt z0.h, z1.s, z31.s +// CHECK-ENCODING: [0x20,0x64,0xbf,0x45] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: 20 64 bf 45 + +addhnt z0.s, z1.d, z31.d +// CHECK-INST: addhnt z0.s, z1.d, z31.d +// CHECK-ENCODING: [0x20,0x64,0xff,0x45] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: 20 64 ff 45 Index: llvm/trunk/test/MC/AArch64/SVE2/raddhnb-diagnostics.s =================================================================== --- llvm/trunk/test/MC/AArch64/SVE2/raddhnb-diagnostics.s +++ llvm/trunk/test/MC/AArch64/SVE2/raddhnb-diagnostics.s @@ -0,0 +1,40 @@ +// RUN: not llvm-mc -triple=aarch64 -show-encoding -mattr=+sve2 2>&1 < %s| FileCheck %s + + +// ------------------------------------------------------------------------- // +// Invalid element width + +raddhnb z0.b, z1.b, z2.b +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: raddhnb z0.b, z1.b, z2.b +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +raddhnb z0.h, z1.h, z2.h +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: raddhnb z0.h, z1.h, z2.h +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +raddhnb z0.s, z1.s, z2.s +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: raddhnb z0.s, z1.s, z2.s +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +raddhnb z0.d, z1.d, z2.d +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: raddhnb z0.d, z1.d, z2.d +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +// --------------------------------------------------------------------------// +// Negative tests for instructions that are incompatible with movprfx + +movprfx z0, z7 +raddhnb z0.s, z1.d, z31.d +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a movprfx, suggest replacing movprfx with mov +// CHECK-NEXT: raddhnb z0.s, z1.d, z31.d +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +movprfx z0.s, p0/z, z7.s +raddhnb z0.s, z1.d, z31.d +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a movprfx, suggest replacing movprfx with mov +// CHECK-NEXT: raddhnb z0.s, z1.d, z31.d +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: Index: llvm/trunk/test/MC/AArch64/SVE2/raddhnb.s =================================================================== --- llvm/trunk/test/MC/AArch64/SVE2/raddhnb.s +++ llvm/trunk/test/MC/AArch64/SVE2/raddhnb.s @@ -0,0 +1,27 @@ +// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sve2 < %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=+sve2 < %s \ +// RUN: | llvm-objdump -d -mattr=+sve2 - | FileCheck %s --check-prefix=CHECK-INST +// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sve2 < %s \ +// RUN: | llvm-objdump -d - | FileCheck %s --check-prefix=CHECK-UNKNOWN + + +raddhnb z0.b, z1.h, z31.h +// CHECK-INST: raddhnb z0.b, z1.h, z31.h +// CHECK-ENCODING: [0x20,0x68,0x7f,0x45] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: 20 68 7f 45 + +raddhnb z0.h, z1.s, z31.s +// CHECK-INST: raddhnb z0.h, z1.s, z31.s +// CHECK-ENCODING: [0x20,0x68,0xbf,0x45] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: 20 68 bf 45 + +raddhnb z0.s, z1.d, z31.d +// CHECK-INST: raddhnb z0.s, z1.d, z31.d +// CHECK-ENCODING: [0x20,0x68,0xff,0x45] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: 20 68 ff 45 Index: llvm/trunk/test/MC/AArch64/SVE2/raddhnt-diagnostics.s =================================================================== --- llvm/trunk/test/MC/AArch64/SVE2/raddhnt-diagnostics.s +++ llvm/trunk/test/MC/AArch64/SVE2/raddhnt-diagnostics.s @@ -0,0 +1,40 @@ +// RUN: not llvm-mc -triple=aarch64 -show-encoding -mattr=+sve2 2>&1 < %s| FileCheck %s + + +// ------------------------------------------------------------------------- // +// Invalid element width + +raddhnt z0.b, z1.b, z2.b +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: raddhnt z0.b, z1.b, z2.b +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +raddhnt z0.h, z1.h, z2.h +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: raddhnt z0.h, z1.h, z2.h +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +raddhnt z0.s, z1.s, z2.s +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: raddhnt z0.s, z1.s, z2.s +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +raddhnt z0.d, z1.d, z2.d +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: raddhnt z0.d, z1.d, z2.d +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +// --------------------------------------------------------------------------// +// Negative tests for instructions that are incompatible with movprfx + +movprfx z0, z7 +raddhnt z0.s, z1.d, z31.d +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a movprfx, suggest replacing movprfx with mov +// CHECK-NEXT: raddhnt z0.s, z1.d, z31.d +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +movprfx z0.s, p0/z, z7.s +raddhnt z0.s, z1.d, z31.d +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a movprfx, suggest replacing movprfx with mov +// CHECK-NEXT: raddhnt z0.s, z1.d, z31.d +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: Index: llvm/trunk/test/MC/AArch64/SVE2/raddhnt.s =================================================================== --- llvm/trunk/test/MC/AArch64/SVE2/raddhnt.s +++ llvm/trunk/test/MC/AArch64/SVE2/raddhnt.s @@ -0,0 +1,27 @@ +// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sve2 < %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=+sve2 < %s \ +// RUN: | llvm-objdump -d -mattr=+sve2 - | FileCheck %s --check-prefix=CHECK-INST +// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sve2 < %s \ +// RUN: | llvm-objdump -d - | FileCheck %s --check-prefix=CHECK-UNKNOWN + + +raddhnt z0.b, z1.h, z31.h +// CHECK-INST: raddhnt z0.b, z1.h, z31.h +// CHECK-ENCODING: [0x20,0x6c,0x7f,0x45] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: 20 6c 7f 45 + +raddhnt z0.h, z1.s, z31.s +// CHECK-INST: raddhnt z0.h, z1.s, z31.s +// CHECK-ENCODING: [0x20,0x6c,0xbf,0x45] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: 20 6c bf 45 + +raddhnt z0.s, z1.d, z31.d +// CHECK-INST: raddhnt z0.s, z1.d, z31.d +// CHECK-ENCODING: [0x20,0x6c,0xff,0x45] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: 20 6c ff 45 Index: llvm/trunk/test/MC/AArch64/SVE2/rshrnb-diagnostics.s =================================================================== --- llvm/trunk/test/MC/AArch64/SVE2/rshrnb-diagnostics.s +++ llvm/trunk/test/MC/AArch64/SVE2/rshrnb-diagnostics.s @@ -0,0 +1,65 @@ +// RUN: not llvm-mc -triple=aarch64 -show-encoding -mattr=+sve2 2>&1 < %s| FileCheck %s + +rshrnb z30.b, z10.h, #0 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [1, 8] +// CHECK-NEXT: rshrnb z30.b, z10.h, #0 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +rshrnb z18.b, z27.h, #9 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [1, 8] +// CHECK-NEXT: rshrnb z18.b, z27.h, #9 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +rshrnb z26.h, z4.s, #0 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [1, 16] +// CHECK-NEXT: rshrnb z26.h, z4.s, #0 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +rshrnb z25.h, z10.s, #17 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [1, 16] +// CHECK-NEXT: rshrnb z25.h, z10.s, #17 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +rshrnb z17.s, z0.d, #0 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [1, 32] +// CHECK-NEXT: rshrnb z17.s, z0.d, #0 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +rshrnb z0.s, z15.d, #33 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [1, 32] +// CHECK-NEXT: rshrnb z0.s, z15.d, #33 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + + +// --------------------------------------------------------------------------// +// Invalid element width + +rshrnb z0.b, z0.b, #1 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: rshrnb z0.b, z0.b, #1 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +rshrnb z0.h, z0.h, #1 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: rshrnb z0.h, z0.h, #1 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +rshrnb z0.s, z0.s, #1 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: rshrnb z0.s, z0.s, #1 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +rshrnb z0.d, z0.d, #1 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: rshrnb z0.d, z0.d, #1 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + + +// --------------------------------------------------------------------------// +// Negative tests for instructions that are incompatible with movprfx + +movprfx z31, z6 +rshrnb z31.s, z31.d, #32 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a movprfx, suggest replacing movprfx with mov +// CHECK-NEXT: rshrnb z31.s, z31.d, #32 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: Index: llvm/trunk/test/MC/AArch64/SVE2/rshrnb.s =================================================================== --- llvm/trunk/test/MC/AArch64/SVE2/rshrnb.s +++ llvm/trunk/test/MC/AArch64/SVE2/rshrnb.s @@ -0,0 +1,44 @@ +// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sve2 < %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=+sve2 < %s \ +// RUN: | llvm-objdump -d -mattr=+sve2 - | FileCheck %s --check-prefix=CHECK-INST +// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sve2 < %s \ +// RUN: | llvm-objdump -d - | FileCheck %s --check-prefix=CHECK-UNKNOWN + +rshrnb z0.b, z0.h, #1 +// CHECK-INST: rshrnb z0.b, z0.h, #1 +// CHECK-ENCODING: [0x00,0x18,0x2f,0x45] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: 00 18 2f 45 + +rshrnb z31.b, z31.h, #8 +// CHECK-INST: rshrnb z31.b, z31.h, #8 +// CHECK-ENCODING: [0xff,0x1b,0x28,0x45] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: ff 1b 28 45 + +rshrnb z0.h, z0.s, #1 +// CHECK-INST: rshrnb z0.h, z0.s, #1 +// CHECK-ENCODING: [0x00,0x18,0x3f,0x45] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: 00 18 3f 45 + +rshrnb z31.h, z31.s, #16 +// CHECK-INST: rshrnb z31.h, z31.s, #16 +// CHECK-ENCODING: [0xff,0x1b,0x30,0x45] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: ff 1b 30 45 + +rshrnb z0.s, z0.d, #1 +// CHECK-INST: rshrnb z0.s, z0.d, #1 +// CHECK-ENCODING: [0x00,0x18,0x7f,0x45] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: 00 18 7f 45 + +rshrnb z31.s, z31.d, #32 +// CHECK-INST: rshrnb z31.s, z31.d, #32 +// CHECK-ENCODING: [0xff,0x1b,0x60,0x45] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: ff 1b 60 45 Index: llvm/trunk/test/MC/AArch64/SVE2/rshrnt-diagnostics.s =================================================================== --- llvm/trunk/test/MC/AArch64/SVE2/rshrnt-diagnostics.s +++ llvm/trunk/test/MC/AArch64/SVE2/rshrnt-diagnostics.s @@ -0,0 +1,65 @@ +// RUN: not llvm-mc -triple=aarch64 -show-encoding -mattr=+sve2 2>&1 < %s| FileCheck %s + +rshrnt z30.b, z10.h, #0 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [1, 8] +// CHECK-NEXT: rshrnt z30.b, z10.h, #0 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +rshrnt z18.b, z27.h, #9 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [1, 8] +// CHECK-NEXT: rshrnt z18.b, z27.h, #9 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +rshrnt z26.h, z4.s, #0 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [1, 16] +// CHECK-NEXT: rshrnt z26.h, z4.s, #0 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +rshrnt z25.h, z10.s, #17 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [1, 16] +// CHECK-NEXT: rshrnt z25.h, z10.s, #17 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +rshrnt z17.s, z0.d, #0 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [1, 32] +// CHECK-NEXT: rshrnt z17.s, z0.d, #0 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +rshrnt z0.s, z15.d, #33 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [1, 32] +// CHECK-NEXT: rshrnt z0.s, z15.d, #33 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + + +// --------------------------------------------------------------------------// +// Invalid element width + +rshrnt z0.b, z0.b, #1 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: rshrnt z0.b, z0.b, #1 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +rshrnt z0.h, z0.h, #1 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: rshrnt z0.h, z0.h, #1 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +rshrnt z0.s, z0.s, #1 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: rshrnt z0.s, z0.s, #1 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +rshrnt z0.d, z0.d, #1 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: rshrnt z0.d, z0.d, #1 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + + +// --------------------------------------------------------------------------// +// Negative tests for instructions that are incompatible with movprfx + +movprfx z31, z6 +rshrnt z31.s, z31.d, #32 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a movprfx, suggest replacing movprfx with mov +// CHECK-NEXT: rshrnt z31.s, z31.d, #32 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: Index: llvm/trunk/test/MC/AArch64/SVE2/rshrnt.s =================================================================== --- llvm/trunk/test/MC/AArch64/SVE2/rshrnt.s +++ llvm/trunk/test/MC/AArch64/SVE2/rshrnt.s @@ -0,0 +1,44 @@ +// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sve2 < %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=+sve2 < %s \ +// RUN: | llvm-objdump -d -mattr=+sve2 - | FileCheck %s --check-prefix=CHECK-INST +// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sve2 < %s \ +// RUN: | llvm-objdump -d - | FileCheck %s --check-prefix=CHECK-UNKNOWN + +rshrnt z0.b, z0.h, #1 +// CHECK-INST: rshrnt z0.b, z0.h, #1 +// CHECK-ENCODING: [0x00,0x1c,0x2f,0x45] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: 00 1c 2f 45 + +rshrnt z31.b, z31.h, #8 +// CHECK-INST: rshrnt z31.b, z31.h, #8 +// CHECK-ENCODING: [0xff,0x1f,0x28,0x45] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: ff 1f 28 45 + +rshrnt z0.h, z0.s, #1 +// CHECK-INST: rshrnt z0.h, z0.s, #1 +// CHECK-ENCODING: [0x00,0x1c,0x3f,0x45] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: 00 1c 3f 45 + +rshrnt z31.h, z31.s, #16 +// CHECK-INST: rshrnt z31.h, z31.s, #16 +// CHECK-ENCODING: [0xff,0x1f,0x30,0x45] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: ff 1f 30 45 + +rshrnt z0.s, z0.d, #1 +// CHECK-INST: rshrnt z0.s, z0.d, #1 +// CHECK-ENCODING: [0x00,0x1c,0x7f,0x45] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: 00 1c 7f 45 + +rshrnt z31.s, z31.d, #32 +// CHECK-INST: rshrnt z31.s, z31.d, #32 +// CHECK-ENCODING: [0xff,0x1f,0x60,0x45] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: ff 1f 60 45 Index: llvm/trunk/test/MC/AArch64/SVE2/rsubhnb-diagnostics.s =================================================================== --- llvm/trunk/test/MC/AArch64/SVE2/rsubhnb-diagnostics.s +++ llvm/trunk/test/MC/AArch64/SVE2/rsubhnb-diagnostics.s @@ -0,0 +1,40 @@ +// RUN: not llvm-mc -triple=aarch64 -show-encoding -mattr=+sve2 2>&1 < %s| FileCheck %s + + +// ------------------------------------------------------------------------- // +// Invalid element width + +rsubhnb z0.b, z1.b, z2.b +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: rsubhnb z0.b, z1.b, z2.b +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +rsubhnb z0.h, z1.h, z2.h +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: rsubhnb z0.h, z1.h, z2.h +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +rsubhnb z0.s, z1.s, z2.s +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: rsubhnb z0.s, z1.s, z2.s +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +rsubhnb z0.d, z1.d, z2.d +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: rsubhnb z0.d, z1.d, z2.d +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +// --------------------------------------------------------------------------// +// Negative tests for instructions that are incompatible with movprfx + +movprfx z0, z7 +rsubhnb z0.s, z1.d, z31.d +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a movprfx, suggest replacing movprfx with mov +// CHECK-NEXT: rsubhnb z0.s, z1.d, z31.d +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +movprfx z0.s, p0/z, z7.s +rsubhnb z0.s, z1.d, z31.d +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a movprfx, suggest replacing movprfx with mov +// CHECK-NEXT: rsubhnb z0.s, z1.d, z31.d +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: Index: llvm/trunk/test/MC/AArch64/SVE2/rsubhnb.s =================================================================== --- llvm/trunk/test/MC/AArch64/SVE2/rsubhnb.s +++ llvm/trunk/test/MC/AArch64/SVE2/rsubhnb.s @@ -0,0 +1,27 @@ +// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sve2 < %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=+sve2 < %s \ +// RUN: | llvm-objdump -d -mattr=+sve2 - | FileCheck %s --check-prefix=CHECK-INST +// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sve2 < %s \ +// RUN: | llvm-objdump -d - | FileCheck %s --check-prefix=CHECK-UNKNOWN + + +rsubhnb z0.b, z1.h, z31.h +// CHECK-INST: rsubhnb z0.b, z1.h, z31.h +// CHECK-ENCODING: [0x20,0x78,0x7f,0x45] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: 20 78 7f 45 + +rsubhnb z0.h, z1.s, z31.s +// CHECK-INST: rsubhnb z0.h, z1.s, z31.s +// CHECK-ENCODING: [0x20,0x78,0xbf,0x45] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: 20 78 bf 45 + +rsubhnb z0.s, z1.d, z31.d +// CHECK-INST: rsubhnb z0.s, z1.d, z31.d +// CHECK-ENCODING: [0x20,0x78,0xff,0x45] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: 20 78 ff 45 Index: llvm/trunk/test/MC/AArch64/SVE2/rsubhnt-diagnostics.s =================================================================== --- llvm/trunk/test/MC/AArch64/SVE2/rsubhnt-diagnostics.s +++ llvm/trunk/test/MC/AArch64/SVE2/rsubhnt-diagnostics.s @@ -0,0 +1,40 @@ +// RUN: not llvm-mc -triple=aarch64 -show-encoding -mattr=+sve2 2>&1 < %s| FileCheck %s + + +// ------------------------------------------------------------------------- // +// Invalid element width + +rsubhnt z0.b, z1.b, z2.b +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: rsubhnt z0.b, z1.b, z2.b +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +rsubhnt z0.h, z1.h, z2.h +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: rsubhnt z0.h, z1.h, z2.h +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +rsubhnt z0.s, z1.s, z2.s +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: rsubhnt z0.s, z1.s, z2.s +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +rsubhnt z0.d, z1.d, z2.d +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: rsubhnt z0.d, z1.d, z2.d +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +// --------------------------------------------------------------------------// +// Negative tests for instructions that are incompatible with movprfx + +movprfx z0, z7 +rsubhnt z0.s, z1.d, z31.d +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a movprfx, suggest replacing movprfx with mov +// CHECK-NEXT: rsubhnt z0.s, z1.d, z31.d +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +movprfx z0.s, p0/z, z7.s +rsubhnt z0.s, z1.d, z31.d +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a movprfx, suggest replacing movprfx with mov +// CHECK-NEXT: rsubhnt z0.s, z1.d, z31.d +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: Index: llvm/trunk/test/MC/AArch64/SVE2/rsubhnt.s =================================================================== --- llvm/trunk/test/MC/AArch64/SVE2/rsubhnt.s +++ llvm/trunk/test/MC/AArch64/SVE2/rsubhnt.s @@ -0,0 +1,27 @@ +// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sve2 < %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=+sve2 < %s \ +// RUN: | llvm-objdump -d -mattr=+sve2 - | FileCheck %s --check-prefix=CHECK-INST +// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sve2 < %s \ +// RUN: | llvm-objdump -d - | FileCheck %s --check-prefix=CHECK-UNKNOWN + + +rsubhnt z0.b, z1.h, z31.h +// CHECK-INST: rsubhnt z0.b, z1.h, z31.h +// CHECK-ENCODING: [0x20,0x7c,0x7f,0x45] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: 20 7c 7f 45 + +rsubhnt z0.h, z1.s, z31.s +// CHECK-INST: rsubhnt z0.h, z1.s, z31.s +// CHECK-ENCODING: [0x20,0x7c,0xbf,0x45] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: 20 7c bf 45 + +rsubhnt z0.s, z1.d, z31.d +// CHECK-INST: rsubhnt z0.s, z1.d, z31.d +// CHECK-ENCODING: [0x20,0x7c,0xff,0x45] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: 20 7c ff 45 Index: llvm/trunk/test/MC/AArch64/SVE2/shrnb-diagnostics.s =================================================================== --- llvm/trunk/test/MC/AArch64/SVE2/shrnb-diagnostics.s +++ llvm/trunk/test/MC/AArch64/SVE2/shrnb-diagnostics.s @@ -0,0 +1,65 @@ +// RUN: not llvm-mc -triple=aarch64 -show-encoding -mattr=+sve2 2>&1 < %s| FileCheck %s + +shrnb z30.b, z10.h, #0 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [1, 8] +// CHECK-NEXT: shrnb z30.b, z10.h, #0 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +shrnb z18.b, z27.h, #9 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [1, 8] +// CHECK-NEXT: shrnb z18.b, z27.h, #9 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +shrnb z26.h, z4.s, #0 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [1, 16] +// CHECK-NEXT: shrnb z26.h, z4.s, #0 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +shrnb z25.h, z10.s, #17 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [1, 16] +// CHECK-NEXT: shrnb z25.h, z10.s, #17 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +shrnb z17.s, z0.d, #0 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [1, 32] +// CHECK-NEXT: shrnb z17.s, z0.d, #0 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +shrnb z0.s, z15.d, #33 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [1, 32] +// CHECK-NEXT: shrnb z0.s, z15.d, #33 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + + +// --------------------------------------------------------------------------// +// Invalid element width + +shrnb z0.b, z0.b, #1 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: shrnb z0.b, z0.b, #1 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +shrnb z0.h, z0.h, #1 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: shrnb z0.h, z0.h, #1 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +shrnb z0.s, z0.s, #1 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: shrnb z0.s, z0.s, #1 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +shrnb z0.d, z0.d, #1 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: shrnb z0.d, z0.d, #1 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + + +// --------------------------------------------------------------------------// +// Negative tests for instructions that are incompatible with movprfx + +movprfx z31, z6 +shrnb z31.s, z31.d, #32 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a movprfx, suggest replacing movprfx with mov +// CHECK-NEXT: shrnb z31.s, z31.d, #32 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: Index: llvm/trunk/test/MC/AArch64/SVE2/shrnb.s =================================================================== --- llvm/trunk/test/MC/AArch64/SVE2/shrnb.s +++ llvm/trunk/test/MC/AArch64/SVE2/shrnb.s @@ -0,0 +1,44 @@ +// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sve2 < %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=+sve2 < %s \ +// RUN: | llvm-objdump -d -mattr=+sve2 - | FileCheck %s --check-prefix=CHECK-INST +// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sve2 < %s \ +// RUN: | llvm-objdump -d - | FileCheck %s --check-prefix=CHECK-UNKNOWN + +shrnb z0.b, z0.h, #1 +// CHECK-INST: shrnb z0.b, z0.h, #1 +// CHECK-ENCODING: [0x00,0x10,0x2f,0x45] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: 00 10 2f 45 + +shrnb z31.b, z31.h, #8 +// CHECK-INST: shrnb z31.b, z31.h, #8 +// CHECK-ENCODING: [0xff,0x13,0x28,0x45] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: ff 13 28 45 + +shrnb z0.h, z0.s, #1 +// CHECK-INST: shrnb z0.h, z0.s, #1 +// CHECK-ENCODING: [0x00,0x10,0x3f,0x45] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: 00 10 3f 45 + +shrnb z31.h, z31.s, #16 +// CHECK-INST: shrnb z31.h, z31.s, #16 +// CHECK-ENCODING: [0xff,0x13,0x30,0x45] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: ff 13 30 45 + +shrnb z0.s, z0.d, #1 +// CHECK-INST: shrnb z0.s, z0.d, #1 +// CHECK-ENCODING: [0x00,0x10,0x7f,0x45] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: 00 10 7f 45 + +shrnb z31.s, z31.d, #32 +// CHECK-INST: shrnb z31.s, z31.d, #32 +// CHECK-ENCODING: [0xff,0x13,0x60,0x45] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: ff 13 60 45 Index: llvm/trunk/test/MC/AArch64/SVE2/shrnt-diagnostics.s =================================================================== --- llvm/trunk/test/MC/AArch64/SVE2/shrnt-diagnostics.s +++ llvm/trunk/test/MC/AArch64/SVE2/shrnt-diagnostics.s @@ -0,0 +1,65 @@ +// RUN: not llvm-mc -triple=aarch64 -show-encoding -mattr=+sve2 2>&1 < %s| FileCheck %s + +shrnt z30.b, z10.h, #0 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [1, 8] +// CHECK-NEXT: shrnt z30.b, z10.h, #0 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +shrnt z18.b, z27.h, #9 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [1, 8] +// CHECK-NEXT: shrnt z18.b, z27.h, #9 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +shrnt z26.h, z4.s, #0 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [1, 16] +// CHECK-NEXT: shrnt z26.h, z4.s, #0 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +shrnt z25.h, z10.s, #17 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [1, 16] +// CHECK-NEXT: shrnt z25.h, z10.s, #17 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +shrnt z17.s, z0.d, #0 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [1, 32] +// CHECK-NEXT: shrnt z17.s, z0.d, #0 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +shrnt z0.s, z15.d, #33 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [1, 32] +// CHECK-NEXT: shrnt z0.s, z15.d, #33 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + + +// --------------------------------------------------------------------------// +// Invalid element width + +shrnt z0.b, z0.b, #1 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: shrnt z0.b, z0.b, #1 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +shrnt z0.h, z0.h, #1 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: shrnt z0.h, z0.h, #1 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +shrnt z0.s, z0.s, #1 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: shrnt z0.s, z0.s, #1 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +shrnt z0.d, z0.d, #1 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: shrnt z0.d, z0.d, #1 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + + +// --------------------------------------------------------------------------// +// Negative tests for instructions that are incompatible with movprfx + +movprfx z31, z6 +shrnt z31.s, z31.d, #32 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a movprfx, suggest replacing movprfx with mov +// CHECK-NEXT: shrnt z31.s, z31.d, #32 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: Index: llvm/trunk/test/MC/AArch64/SVE2/shrnt.s =================================================================== --- llvm/trunk/test/MC/AArch64/SVE2/shrnt.s +++ llvm/trunk/test/MC/AArch64/SVE2/shrnt.s @@ -0,0 +1,44 @@ +// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sve2 < %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=+sve2 < %s \ +// RUN: | llvm-objdump -d -mattr=+sve2 - | FileCheck %s --check-prefix=CHECK-INST +// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sve2 < %s \ +// RUN: | llvm-objdump -d - | FileCheck %s --check-prefix=CHECK-UNKNOWN + +shrnt z0.b, z0.h, #1 +// CHECK-INST: shrnt z0.b, z0.h, #1 +// CHECK-ENCODING: [0x00,0x14,0x2f,0x45] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: 00 14 2f 45 + +shrnt z31.b, z31.h, #8 +// CHECK-INST: shrnt z31.b, z31.h, #8 +// CHECK-ENCODING: [0xff,0x17,0x28,0x45] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: ff 17 28 45 + +shrnt z0.h, z0.s, #1 +// CHECK-INST: shrnt z0.h, z0.s, #1 +// CHECK-ENCODING: [0x00,0x14,0x3f,0x45] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: 00 14 3f 45 + +shrnt z31.h, z31.s, #16 +// CHECK-INST: shrnt z31.h, z31.s, #16 +// CHECK-ENCODING: [0xff,0x17,0x30,0x45] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: ff 17 30 45 + +shrnt z0.s, z0.d, #1 +// CHECK-INST: shrnt z0.s, z0.d, #1 +// CHECK-ENCODING: [0x00,0x14,0x7f,0x45] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: 00 14 7f 45 + +shrnt z31.s, z31.d, #32 +// CHECK-INST: shrnt z31.s, z31.d, #32 +// CHECK-ENCODING: [0xff,0x17,0x60,0x45] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: ff 17 60 45 Index: llvm/trunk/test/MC/AArch64/SVE2/sqrshrnb-diagnostics.s =================================================================== --- llvm/trunk/test/MC/AArch64/SVE2/sqrshrnb-diagnostics.s +++ llvm/trunk/test/MC/AArch64/SVE2/sqrshrnb-diagnostics.s @@ -0,0 +1,65 @@ +// RUN: not llvm-mc -triple=aarch64 -show-encoding -mattr=+sve2 2>&1 < %s| FileCheck %s + +sqrshrnb z30.b, z10.h, #0 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [1, 8] +// CHECK-NEXT: sqrshrnb z30.b, z10.h, #0 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +sqrshrnb z18.b, z27.h, #9 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [1, 8] +// CHECK-NEXT: sqrshrnb z18.b, z27.h, #9 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +sqrshrnb z26.h, z4.s, #0 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [1, 16] +// CHECK-NEXT: sqrshrnb z26.h, z4.s, #0 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +sqrshrnb z25.h, z10.s, #17 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [1, 16] +// CHECK-NEXT: sqrshrnb z25.h, z10.s, #17 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +sqrshrnb z17.s, z0.d, #0 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [1, 32] +// CHECK-NEXT: sqrshrnb z17.s, z0.d, #0 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +sqrshrnb z0.s, z15.d, #33 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [1, 32] +// CHECK-NEXT: sqrshrnb z0.s, z15.d, #33 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + + +// --------------------------------------------------------------------------// +// Invalid element width + +sqrshrnb z0.b, z0.b, #1 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: sqrshrnb z0.b, z0.b, #1 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +sqrshrnb z0.h, z0.h, #1 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: sqrshrnb z0.h, z0.h, #1 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +sqrshrnb z0.s, z0.s, #1 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: sqrshrnb z0.s, z0.s, #1 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +sqrshrnb z0.d, z0.d, #1 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: sqrshrnb z0.d, z0.d, #1 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + + +// --------------------------------------------------------------------------// +// Negative tests for instructions that are incompatible with movprfx + +movprfx z31, z6 +sqrshrnb z31.s, z31.d, #32 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a movprfx, suggest replacing movprfx with mov +// CHECK-NEXT: sqrshrnb z31.s, z31.d, #32 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: Index: llvm/trunk/test/MC/AArch64/SVE2/sqrshrnb.s =================================================================== --- llvm/trunk/test/MC/AArch64/SVE2/sqrshrnb.s +++ llvm/trunk/test/MC/AArch64/SVE2/sqrshrnb.s @@ -0,0 +1,44 @@ +// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sve2 < %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=+sve2 < %s \ +// RUN: | llvm-objdump -d -mattr=+sve2 - | FileCheck %s --check-prefix=CHECK-INST +// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sve2 < %s \ +// RUN: | llvm-objdump -d - | FileCheck %s --check-prefix=CHECK-UNKNOWN + +sqrshrnb z0.b, z0.h, #1 +// CHECK-INST: sqrshrnb z0.b, z0.h, #1 +// CHECK-ENCODING: [0x00,0x28,0x2f,0x45] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: 00 28 2f 45 + +sqrshrnb z31.b, z31.h, #8 +// CHECK-INST: sqrshrnb z31.b, z31.h, #8 +// CHECK-ENCODING: [0xff,0x2b,0x28,0x45] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: ff 2b 28 45 + +sqrshrnb z0.h, z0.s, #1 +// CHECK-INST: sqrshrnb z0.h, z0.s, #1 +// CHECK-ENCODING: [0x00,0x28,0x3f,0x45] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: 00 28 3f 45 + +sqrshrnb z31.h, z31.s, #16 +// CHECK-INST: sqrshrnb z31.h, z31.s, #16 +// CHECK-ENCODING: [0xff,0x2b,0x30,0x45] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: ff 2b 30 45 + +sqrshrnb z0.s, z0.d, #1 +// CHECK-INST: sqrshrnb z0.s, z0.d, #1 +// CHECK-ENCODING: [0x00,0x28,0x7f,0x45] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: 00 28 7f 45 + +sqrshrnb z31.s, z31.d, #32 +// CHECK-INST: sqrshrnb z31.s, z31.d, #32 +// CHECK-ENCODING: [0xff,0x2b,0x60,0x45] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: ff 2b 60 45 Index: llvm/trunk/test/MC/AArch64/SVE2/sqrshrnt-diagnostics.s =================================================================== --- llvm/trunk/test/MC/AArch64/SVE2/sqrshrnt-diagnostics.s +++ llvm/trunk/test/MC/AArch64/SVE2/sqrshrnt-diagnostics.s @@ -0,0 +1,65 @@ +// RUN: not llvm-mc -triple=aarch64 -show-encoding -mattr=+sve2 2>&1 < %s| FileCheck %s + +sqrshrnt z30.b, z10.h, #0 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [1, 8] +// CHECK-NEXT: sqrshrnt z30.b, z10.h, #0 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +sqrshrnt z18.b, z27.h, #9 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [1, 8] +// CHECK-NEXT: sqrshrnt z18.b, z27.h, #9 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +sqrshrnt z26.h, z4.s, #0 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [1, 16] +// CHECK-NEXT: sqrshrnt z26.h, z4.s, #0 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +sqrshrnt z25.h, z10.s, #17 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [1, 16] +// CHECK-NEXT: sqrshrnt z25.h, z10.s, #17 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +sqrshrnt z17.s, z0.d, #0 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [1, 32] +// CHECK-NEXT: sqrshrnt z17.s, z0.d, #0 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +sqrshrnt z0.s, z15.d, #33 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [1, 32] +// CHECK-NEXT: sqrshrnt z0.s, z15.d, #33 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + + +// --------------------------------------------------------------------------// +// Invalid element width + +sqrshrnt z0.b, z0.b, #1 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: sqrshrnt z0.b, z0.b, #1 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +sqrshrnt z0.h, z0.h, #1 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: sqrshrnt z0.h, z0.h, #1 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +sqrshrnt z0.s, z0.s, #1 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: sqrshrnt z0.s, z0.s, #1 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +sqrshrnt z0.d, z0.d, #1 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: sqrshrnt z0.d, z0.d, #1 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + + +// --------------------------------------------------------------------------// +// Negative tests for instructions that are incompatible with movprfx + +movprfx z31, z6 +sqrshrnt z31.s, z31.d, #32 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a movprfx, suggest replacing movprfx with mov +// CHECK-NEXT: sqrshrnt z31.s, z31.d, #32 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: Index: llvm/trunk/test/MC/AArch64/SVE2/sqrshrnt.s =================================================================== --- llvm/trunk/test/MC/AArch64/SVE2/sqrshrnt.s +++ llvm/trunk/test/MC/AArch64/SVE2/sqrshrnt.s @@ -0,0 +1,44 @@ +// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sve2 < %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=+sve2 < %s \ +// RUN: | llvm-objdump -d -mattr=+sve2 - | FileCheck %s --check-prefix=CHECK-INST +// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sve2 < %s \ +// RUN: | llvm-objdump -d - | FileCheck %s --check-prefix=CHECK-UNKNOWN + +sqrshrnt z0.b, z0.h, #1 +// CHECK-INST: sqrshrnt z0.b, z0.h, #1 +// CHECK-ENCODING: [0x00,0x2c,0x2f,0x45] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: 00 2c 2f 45 + +sqrshrnt z31.b, z31.h, #8 +// CHECK-INST: sqrshrnt z31.b, z31.h, #8 +// CHECK-ENCODING: [0xff,0x2f,0x28,0x45] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: ff 2f 28 45 + +sqrshrnt z0.h, z0.s, #1 +// CHECK-INST: sqrshrnt z0.h, z0.s, #1 +// CHECK-ENCODING: [0x00,0x2c,0x3f,0x45] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: 00 2c 3f 45 + +sqrshrnt z31.h, z31.s, #16 +// CHECK-INST: sqrshrnt z31.h, z31.s, #16 +// CHECK-ENCODING: [0xff,0x2f,0x30,0x45] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: ff 2f 30 45 + +sqrshrnt z0.s, z0.d, #1 +// CHECK-INST: sqrshrnt z0.s, z0.d, #1 +// CHECK-ENCODING: [0x00,0x2c,0x7f,0x45] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: 00 2c 7f 45 + +sqrshrnt z31.s, z31.d, #32 +// CHECK-INST: sqrshrnt z31.s, z31.d, #32 +// CHECK-ENCODING: [0xff,0x2f,0x60,0x45] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: ff 2f 60 45 Index: llvm/trunk/test/MC/AArch64/SVE2/sqrshrunb-diagnostics.s =================================================================== --- llvm/trunk/test/MC/AArch64/SVE2/sqrshrunb-diagnostics.s +++ llvm/trunk/test/MC/AArch64/SVE2/sqrshrunb-diagnostics.s @@ -0,0 +1,65 @@ +// RUN: not llvm-mc -triple=aarch64 -show-encoding -mattr=+sve2 2>&1 < %s| FileCheck %s + +sqrshrunb z30.b, z10.h, #0 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [1, 8] +// CHECK-NEXT: sqrshrunb z30.b, z10.h, #0 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +sqrshrunb z18.b, z27.h, #9 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [1, 8] +// CHECK-NEXT: sqrshrunb z18.b, z27.h, #9 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +sqrshrunb z26.h, z4.s, #0 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [1, 16] +// CHECK-NEXT: sqrshrunb z26.h, z4.s, #0 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +sqrshrunb z25.h, z10.s, #17 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [1, 16] +// CHECK-NEXT: sqrshrunb z25.h, z10.s, #17 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +sqrshrunb z17.s, z0.d, #0 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [1, 32] +// CHECK-NEXT: sqrshrunb z17.s, z0.d, #0 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +sqrshrunb z0.s, z15.d, #33 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [1, 32] +// CHECK-NEXT: sqrshrunb z0.s, z15.d, #33 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + + +// --------------------------------------------------------------------------// +// Invalid element width + +sqrshrunb z0.b, z0.b, #1 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: sqrshrunb z0.b, z0.b, #1 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +sqrshrunb z0.h, z0.h, #1 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: sqrshrunb z0.h, z0.h, #1 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +sqrshrunb z0.s, z0.s, #1 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: sqrshrunb z0.s, z0.s, #1 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +sqrshrunb z0.d, z0.d, #1 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: sqrshrunb z0.d, z0.d, #1 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + + +// --------------------------------------------------------------------------// +// Negative tests for instructions that are incompatible with movprfx + +movprfx z31, z6 +sqrshrunb z31.s, z31.d, #32 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a movprfx, suggest replacing movprfx with mov +// CHECK-NEXT: sqrshrunb z31.s, z31.d, #32 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: Index: llvm/trunk/test/MC/AArch64/SVE2/sqrshrunb.s =================================================================== --- llvm/trunk/test/MC/AArch64/SVE2/sqrshrunb.s +++ llvm/trunk/test/MC/AArch64/SVE2/sqrshrunb.s @@ -0,0 +1,44 @@ +// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sve2 < %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=+sve2 < %s \ +// RUN: | llvm-objdump -d -mattr=+sve2 - | FileCheck %s --check-prefix=CHECK-INST +// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sve2 < %s \ +// RUN: | llvm-objdump -d - | FileCheck %s --check-prefix=CHECK-UNKNOWN + +sqrshrunb z0.b, z0.h, #1 +// CHECK-INST: sqrshrunb z0.b, z0.h, #1 +// CHECK-ENCODING: [0x00,0x08,0x2f,0x45] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: 00 08 2f 45 + +sqrshrunb z31.b, z31.h, #8 +// CHECK-INST: sqrshrunb z31.b, z31.h, #8 +// CHECK-ENCODING: [0xff,0x0b,0x28,0x45] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: ff 0b 28 45 + +sqrshrunb z0.h, z0.s, #1 +// CHECK-INST: sqrshrunb z0.h, z0.s, #1 +// CHECK-ENCODING: [0x00,0x08,0x3f,0x45] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: 00 08 3f 45 + +sqrshrunb z31.h, z31.s, #16 +// CHECK-INST: sqrshrunb z31.h, z31.s, #16 +// CHECK-ENCODING: [0xff,0x0b,0x30,0x45] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: ff 0b 30 45 + +sqrshrunb z0.s, z0.d, #1 +// CHECK-INST: sqrshrunb z0.s, z0.d, #1 +// CHECK-ENCODING: [0x00,0x08,0x7f,0x45] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: 00 08 7f 45 + +sqrshrunb z31.s, z31.d, #32 +// CHECK-INST: sqrshrunb z31.s, z31.d, #32 +// CHECK-ENCODING: [0xff,0x0b,0x60,0x45] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: ff 0b 60 45 Index: llvm/trunk/test/MC/AArch64/SVE2/sqrshrunt-diagnostics.s =================================================================== --- llvm/trunk/test/MC/AArch64/SVE2/sqrshrunt-diagnostics.s +++ llvm/trunk/test/MC/AArch64/SVE2/sqrshrunt-diagnostics.s @@ -0,0 +1,65 @@ +// RUN: not llvm-mc -triple=aarch64 -show-encoding -mattr=+sve2 2>&1 < %s| FileCheck %s + +sqrshrunt z30.b, z10.h, #0 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [1, 8] +// CHECK-NEXT: sqrshrunt z30.b, z10.h, #0 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +sqrshrunt z18.b, z27.h, #9 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [1, 8] +// CHECK-NEXT: sqrshrunt z18.b, z27.h, #9 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +sqrshrunt z26.h, z4.s, #0 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [1, 16] +// CHECK-NEXT: sqrshrunt z26.h, z4.s, #0 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +sqrshrunt z25.h, z10.s, #17 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [1, 16] +// CHECK-NEXT: sqrshrunt z25.h, z10.s, #17 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +sqrshrunt z17.s, z0.d, #0 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [1, 32] +// CHECK-NEXT: sqrshrunt z17.s, z0.d, #0 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +sqrshrunt z0.s, z15.d, #33 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [1, 32] +// CHECK-NEXT: sqrshrunt z0.s, z15.d, #33 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + + +// --------------------------------------------------------------------------// +// Invalid element width + +sqrshrunt z0.b, z0.b, #1 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: sqrshrunt z0.b, z0.b, #1 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +sqrshrunt z0.h, z0.h, #1 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: sqrshrunt z0.h, z0.h, #1 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +sqrshrunt z0.s, z0.s, #1 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: sqrshrunt z0.s, z0.s, #1 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +sqrshrunt z0.d, z0.d, #1 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: sqrshrunt z0.d, z0.d, #1 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + + +// --------------------------------------------------------------------------// +// Negative tests for instructions that are incompatible with movprfx + +movprfx z31, z6 +sqrshrunt z31.s, z31.d, #32 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a movprfx, suggest replacing movprfx with mov +// CHECK-NEXT: sqrshrunt z31.s, z31.d, #32 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: Index: llvm/trunk/test/MC/AArch64/SVE2/sqrshrunt.s =================================================================== --- llvm/trunk/test/MC/AArch64/SVE2/sqrshrunt.s +++ llvm/trunk/test/MC/AArch64/SVE2/sqrshrunt.s @@ -0,0 +1,44 @@ +// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sve2 < %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=+sve2 < %s \ +// RUN: | llvm-objdump -d -mattr=+sve2 - | FileCheck %s --check-prefix=CHECK-INST +// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sve2 < %s \ +// RUN: | llvm-objdump -d - | FileCheck %s --check-prefix=CHECK-UNKNOWN + +sqrshrunt z0.b, z0.h, #1 +// CHECK-INST: sqrshrunt z0.b, z0.h, #1 +// CHECK-ENCODING: [0x00,0x0c,0x2f,0x45] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: 00 0c 2f 45 + +sqrshrunt z31.b, z31.h, #8 +// CHECK-INST: sqrshrunt z31.b, z31.h, #8 +// CHECK-ENCODING: [0xff,0x0f,0x28,0x45] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: ff 0f 28 45 + +sqrshrunt z0.h, z0.s, #1 +// CHECK-INST: sqrshrunt z0.h, z0.s, #1 +// CHECK-ENCODING: [0x00,0x0c,0x3f,0x45] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: 00 0c 3f 45 + +sqrshrunt z31.h, z31.s, #16 +// CHECK-INST: sqrshrunt z31.h, z31.s, #16 +// CHECK-ENCODING: [0xff,0x0f,0x30,0x45] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: ff 0f 30 45 + +sqrshrunt z0.s, z0.d, #1 +// CHECK-INST: sqrshrunt z0.s, z0.d, #1 +// CHECK-ENCODING: [0x00,0x0c,0x7f,0x45] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: 00 0c 7f 45 + +sqrshrunt z31.s, z31.d, #32 +// CHECK-INST: sqrshrunt z31.s, z31.d, #32 +// CHECK-ENCODING: [0xff,0x0f,0x60,0x45] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: ff 0f 60 45 Index: llvm/trunk/test/MC/AArch64/SVE2/sqshrnb-diagnostics.s =================================================================== --- llvm/trunk/test/MC/AArch64/SVE2/sqshrnb-diagnostics.s +++ llvm/trunk/test/MC/AArch64/SVE2/sqshrnb-diagnostics.s @@ -0,0 +1,65 @@ +// RUN: not llvm-mc -triple=aarch64 -show-encoding -mattr=+sve2 2>&1 < %s| FileCheck %s + +sqshrnb z30.b, z10.h, #0 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [1, 8] +// CHECK-NEXT: sqshrnb z30.b, z10.h, #0 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +sqshrnb z18.b, z27.h, #9 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [1, 8] +// CHECK-NEXT: sqshrnb z18.b, z27.h, #9 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +sqshrnb z26.h, z4.s, #0 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [1, 16] +// CHECK-NEXT: sqshrnb z26.h, z4.s, #0 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +sqshrnb z25.h, z10.s, #17 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [1, 16] +// CHECK-NEXT: sqshrnb z25.h, z10.s, #17 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +sqshrnb z17.s, z0.d, #0 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [1, 32] +// CHECK-NEXT: sqshrnb z17.s, z0.d, #0 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +sqshrnb z0.s, z15.d, #33 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [1, 32] +// CHECK-NEXT: sqshrnb z0.s, z15.d, #33 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + + +// --------------------------------------------------------------------------// +// Invalid element width + +sqshrnb z0.b, z0.b, #1 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: sqshrnb z0.b, z0.b, #1 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +sqshrnb z0.h, z0.h, #1 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: sqshrnb z0.h, z0.h, #1 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +sqshrnb z0.s, z0.s, #1 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: sqshrnb z0.s, z0.s, #1 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +sqshrnb z0.d, z0.d, #1 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: sqshrnb z0.d, z0.d, #1 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + + +// --------------------------------------------------------------------------// +// Negative tests for instructions that are incompatible with movprfx + +movprfx z31, z6 +sqshrnb z31.s, z31.d, #32 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a movprfx, suggest replacing movprfx with mov +// CHECK-NEXT: sqshrnb z31.s, z31.d, #32 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: Index: llvm/trunk/test/MC/AArch64/SVE2/sqshrnb.s =================================================================== --- llvm/trunk/test/MC/AArch64/SVE2/sqshrnb.s +++ llvm/trunk/test/MC/AArch64/SVE2/sqshrnb.s @@ -0,0 +1,44 @@ +// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sve2 < %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=+sve2 < %s \ +// RUN: | llvm-objdump -d -mattr=+sve2 - | FileCheck %s --check-prefix=CHECK-INST +// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sve2 < %s \ +// RUN: | llvm-objdump -d - | FileCheck %s --check-prefix=CHECK-UNKNOWN + +sqshrnb z0.b, z0.h, #1 +// CHECK-INST: sqshrnb z0.b, z0.h, #1 +// CHECK-ENCODING: [0x00,0x20,0x2f,0x45] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: 00 20 2f 45 + +sqshrnb z31.b, z31.h, #8 +// CHECK-INST: sqshrnb z31.b, z31.h, #8 +// CHECK-ENCODING: [0xff,0x23,0x28,0x45] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: ff 23 28 45 + +sqshrnb z0.h, z0.s, #1 +// CHECK-INST: sqshrnb z0.h, z0.s, #1 +// CHECK-ENCODING: [0x00,0x20,0x3f,0x45] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: 00 20 3f 45 + +sqshrnb z31.h, z31.s, #16 +// CHECK-INST: sqshrnb z31.h, z31.s, #16 +// CHECK-ENCODING: [0xff,0x23,0x30,0x45] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: ff 23 30 45 + +sqshrnb z0.s, z0.d, #1 +// CHECK-INST: sqshrnb z0.s, z0.d, #1 +// CHECK-ENCODING: [0x00,0x20,0x7f,0x45] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: 00 20 7f 45 + +sqshrnb z31.s, z31.d, #32 +// CHECK-INST: sqshrnb z31.s, z31.d, #32 +// CHECK-ENCODING: [0xff,0x23,0x60,0x45] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: ff 23 60 45 Index: llvm/trunk/test/MC/AArch64/SVE2/sqshrnt-diagnostics.s =================================================================== --- llvm/trunk/test/MC/AArch64/SVE2/sqshrnt-diagnostics.s +++ llvm/trunk/test/MC/AArch64/SVE2/sqshrnt-diagnostics.s @@ -0,0 +1,65 @@ +// RUN: not llvm-mc -triple=aarch64 -show-encoding -mattr=+sve2 2>&1 < %s| FileCheck %s + +sqshrnt z30.b, z10.h, #0 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [1, 8] +// CHECK-NEXT: sqshrnt z30.b, z10.h, #0 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +sqshrnt z18.b, z27.h, #9 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [1, 8] +// CHECK-NEXT: sqshrnt z18.b, z27.h, #9 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +sqshrnt z26.h, z4.s, #0 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [1, 16] +// CHECK-NEXT: sqshrnt z26.h, z4.s, #0 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +sqshrnt z25.h, z10.s, #17 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [1, 16] +// CHECK-NEXT: sqshrnt z25.h, z10.s, #17 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +sqshrnt z17.s, z0.d, #0 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [1, 32] +// CHECK-NEXT: sqshrnt z17.s, z0.d, #0 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +sqshrnt z0.s, z15.d, #33 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [1, 32] +// CHECK-NEXT: sqshrnt z0.s, z15.d, #33 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + + +// --------------------------------------------------------------------------// +// Invalid element width + +sqshrnt z0.b, z0.b, #1 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: sqshrnt z0.b, z0.b, #1 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +sqshrnt z0.h, z0.h, #1 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: sqshrnt z0.h, z0.h, #1 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +sqshrnt z0.s, z0.s, #1 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: sqshrnt z0.s, z0.s, #1 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +sqshrnt z0.d, z0.d, #1 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: sqshrnt z0.d, z0.d, #1 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + + +// --------------------------------------------------------------------------// +// Negative tests for instructions that are incompatible with movprfx + +movprfx z31, z6 +sqshrnt z31.s, z31.d, #32 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a movprfx, suggest replacing movprfx with mov +// CHECK-NEXT: sqshrnt z31.s, z31.d, #32 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: Index: llvm/trunk/test/MC/AArch64/SVE2/sqshrnt.s =================================================================== --- llvm/trunk/test/MC/AArch64/SVE2/sqshrnt.s +++ llvm/trunk/test/MC/AArch64/SVE2/sqshrnt.s @@ -0,0 +1,44 @@ +// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sve2 < %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=+sve2 < %s \ +// RUN: | llvm-objdump -d -mattr=+sve2 - | FileCheck %s --check-prefix=CHECK-INST +// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sve2 < %s \ +// RUN: | llvm-objdump -d - | FileCheck %s --check-prefix=CHECK-UNKNOWN + +sqshrnt z0.b, z0.h, #1 +// CHECK-INST: sqshrnt z0.b, z0.h, #1 +// CHECK-ENCODING: [0x00,0x24,0x2f,0x45] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: 00 24 2f 45 + +sqshrnt z31.b, z31.h, #8 +// CHECK-INST: sqshrnt z31.b, z31.h, #8 +// CHECK-ENCODING: [0xff,0x27,0x28,0x45] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: ff 27 28 45 + +sqshrnt z0.h, z0.s, #1 +// CHECK-INST: sqshrnt z0.h, z0.s, #1 +// CHECK-ENCODING: [0x00,0x24,0x3f,0x45] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: 00 24 3f 45 + +sqshrnt z31.h, z31.s, #16 +// CHECK-INST: sqshrnt z31.h, z31.s, #16 +// CHECK-ENCODING: [0xff,0x27,0x30,0x45] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: ff 27 30 45 + +sqshrnt z0.s, z0.d, #1 +// CHECK-INST: sqshrnt z0.s, z0.d, #1 +// CHECK-ENCODING: [0x00,0x24,0x7f,0x45] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: 00 24 7f 45 + +sqshrnt z31.s, z31.d, #32 +// CHECK-INST: sqshrnt z31.s, z31.d, #32 +// CHECK-ENCODING: [0xff,0x27,0x60,0x45] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: ff 27 60 45 Index: llvm/trunk/test/MC/AArch64/SVE2/sqshrunb-diagnostics.s =================================================================== --- llvm/trunk/test/MC/AArch64/SVE2/sqshrunb-diagnostics.s +++ llvm/trunk/test/MC/AArch64/SVE2/sqshrunb-diagnostics.s @@ -0,0 +1,65 @@ +// RUN: not llvm-mc -triple=aarch64 -show-encoding -mattr=+sve2 2>&1 < %s| FileCheck %s + +sqshrunb z30.b, z10.h, #0 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [1, 8] +// CHECK-NEXT: sqshrunb z30.b, z10.h, #0 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +sqshrunb z18.b, z27.h, #9 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [1, 8] +// CHECK-NEXT: sqshrunb z18.b, z27.h, #9 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +sqshrunb z26.h, z4.s, #0 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [1, 16] +// CHECK-NEXT: sqshrunb z26.h, z4.s, #0 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +sqshrunb z25.h, z10.s, #17 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [1, 16] +// CHECK-NEXT: sqshrunb z25.h, z10.s, #17 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +sqshrunb z17.s, z0.d, #0 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [1, 32] +// CHECK-NEXT: sqshrunb z17.s, z0.d, #0 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +sqshrunb z0.s, z15.d, #33 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [1, 32] +// CHECK-NEXT: sqshrunb z0.s, z15.d, #33 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + + +// --------------------------------------------------------------------------// +// Invalid element width + +sqshrunb z0.b, z0.b, #1 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: sqshrunb z0.b, z0.b, #1 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +sqshrunb z0.h, z0.h, #1 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: sqshrunb z0.h, z0.h, #1 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +sqshrunb z0.s, z0.s, #1 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: sqshrunb z0.s, z0.s, #1 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +sqshrunb z0.d, z0.d, #1 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: sqshrunb z0.d, z0.d, #1 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + + +// --------------------------------------------------------------------------// +// Negative tests for instructions that are incompatible with movprfx + +movprfx z31, z6 +sqshrunb z31.s, z31.d, #32 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a movprfx, suggest replacing movprfx with mov +// CHECK-NEXT: sqshrunb z31.s, z31.d, #32 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: Index: llvm/trunk/test/MC/AArch64/SVE2/sqshrunb.s =================================================================== --- llvm/trunk/test/MC/AArch64/SVE2/sqshrunb.s +++ llvm/trunk/test/MC/AArch64/SVE2/sqshrunb.s @@ -0,0 +1,44 @@ +// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sve2 < %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=+sve2 < %s \ +// RUN: | llvm-objdump -d -mattr=+sve2 - | FileCheck %s --check-prefix=CHECK-INST +// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sve2 < %s \ +// RUN: | llvm-objdump -d - | FileCheck %s --check-prefix=CHECK-UNKNOWN + +sqshrunb z0.b, z0.h, #1 +// CHECK-INST: sqshrunb z0.b, z0.h, #1 +// CHECK-ENCODING: [0x00,0x00,0x2f,0x45] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: 00 00 2f 45 + +sqshrunb z31.b, z31.h, #8 +// CHECK-INST: sqshrunb z31.b, z31.h, #8 +// CHECK-ENCODING: [0xff,0x03,0x28,0x45] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: ff 03 28 45 + +sqshrunb z0.h, z0.s, #1 +// CHECK-INST: sqshrunb z0.h, z0.s, #1 +// CHECK-ENCODING: [0x00,0x00,0x3f,0x45] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: 00 00 3f 45 + +sqshrunb z31.h, z31.s, #16 +// CHECK-INST: sqshrunb z31.h, z31.s, #16 +// CHECK-ENCODING: [0xff,0x03,0x30,0x45] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: ff 03 30 45 + +sqshrunb z0.s, z0.d, #1 +// CHECK-INST: sqshrunb z0.s, z0.d, #1 +// CHECK-ENCODING: [0x00,0x00,0x7f,0x45] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: 00 00 7f 45 + +sqshrunb z31.s, z31.d, #32 +// CHECK-INST: sqshrunb z31.s, z31.d, #32 +// CHECK-ENCODING: [0xff,0x03,0x60,0x45] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: ff 03 60 45 Index: llvm/trunk/test/MC/AArch64/SVE2/sqshrunt-diagnostics.s =================================================================== --- llvm/trunk/test/MC/AArch64/SVE2/sqshrunt-diagnostics.s +++ llvm/trunk/test/MC/AArch64/SVE2/sqshrunt-diagnostics.s @@ -0,0 +1,65 @@ +// RUN: not llvm-mc -triple=aarch64 -show-encoding -mattr=+sve2 2>&1 < %s| FileCheck %s + +sqshrunt z30.b, z10.h, #0 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [1, 8] +// CHECK-NEXT: sqshrunt z30.b, z10.h, #0 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +sqshrunt z18.b, z27.h, #9 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [1, 8] +// CHECK-NEXT: sqshrunt z18.b, z27.h, #9 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +sqshrunt z26.h, z4.s, #0 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [1, 16] +// CHECK-NEXT: sqshrunt z26.h, z4.s, #0 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +sqshrunt z25.h, z10.s, #17 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [1, 16] +// CHECK-NEXT: sqshrunt z25.h, z10.s, #17 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +sqshrunt z17.s, z0.d, #0 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [1, 32] +// CHECK-NEXT: sqshrunt z17.s, z0.d, #0 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +sqshrunt z0.s, z15.d, #33 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [1, 32] +// CHECK-NEXT: sqshrunt z0.s, z15.d, #33 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + + +// --------------------------------------------------------------------------// +// Invalid element width + +sqshrunt z0.b, z0.b, #1 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: sqshrunt z0.b, z0.b, #1 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +sqshrunt z0.h, z0.h, #1 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: sqshrunt z0.h, z0.h, #1 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +sqshrunt z0.s, z0.s, #1 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: sqshrunt z0.s, z0.s, #1 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +sqshrunt z0.d, z0.d, #1 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: sqshrunt z0.d, z0.d, #1 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + + +// --------------------------------------------------------------------------// +// Negative tests for instructions that are incompatible with movprfx + +movprfx z31, z6 +sqshrunt z31.s, z31.d, #32 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a movprfx, suggest replacing movprfx with mov +// CHECK-NEXT: sqshrunt z31.s, z31.d, #32 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: Index: llvm/trunk/test/MC/AArch64/SVE2/sqshrunt.s =================================================================== --- llvm/trunk/test/MC/AArch64/SVE2/sqshrunt.s +++ llvm/trunk/test/MC/AArch64/SVE2/sqshrunt.s @@ -0,0 +1,44 @@ +// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sve2 < %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=+sve2 < %s \ +// RUN: | llvm-objdump -d -mattr=+sve2 - | FileCheck %s --check-prefix=CHECK-INST +// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sve2 < %s \ +// RUN: | llvm-objdump -d - | FileCheck %s --check-prefix=CHECK-UNKNOWN + +sqshrunt z0.b, z0.h, #1 +// CHECK-INST: sqshrunt z0.b, z0.h, #1 +// CHECK-ENCODING: [0x00,0x04,0x2f,0x45] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: 00 04 2f 45 + +sqshrunt z31.b, z31.h, #8 +// CHECK-INST: sqshrunt z31.b, z31.h, #8 +// CHECK-ENCODING: [0xff,0x07,0x28,0x45] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: ff 07 28 45 + +sqshrunt z0.h, z0.s, #1 +// CHECK-INST: sqshrunt z0.h, z0.s, #1 +// CHECK-ENCODING: [0x00,0x04,0x3f,0x45] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: 00 04 3f 45 + +sqshrunt z31.h, z31.s, #16 +// CHECK-INST: sqshrunt z31.h, z31.s, #16 +// CHECK-ENCODING: [0xff,0x07,0x30,0x45] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: ff 07 30 45 + +sqshrunt z0.s, z0.d, #1 +// CHECK-INST: sqshrunt z0.s, z0.d, #1 +// CHECK-ENCODING: [0x00,0x04,0x7f,0x45] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: 00 04 7f 45 + +sqshrunt z31.s, z31.d, #32 +// CHECK-INST: sqshrunt z31.s, z31.d, #32 +// CHECK-ENCODING: [0xff,0x07,0x60,0x45] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: ff 07 60 45 Index: llvm/trunk/test/MC/AArch64/SVE2/sqxtnb-diagnostics.s =================================================================== --- llvm/trunk/test/MC/AArch64/SVE2/sqxtnb-diagnostics.s +++ llvm/trunk/test/MC/AArch64/SVE2/sqxtnb-diagnostics.s @@ -0,0 +1,40 @@ +// RUN: not llvm-mc -triple=aarch64 -show-encoding -mattr=+sve2 2>&1 < %s| FileCheck %s + + +// ------------------------------------------------------------------------- // +// Invalid element width + +sqxtnb z0.b, z1.b +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: sqxtnb z0.b, z1.b +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +sqxtnb z0.h, z1.h +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: sqxtnb z0.h, z1.h +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +sqxtnb z0.s, z1.s +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: sqxtnb z0.s, z1.s +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +sqxtnb z0.d, z1.d +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: sqxtnb z0.d, z1.d +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +// --------------------------------------------------------------------------// +// Negative tests for instructions that are incompatible with movprfx + +movprfx z0, z7 +sqxtnb z0.s, z1.d +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a movprfx, suggest replacing movprfx with mov +// CHECK-NEXT: sqxtnb z0.s, z1.d +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +movprfx z0.s, p0/z, z7.s +sqxtnb z0.s, z1.d +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a movprfx, suggest replacing movprfx with mov +// CHECK-NEXT: sqxtnb z0.s, z1.d +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: Index: llvm/trunk/test/MC/AArch64/SVE2/sqxtnb.s =================================================================== --- llvm/trunk/test/MC/AArch64/SVE2/sqxtnb.s +++ llvm/trunk/test/MC/AArch64/SVE2/sqxtnb.s @@ -0,0 +1,27 @@ +// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sve2 < %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=+sve2 < %s \ +// RUN: | llvm-objdump -d -mattr=+sve2 - | FileCheck %s --check-prefix=CHECK-INST +// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sve2 < %s \ +// RUN: | llvm-objdump -d - | FileCheck %s --check-prefix=CHECK-UNKNOWN + + +sqxtnb z0.b, z31.h +// CHECK-INST: sqxtnb z0.b, z31.h +// CHECK-ENCODING: [0xe0,0x43,0x28,0x45] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: e0 43 28 45 + +sqxtnb z0.h, z31.s +// CHECK-INST: sqxtnb z0.h, z31.s +// CHECK-ENCODING: [0xe0,0x43,0x30,0x45] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: e0 43 30 45 + +sqxtnb z0.s, z31.d +// CHECK-INST: sqxtnb z0.s, z31.d +// CHECK-ENCODING: [0xe0,0x43,0x60,0x45] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: e0 43 60 45 Index: llvm/trunk/test/MC/AArch64/SVE2/sqxtnt-diagnostics.s =================================================================== --- llvm/trunk/test/MC/AArch64/SVE2/sqxtnt-diagnostics.s +++ llvm/trunk/test/MC/AArch64/SVE2/sqxtnt-diagnostics.s @@ -0,0 +1,40 @@ +// RUN: not llvm-mc -triple=aarch64 -show-encoding -mattr=+sve2 2>&1 < %s| FileCheck %s + + +// ------------------------------------------------------------------------- // +// Invalid element width + +sqxtnt z0.b, z1.b +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: sqxtnt z0.b, z1.b +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +sqxtnt z0.h, z1.h +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: sqxtnt z0.h, z1.h +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +sqxtnt z0.s, z1.s +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: sqxtnt z0.s, z1.s +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +sqxtnt z0.d, z1.d +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: sqxtnt z0.d, z1.d +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +// --------------------------------------------------------------------------// +// Negative tests for instructions that are incompatible with movprfx + +movprfx z0, z7 +sqxtnt z0.s, z1.d +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a movprfx, suggest replacing movprfx with mov +// CHECK-NEXT: sqxtnt z0.s, z1.d +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +movprfx z0.s, p0/z, z7.s +sqxtnt z0.s, z1.d +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a movprfx, suggest replacing movprfx with mov +// CHECK-NEXT: sqxtnt z0.s, z1.d +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: Index: llvm/trunk/test/MC/AArch64/SVE2/sqxtnt.s =================================================================== --- llvm/trunk/test/MC/AArch64/SVE2/sqxtnt.s +++ llvm/trunk/test/MC/AArch64/SVE2/sqxtnt.s @@ -0,0 +1,27 @@ +// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sve2 < %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=+sve2 < %s \ +// RUN: | llvm-objdump -d -mattr=+sve2 - | FileCheck %s --check-prefix=CHECK-INST +// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sve2 < %s \ +// RUN: | llvm-objdump -d - | FileCheck %s --check-prefix=CHECK-UNKNOWN + + +sqxtnt z0.b, z31.h +// CHECK-INST: sqxtnt z0.b, z31.h +// CHECK-ENCODING: [0xe0,0x47,0x28,0x45] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: e0 47 28 45 + +sqxtnt z0.h, z31.s +// CHECK-INST: sqxtnt z0.h, z31.s +// CHECK-ENCODING: [0xe0,0x47,0x30,0x45] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: e0 47 30 45 + +sqxtnt z0.s, z31.d +// CHECK-INST: sqxtnt z0.s, z31.d +// CHECK-ENCODING: [0xe0,0x47,0x60,0x45] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: e0 47 60 45 Index: llvm/trunk/test/MC/AArch64/SVE2/sqxtunb-diagnostics.s =================================================================== --- llvm/trunk/test/MC/AArch64/SVE2/sqxtunb-diagnostics.s +++ llvm/trunk/test/MC/AArch64/SVE2/sqxtunb-diagnostics.s @@ -0,0 +1,40 @@ +// RUN: not llvm-mc -triple=aarch64 -show-encoding -mattr=+sve2 2>&1 < %s| FileCheck %s + + +// ------------------------------------------------------------------------- // +// Invalid element width + +sqxtunb z0.b, z1.b +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: sqxtunb z0.b, z1.b +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +sqxtunb z0.h, z1.h +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: sqxtunb z0.h, z1.h +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +sqxtunb z0.s, z1.s +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: sqxtunb z0.s, z1.s +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +sqxtunb z0.d, z1.d +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: sqxtunb z0.d, z1.d +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +// --------------------------------------------------------------------------// +// Negative tests for instructions that are incompatible with movprfx + +movprfx z0, z7 +sqxtunb z0.s, z1.d +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a movprfx, suggest replacing movprfx with mov +// CHECK-NEXT: sqxtunb z0.s, z1.d +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +movprfx z0.s, p0/z, z7.s +sqxtunb z0.s, z1.d +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a movprfx, suggest replacing movprfx with mov +// CHECK-NEXT: sqxtunb z0.s, z1.d +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: Index: llvm/trunk/test/MC/AArch64/SVE2/sqxtunb.s =================================================================== --- llvm/trunk/test/MC/AArch64/SVE2/sqxtunb.s +++ llvm/trunk/test/MC/AArch64/SVE2/sqxtunb.s @@ -0,0 +1,27 @@ +// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sve2 < %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=+sve2 < %s \ +// RUN: | llvm-objdump -d -mattr=+sve2 - | FileCheck %s --check-prefix=CHECK-INST +// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sve2 < %s \ +// RUN: | llvm-objdump -d - | FileCheck %s --check-prefix=CHECK-UNKNOWN + + +sqxtunb z0.b, z31.h +// CHECK-INST: sqxtunb z0.b, z31.h +// CHECK-ENCODING: [0xe0,0x53,0x28,0x45] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: e0 53 28 45 + +sqxtunb z0.h, z31.s +// CHECK-INST: sqxtunb z0.h, z31.s +// CHECK-ENCODING: [0xe0,0x53,0x30,0x45] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: e0 53 30 45 + +sqxtunb z0.s, z31.d +// CHECK-INST: sqxtunb z0.s, z31.d +// CHECK-ENCODING: [0xe0,0x53,0x60,0x45] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: e0 53 60 45 Index: llvm/trunk/test/MC/AArch64/SVE2/sqxtunt-diagnostics.s =================================================================== --- llvm/trunk/test/MC/AArch64/SVE2/sqxtunt-diagnostics.s +++ llvm/trunk/test/MC/AArch64/SVE2/sqxtunt-diagnostics.s @@ -0,0 +1,40 @@ +// RUN: not llvm-mc -triple=aarch64 -show-encoding -mattr=+sve2 2>&1 < %s| FileCheck %s + + +// ------------------------------------------------------------------------- // +// Invalid element width + +sqxtunt z0.b, z1.b +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: sqxtunt z0.b, z1.b +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +sqxtunt z0.h, z1.h +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: sqxtunt z0.h, z1.h +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +sqxtunt z0.s, z1.s +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: sqxtunt z0.s, z1.s +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +sqxtunt z0.d, z1.d +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: sqxtunt z0.d, z1.d +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +// --------------------------------------------------------------------------// +// Negative tests for instructions that are incompatible with movprfx + +movprfx z0, z7 +sqxtunt z0.s, z1.d +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a movprfx, suggest replacing movprfx with mov +// CHECK-NEXT: sqxtunt z0.s, z1.d +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +movprfx z0.s, p0/z, z7.s +sqxtunt z0.s, z1.d +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a movprfx, suggest replacing movprfx with mov +// CHECK-NEXT: sqxtunt z0.s, z1.d +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: Index: llvm/trunk/test/MC/AArch64/SVE2/sqxtunt.s =================================================================== --- llvm/trunk/test/MC/AArch64/SVE2/sqxtunt.s +++ llvm/trunk/test/MC/AArch64/SVE2/sqxtunt.s @@ -0,0 +1,27 @@ +// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sve2 < %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=+sve2 < %s \ +// RUN: | llvm-objdump -d -mattr=+sve2 - | FileCheck %s --check-prefix=CHECK-INST +// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sve2 < %s \ +// RUN: | llvm-objdump -d - | FileCheck %s --check-prefix=CHECK-UNKNOWN + + +sqxtunt z0.b, z31.h +// CHECK-INST: sqxtunt z0.b, z31.h +// CHECK-ENCODING: [0xe0,0x57,0x28,0x45] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: e0 57 28 45 + +sqxtunt z0.h, z31.s +// CHECK-INST: sqxtunt z0.h, z31.s +// CHECK-ENCODING: [0xe0,0x57,0x30,0x45] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: e0 57 30 45 + +sqxtunt z0.s, z31.d +// CHECK-INST: sqxtunt z0.s, z31.d +// CHECK-ENCODING: [0xe0,0x57,0x60,0x45] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: e0 57 60 45 Index: llvm/trunk/test/MC/AArch64/SVE2/subhnb-diagnostics.s =================================================================== --- llvm/trunk/test/MC/AArch64/SVE2/subhnb-diagnostics.s +++ llvm/trunk/test/MC/AArch64/SVE2/subhnb-diagnostics.s @@ -0,0 +1,40 @@ +// RUN: not llvm-mc -triple=aarch64 -show-encoding -mattr=+sve2 2>&1 < %s| FileCheck %s + + +// ------------------------------------------------------------------------- // +// Invalid element width + +subhnb z0.b, z1.b, z2.b +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: subhnb z0.b, z1.b, z2.b +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +subhnb z0.h, z1.h, z2.h +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: subhnb z0.h, z1.h, z2.h +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +subhnb z0.s, z1.s, z2.s +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: subhnb z0.s, z1.s, z2.s +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +subhnb z0.d, z1.d, z2.d +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: subhnb z0.d, z1.d, z2.d +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +// --------------------------------------------------------------------------// +// Negative tests for instructions that are incompatible with movprfx + +movprfx z0, z7 +subhnb z0.s, z1.d, z31.d +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a movprfx, suggest replacing movprfx with mov +// CHECK-NEXT: subhnb z0.s, z1.d, z31.d +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +movprfx z0.s, p0/z, z7.s +subhnb z0.s, z1.d, z31.d +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a movprfx, suggest replacing movprfx with mov +// CHECK-NEXT: subhnb z0.s, z1.d, z31.d +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: Index: llvm/trunk/test/MC/AArch64/SVE2/subhnb.s =================================================================== --- llvm/trunk/test/MC/AArch64/SVE2/subhnb.s +++ llvm/trunk/test/MC/AArch64/SVE2/subhnb.s @@ -0,0 +1,27 @@ +// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sve2 < %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=+sve2 < %s \ +// RUN: | llvm-objdump -d -mattr=+sve2 - | FileCheck %s --check-prefix=CHECK-INST +// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sve2 < %s \ +// RUN: | llvm-objdump -d - | FileCheck %s --check-prefix=CHECK-UNKNOWN + + +subhnb z0.b, z1.h, z31.h +// CHECK-INST: subhnb z0.b, z1.h, z31.h +// CHECK-ENCODING: [0x20,0x70,0x7f,0x45] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: 20 70 7f 45 + +subhnb z0.h, z1.s, z31.s +// CHECK-INST: subhnb z0.h, z1.s, z31.s +// CHECK-ENCODING: [0x20,0x70,0xbf,0x45] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: 20 70 bf 45 + +subhnb z0.s, z1.d, z31.d +// CHECK-INST: subhnb z0.s, z1.d, z31.d +// CHECK-ENCODING: [0x20,0x70,0xff,0x45] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: 20 70 ff 45 Index: llvm/trunk/test/MC/AArch64/SVE2/subhnt-diagnostics.s =================================================================== --- llvm/trunk/test/MC/AArch64/SVE2/subhnt-diagnostics.s +++ llvm/trunk/test/MC/AArch64/SVE2/subhnt-diagnostics.s @@ -0,0 +1,40 @@ +// RUN: not llvm-mc -triple=aarch64 -show-encoding -mattr=+sve2 2>&1 < %s| FileCheck %s + + +// ------------------------------------------------------------------------- // +// Invalid element width + +subhnt z0.b, z1.b, z2.b +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: subhnt z0.b, z1.b, z2.b +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +subhnt z0.h, z1.h, z2.h +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: subhnt z0.h, z1.h, z2.h +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +subhnt z0.s, z1.s, z2.s +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: subhnt z0.s, z1.s, z2.s +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +subhnt z0.d, z1.d, z2.d +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: subhnt z0.d, z1.d, z2.d +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +// --------------------------------------------------------------------------// +// Negative tests for instructions that are incompatible with movprfx + +movprfx z0, z7 +subhnt z0.s, z1.d, z31.d +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a movprfx, suggest replacing movprfx with mov +// CHECK-NEXT: subhnt z0.s, z1.d, z31.d +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +movprfx z0.s, p0/z, z7.s +subhnt z0.s, z1.d, z31.d +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a movprfx, suggest replacing movprfx with mov +// CHECK-NEXT: subhnt z0.s, z1.d, z31.d +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: Index: llvm/trunk/test/MC/AArch64/SVE2/subhnt.s =================================================================== --- llvm/trunk/test/MC/AArch64/SVE2/subhnt.s +++ llvm/trunk/test/MC/AArch64/SVE2/subhnt.s @@ -0,0 +1,27 @@ +// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sve2 < %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=+sve2 < %s \ +// RUN: | llvm-objdump -d -mattr=+sve2 - | FileCheck %s --check-prefix=CHECK-INST +// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sve2 < %s \ +// RUN: | llvm-objdump -d - | FileCheck %s --check-prefix=CHECK-UNKNOWN + + +subhnt z0.b, z1.h, z31.h +// CHECK-INST: subhnt z0.b, z1.h, z31.h +// CHECK-ENCODING: [0x20,0x74,0x7f,0x45] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: 20 74 7f 45 + +subhnt z0.h, z1.s, z31.s +// CHECK-INST: subhnt z0.h, z1.s, z31.s +// CHECK-ENCODING: [0x20,0x74,0xbf,0x45] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: 20 74 bf 45 + +subhnt z0.s, z1.d, z31.d +// CHECK-INST: subhnt z0.s, z1.d, z31.d +// CHECK-ENCODING: [0x20,0x74,0xff,0x45] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: 20 74 ff 45 Index: llvm/trunk/test/MC/AArch64/SVE2/uqrshrnb-diagnostics.s =================================================================== --- llvm/trunk/test/MC/AArch64/SVE2/uqrshrnb-diagnostics.s +++ llvm/trunk/test/MC/AArch64/SVE2/uqrshrnb-diagnostics.s @@ -0,0 +1,65 @@ +// RUN: not llvm-mc -triple=aarch64 -show-encoding -mattr=+sve2 2>&1 < %s| FileCheck %s + +uqrshrnb z30.b, z10.h, #0 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [1, 8] +// CHECK-NEXT: uqrshrnb z30.b, z10.h, #0 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +uqrshrnb z18.b, z27.h, #9 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [1, 8] +// CHECK-NEXT: uqrshrnb z18.b, z27.h, #9 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +uqrshrnb z26.h, z4.s, #0 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [1, 16] +// CHECK-NEXT: uqrshrnb z26.h, z4.s, #0 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +uqrshrnb z25.h, z10.s, #17 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [1, 16] +// CHECK-NEXT: uqrshrnb z25.h, z10.s, #17 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +uqrshrnb z17.s, z0.d, #0 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [1, 32] +// CHECK-NEXT: uqrshrnb z17.s, z0.d, #0 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +uqrshrnb z0.s, z15.d, #33 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [1, 32] +// CHECK-NEXT: uqrshrnb z0.s, z15.d, #33 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + + +// --------------------------------------------------------------------------// +// Invalid element width + +uqrshrnb z0.b, z0.b, #1 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: uqrshrnb z0.b, z0.b, #1 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +uqrshrnb z0.h, z0.h, #1 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: uqrshrnb z0.h, z0.h, #1 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +uqrshrnb z0.s, z0.s, #1 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: uqrshrnb z0.s, z0.s, #1 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +uqrshrnb z0.d, z0.d, #1 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: uqrshrnb z0.d, z0.d, #1 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + + +// --------------------------------------------------------------------------// +// Negative tests for instructions that are incompatible with movprfx + +movprfx z31, z6 +uqrshrnb z31.s, z31.d, #32 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a movprfx, suggest replacing movprfx with mov +// CHECK-NEXT: uqrshrnb z31.s, z31.d, #32 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: Index: llvm/trunk/test/MC/AArch64/SVE2/uqrshrnb.s =================================================================== --- llvm/trunk/test/MC/AArch64/SVE2/uqrshrnb.s +++ llvm/trunk/test/MC/AArch64/SVE2/uqrshrnb.s @@ -0,0 +1,44 @@ +// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sve2 < %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=+sve2 < %s \ +// RUN: | llvm-objdump -d -mattr=+sve2 - | FileCheck %s --check-prefix=CHECK-INST +// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sve2 < %s \ +// RUN: | llvm-objdump -d - | FileCheck %s --check-prefix=CHECK-UNKNOWN + +uqrshrnb z0.b, z0.h, #1 +// CHECK-INST: uqrshrnb z0.b, z0.h, #1 +// CHECK-ENCODING: [0x00,0x38,0x2f,0x45] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: 00 38 2f 45 + +uqrshrnb z31.b, z31.h, #8 +// CHECK-INST: uqrshrnb z31.b, z31.h, #8 +// CHECK-ENCODING: [0xff,0x3b,0x28,0x45] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: ff 3b 28 45 + +uqrshrnb z0.h, z0.s, #1 +// CHECK-INST: uqrshrnb z0.h, z0.s, #1 +// CHECK-ENCODING: [0x00,0x38,0x3f,0x45] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: 00 38 3f 45 + +uqrshrnb z31.h, z31.s, #16 +// CHECK-INST: uqrshrnb z31.h, z31.s, #16 +// CHECK-ENCODING: [0xff,0x3b,0x30,0x45] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: ff 3b 30 45 + +uqrshrnb z0.s, z0.d, #1 +// CHECK-INST: uqrshrnb z0.s, z0.d, #1 +// CHECK-ENCODING: [0x00,0x38,0x7f,0x45] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: 00 38 7f 45 + +uqrshrnb z31.s, z31.d, #32 +// CHECK-INST: uqrshrnb z31.s, z31.d, #32 +// CHECK-ENCODING: [0xff,0x3b,0x60,0x45] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: ff 3b 60 45 Index: llvm/trunk/test/MC/AArch64/SVE2/uqrshrnt-diagnostics.s =================================================================== --- llvm/trunk/test/MC/AArch64/SVE2/uqrshrnt-diagnostics.s +++ llvm/trunk/test/MC/AArch64/SVE2/uqrshrnt-diagnostics.s @@ -0,0 +1,65 @@ +// RUN: not llvm-mc -triple=aarch64 -show-encoding -mattr=+sve2 2>&1 < %s| FileCheck %s + +uqrshrnt z30.b, z10.h, #0 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [1, 8] +// CHECK-NEXT: uqrshrnt z30.b, z10.h, #0 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +uqrshrnt z18.b, z27.h, #9 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [1, 8] +// CHECK-NEXT: uqrshrnt z18.b, z27.h, #9 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +uqrshrnt z26.h, z4.s, #0 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [1, 16] +// CHECK-NEXT: uqrshrnt z26.h, z4.s, #0 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +uqrshrnt z25.h, z10.s, #17 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [1, 16] +// CHECK-NEXT: uqrshrnt z25.h, z10.s, #17 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +uqrshrnt z17.s, z0.d, #0 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [1, 32] +// CHECK-NEXT: uqrshrnt z17.s, z0.d, #0 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +uqrshrnt z0.s, z15.d, #33 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [1, 32] +// CHECK-NEXT: uqrshrnt z0.s, z15.d, #33 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + + +// --------------------------------------------------------------------------// +// Invalid element width + +uqrshrnt z0.b, z0.b, #1 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: uqrshrnt z0.b, z0.b, #1 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +uqrshrnt z0.h, z0.h, #1 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: uqrshrnt z0.h, z0.h, #1 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +uqrshrnt z0.s, z0.s, #1 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: uqrshrnt z0.s, z0.s, #1 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +uqrshrnt z0.d, z0.d, #1 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: uqrshrnt z0.d, z0.d, #1 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + + +// --------------------------------------------------------------------------// +// Negative tests for instructions that are incompatible with movprfx + +movprfx z31, z6 +uqrshrnt z31.s, z31.d, #32 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a movprfx, suggest replacing movprfx with mov +// CHECK-NEXT: uqrshrnt z31.s, z31.d, #32 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: Index: llvm/trunk/test/MC/AArch64/SVE2/uqrshrnt.s =================================================================== --- llvm/trunk/test/MC/AArch64/SVE2/uqrshrnt.s +++ llvm/trunk/test/MC/AArch64/SVE2/uqrshrnt.s @@ -0,0 +1,44 @@ +// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sve2 < %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=+sve2 < %s \ +// RUN: | llvm-objdump -d -mattr=+sve2 - | FileCheck %s --check-prefix=CHECK-INST +// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sve2 < %s \ +// RUN: | llvm-objdump -d - | FileCheck %s --check-prefix=CHECK-UNKNOWN + +uqrshrnt z0.b, z0.h, #1 +// CHECK-INST: uqrshrnt z0.b, z0.h, #1 +// CHECK-ENCODING: [0x00,0x3c,0x2f,0x45] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: 00 3c 2f 45 + +uqrshrnt z31.b, z31.h, #8 +// CHECK-INST: uqrshrnt z31.b, z31.h, #8 +// CHECK-ENCODING: [0xff,0x3f,0x28,0x45] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: ff 3f 28 45 + +uqrshrnt z0.h, z0.s, #1 +// CHECK-INST: uqrshrnt z0.h, z0.s, #1 +// CHECK-ENCODING: [0x00,0x3c,0x3f,0x45] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: 00 3c 3f 45 + +uqrshrnt z31.h, z31.s, #16 +// CHECK-INST: uqrshrnt z31.h, z31.s, #16 +// CHECK-ENCODING: [0xff,0x3f,0x30,0x45] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: ff 3f 30 45 + +uqrshrnt z0.s, z0.d, #1 +// CHECK-INST: uqrshrnt z0.s, z0.d, #1 +// CHECK-ENCODING: [0x00,0x3c,0x7f,0x45] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: 00 3c 7f 45 + +uqrshrnt z31.s, z31.d, #32 +// CHECK-INST: uqrshrnt z31.s, z31.d, #32 +// CHECK-ENCODING: [0xff,0x3f,0x60,0x45] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: ff 3f 60 45 Index: llvm/trunk/test/MC/AArch64/SVE2/uqshrnb-diagnostics.s =================================================================== --- llvm/trunk/test/MC/AArch64/SVE2/uqshrnb-diagnostics.s +++ llvm/trunk/test/MC/AArch64/SVE2/uqshrnb-diagnostics.s @@ -0,0 +1,65 @@ +// RUN: not llvm-mc -triple=aarch64 -show-encoding -mattr=+sve2 2>&1 < %s| FileCheck %s + +uqshrnb z30.b, z10.h, #0 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [1, 8] +// CHECK-NEXT: uqshrnb z30.b, z10.h, #0 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +uqshrnb z18.b, z27.h, #9 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [1, 8] +// CHECK-NEXT: uqshrnb z18.b, z27.h, #9 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +uqshrnb z26.h, z4.s, #0 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [1, 16] +// CHECK-NEXT: uqshrnb z26.h, z4.s, #0 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +uqshrnb z25.h, z10.s, #17 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [1, 16] +// CHECK-NEXT: uqshrnb z25.h, z10.s, #17 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +uqshrnb z17.s, z0.d, #0 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [1, 32] +// CHECK-NEXT: uqshrnb z17.s, z0.d, #0 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +uqshrnb z0.s, z15.d, #33 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [1, 32] +// CHECK-NEXT: uqshrnb z0.s, z15.d, #33 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + + +// --------------------------------------------------------------------------// +// Invalid element width + +uqshrnb z0.b, z0.b, #1 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: uqshrnb z0.b, z0.b, #1 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +uqshrnb z0.h, z0.h, #1 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: uqshrnb z0.h, z0.h, #1 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +uqshrnb z0.s, z0.s, #1 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: uqshrnb z0.s, z0.s, #1 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +uqshrnb z0.d, z0.d, #1 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: uqshrnb z0.d, z0.d, #1 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + + +// --------------------------------------------------------------------------// +// Negative tests for instructions that are incompatible with movprfx + +movprfx z31, z6 +uqshrnb z31.s, z31.d, #32 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a movprfx, suggest replacing movprfx with mov +// CHECK-NEXT: uqshrnb z31.s, z31.d, #32 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: Index: llvm/trunk/test/MC/AArch64/SVE2/uqshrnb.s =================================================================== --- llvm/trunk/test/MC/AArch64/SVE2/uqshrnb.s +++ llvm/trunk/test/MC/AArch64/SVE2/uqshrnb.s @@ -0,0 +1,44 @@ +// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sve2 < %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=+sve2 < %s \ +// RUN: | llvm-objdump -d -mattr=+sve2 - | FileCheck %s --check-prefix=CHECK-INST +// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sve2 < %s \ +// RUN: | llvm-objdump -d - | FileCheck %s --check-prefix=CHECK-UNKNOWN + +uqshrnb z0.b, z0.h, #1 +// CHECK-INST: uqshrnb z0.b, z0.h, #1 +// CHECK-ENCODING: [0x00,0x30,0x2f,0x45] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: 00 30 2f 45 + +uqshrnb z31.b, z31.h, #8 +// CHECK-INST: uqshrnb z31.b, z31.h, #8 +// CHECK-ENCODING: [0xff,0x33,0x28,0x45] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: ff 33 28 45 + +uqshrnb z0.h, z0.s, #1 +// CHECK-INST: uqshrnb z0.h, z0.s, #1 +// CHECK-ENCODING: [0x00,0x30,0x3f,0x45] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: 00 30 3f 45 + +uqshrnb z31.h, z31.s, #16 +// CHECK-INST: uqshrnb z31.h, z31.s, #16 +// CHECK-ENCODING: [0xff,0x33,0x30,0x45] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: ff 33 30 45 + +uqshrnb z0.s, z0.d, #1 +// CHECK-INST: uqshrnb z0.s, z0.d, #1 +// CHECK-ENCODING: [0x00,0x30,0x7f,0x45] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: 00 30 7f 45 + +uqshrnb z31.s, z31.d, #32 +// CHECK-INST: uqshrnb z31.s, z31.d, #32 +// CHECK-ENCODING: [0xff,0x33,0x60,0x45] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: ff 33 60 45 Index: llvm/trunk/test/MC/AArch64/SVE2/uqshrnt-diagnostics.s =================================================================== --- llvm/trunk/test/MC/AArch64/SVE2/uqshrnt-diagnostics.s +++ llvm/trunk/test/MC/AArch64/SVE2/uqshrnt-diagnostics.s @@ -0,0 +1,65 @@ +// RUN: not llvm-mc -triple=aarch64 -show-encoding -mattr=+sve2 2>&1 < %s| FileCheck %s + +uqshrnt z30.b, z10.h, #0 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [1, 8] +// CHECK-NEXT: uqshrnt z30.b, z10.h, #0 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +uqshrnt z18.b, z27.h, #9 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [1, 8] +// CHECK-NEXT: uqshrnt z18.b, z27.h, #9 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +uqshrnt z26.h, z4.s, #0 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [1, 16] +// CHECK-NEXT: uqshrnt z26.h, z4.s, #0 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +uqshrnt z25.h, z10.s, #17 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [1, 16] +// CHECK-NEXT: uqshrnt z25.h, z10.s, #17 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +uqshrnt z17.s, z0.d, #0 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [1, 32] +// CHECK-NEXT: uqshrnt z17.s, z0.d, #0 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +uqshrnt z0.s, z15.d, #33 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [1, 32] +// CHECK-NEXT: uqshrnt z0.s, z15.d, #33 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + + +// --------------------------------------------------------------------------// +// Invalid element width + +uqshrnt z0.b, z0.b, #1 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: uqshrnt z0.b, z0.b, #1 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +uqshrnt z0.h, z0.h, #1 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: uqshrnt z0.h, z0.h, #1 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +uqshrnt z0.s, z0.s, #1 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: uqshrnt z0.s, z0.s, #1 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +uqshrnt z0.d, z0.d, #1 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: uqshrnt z0.d, z0.d, #1 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + + +// --------------------------------------------------------------------------// +// Negative tests for instructions that are incompatible with movprfx + +movprfx z31, z6 +uqshrnt z31.s, z31.d, #32 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a movprfx, suggest replacing movprfx with mov +// CHECK-NEXT: uqshrnt z31.s, z31.d, #32 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: Index: llvm/trunk/test/MC/AArch64/SVE2/uqshrnt.s =================================================================== --- llvm/trunk/test/MC/AArch64/SVE2/uqshrnt.s +++ llvm/trunk/test/MC/AArch64/SVE2/uqshrnt.s @@ -0,0 +1,44 @@ +// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sve2 < %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=+sve2 < %s \ +// RUN: | llvm-objdump -d -mattr=+sve2 - | FileCheck %s --check-prefix=CHECK-INST +// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sve2 < %s \ +// RUN: | llvm-objdump -d - | FileCheck %s --check-prefix=CHECK-UNKNOWN + +uqshrnt z0.b, z0.h, #1 +// CHECK-INST: uqshrnt z0.b, z0.h, #1 +// CHECK-ENCODING: [0x00,0x34,0x2f,0x45] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: 00 34 2f 45 + +uqshrnt z31.b, z31.h, #8 +// CHECK-INST: uqshrnt z31.b, z31.h, #8 +// CHECK-ENCODING: [0xff,0x37,0x28,0x45] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: ff 37 28 45 + +uqshrnt z0.h, z0.s, #1 +// CHECK-INST: uqshrnt z0.h, z0.s, #1 +// CHECK-ENCODING: [0x00,0x34,0x3f,0x45] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: 00 34 3f 45 + +uqshrnt z31.h, z31.s, #16 +// CHECK-INST: uqshrnt z31.h, z31.s, #16 +// CHECK-ENCODING: [0xff,0x37,0x30,0x45] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: ff 37 30 45 + +uqshrnt z0.s, z0.d, #1 +// CHECK-INST: uqshrnt z0.s, z0.d, #1 +// CHECK-ENCODING: [0x00,0x34,0x7f,0x45] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: 00 34 7f 45 + +uqshrnt z31.s, z31.d, #32 +// CHECK-INST: uqshrnt z31.s, z31.d, #32 +// CHECK-ENCODING: [0xff,0x37,0x60,0x45] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: ff 37 60 45 Index: llvm/trunk/test/MC/AArch64/SVE2/uqxtnb-diagnostics.s =================================================================== --- llvm/trunk/test/MC/AArch64/SVE2/uqxtnb-diagnostics.s +++ llvm/trunk/test/MC/AArch64/SVE2/uqxtnb-diagnostics.s @@ -0,0 +1,40 @@ +// RUN: not llvm-mc -triple=aarch64 -show-encoding -mattr=+sve2 2>&1 < %s| FileCheck %s + + +// ------------------------------------------------------------------------- // +// Invalid element width + +uqxtnb z0.b, z1.b +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: uqxtnb z0.b, z1.b +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +uqxtnb z0.h, z1.h +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: uqxtnb z0.h, z1.h +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +uqxtnb z0.s, z1.s +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: uqxtnb z0.s, z1.s +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +uqxtnb z0.d, z1.d +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: uqxtnb z0.d, z1.d +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +// --------------------------------------------------------------------------// +// Negative tests for instructions that are incompatible with movprfx + +movprfx z0, z7 +uqxtnb z0.s, z1.d +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a movprfx, suggest replacing movprfx with mov +// CHECK-NEXT: uqxtnb z0.s, z1.d +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +movprfx z0.s, p0/z, z7.s +uqxtnb z0.s, z1.d +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a movprfx, suggest replacing movprfx with mov +// CHECK-NEXT: uqxtnb z0.s, z1.d +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: Index: llvm/trunk/test/MC/AArch64/SVE2/uqxtnb.s =================================================================== --- llvm/trunk/test/MC/AArch64/SVE2/uqxtnb.s +++ llvm/trunk/test/MC/AArch64/SVE2/uqxtnb.s @@ -0,0 +1,27 @@ +// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sve2 < %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=+sve2 < %s \ +// RUN: | llvm-objdump -d -mattr=+sve2 - | FileCheck %s --check-prefix=CHECK-INST +// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sve2 < %s \ +// RUN: | llvm-objdump -d - | FileCheck %s --check-prefix=CHECK-UNKNOWN + + +uqxtnb z0.b, z31.h +// CHECK-INST: uqxtnb z0.b, z31.h +// CHECK-ENCODING: [0xe0,0x4b,0x28,0x45] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: e0 4b 28 45 + +uqxtnb z0.h, z31.s +// CHECK-INST: uqxtnb z0.h, z31.s +// CHECK-ENCODING: [0xe0,0x4b,0x30,0x45] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: e0 4b 30 45 + +uqxtnb z0.s, z31.d +// CHECK-INST: uqxtnb z0.s, z31.d +// CHECK-ENCODING: [0xe0,0x4b,0x60,0x45] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: e0 4b 60 45 Index: llvm/trunk/test/MC/AArch64/SVE2/uqxtnt-diagnostics.s =================================================================== --- llvm/trunk/test/MC/AArch64/SVE2/uqxtnt-diagnostics.s +++ llvm/trunk/test/MC/AArch64/SVE2/uqxtnt-diagnostics.s @@ -0,0 +1,40 @@ +// RUN: not llvm-mc -triple=aarch64 -show-encoding -mattr=+sve2 2>&1 < %s| FileCheck %s + + +// ------------------------------------------------------------------------- // +// Invalid element width + +uqxtnt z0.b, z1.b +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: uqxtnt z0.b, z1.b +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +uqxtnt z0.h, z1.h +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: uqxtnt z0.h, z1.h +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +uqxtnt z0.s, z1.s +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: uqxtnt z0.s, z1.s +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +uqxtnt z0.d, z1.d +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: uqxtnt z0.d, z1.d +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +// --------------------------------------------------------------------------// +// Negative tests for instructions that are incompatible with movprfx + +movprfx z0, z7 +uqxtnt z0.s, z1.d +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a movprfx, suggest replacing movprfx with mov +// CHECK-NEXT: uqxtnt z0.s, z1.d +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +movprfx z0.s, p0/z, z7.s +uqxtnt z0.s, z1.d +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a movprfx, suggest replacing movprfx with mov +// CHECK-NEXT: uqxtnt z0.s, z1.d +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: Index: llvm/trunk/test/MC/AArch64/SVE2/uqxtnt.s =================================================================== --- llvm/trunk/test/MC/AArch64/SVE2/uqxtnt.s +++ llvm/trunk/test/MC/AArch64/SVE2/uqxtnt.s @@ -0,0 +1,27 @@ +// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sve2 < %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=+sve2 < %s \ +// RUN: | llvm-objdump -d -mattr=+sve2 - | FileCheck %s --check-prefix=CHECK-INST +// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sve2 < %s \ +// RUN: | llvm-objdump -d - | FileCheck %s --check-prefix=CHECK-UNKNOWN + + +uqxtnt z0.b, z31.h +// CHECK-INST: uqxtnt z0.b, z31.h +// CHECK-ENCODING: [0xe0,0x4f,0x28,0x45] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: e0 4f 28 45 + +uqxtnt z0.h, z31.s +// CHECK-INST: uqxtnt z0.h, z31.s +// CHECK-ENCODING: [0xe0,0x4f,0x30,0x45] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: e0 4f 30 45 + +uqxtnt z0.s, z31.d +// CHECK-INST: uqxtnt z0.s, z31.d +// CHECK-ENCODING: [0xe0,0x4f,0x60,0x45] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: e0 4f 60 45