Index: lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp =================================================================== --- lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp +++ lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp @@ -140,8 +140,7 @@ template OperandMatchResultTy tryParseSVEDataVector(OperandVector &Operands); OperandMatchResultTy tryParseSVEPredicateVector(OperandVector &Operands); - LLVM_ATTRIBUTE_UNUSED OperandMatchResultTy - tryParseSVEPattern(OperandVector &Operands); + OperandMatchResultTy tryParseSVEPattern(OperandVector &Operands); public: enum AArch64MatchResultTy { @@ -3659,6 +3658,8 @@ ComputeAvailableFeatures(STI->getFeatureBits())); return Error(Loc, "unrecognized instruction mnemonic" + Suggestion); } + case Match_InvalidSVEPattern: + return Error(Loc, "invalid predicate pattern"); case Match_InvalidSVEPredicateAnyReg: case Match_InvalidSVEPredicateBReg: case Match_InvalidSVEPredicateHReg: @@ -4096,6 +4097,7 @@ case Match_InvalidComplexRotationEven: case Match_InvalidComplexRotationOdd: case Match_InvalidSVEPredicateAnyReg: + case Match_InvalidSVEPattern: case Match_InvalidSVEPredicateBReg: case Match_InvalidSVEPredicateHReg: case Match_InvalidSVEPredicateSReg: Index: lib/Target/AArch64/SVEInstrFormats.td =================================================================== --- lib/Target/AArch64/SVEInstrFormats.td +++ lib/Target/AArch64/SVEInstrFormats.td @@ -11,6 +11,68 @@ // //===----------------------------------------------------------------------===// +def SVEPatternOperand : AsmOperandClass { + let Name = "SVEPattern"; + let ParserMethod = "tryParseSVEPattern"; + let PredicateMethod = "isSVEPattern"; + let RenderMethod = "addImmOperands"; + let DiagnosticType = "InvalidSVEPattern"; +} + +def sve_pred_enum : Operand, ImmLeaf { + + let PrintMethod = "printSVEPattern"; + let ParserMatchClass = SVEPatternOperand; +} + +//===----------------------------------------------------------------------===// +// SVE PTrue - These are used extensively throughout the pattern matching so +// it's important we define them first. +//===----------------------------------------------------------------------===// + +class sve_int_ptrue sz8_64, bits<3> opc, string asm, PPRRegOp pprty> +: I<(outs pprty:$Pd), (ins sve_pred_enum:$pattern), + asm, "\t$Pd, $pattern", + "", + []>, Sched<[]> { + bits<4> Pd; + bits<5> pattern; + let Inst{31-24} = 0b00100101; + let Inst{23-22} = sz8_64; + let Inst{21-19} = 0b011; + let Inst{18-17} = opc{2-1}; + let Inst{16} = opc{0}; + let Inst{15-10} = 0b111000; + let Inst{9-5} = pattern; + let Inst{4} = 0b0; + let Inst{3-0} = Pd; + + let Defs = !if(!eq (opc{0}, 1), [NZCV], []); +} + +multiclass sve_int_ptrue opc, string asm> { + def _B : sve_int_ptrue<0b00, opc, asm, PPR8>; + def _H : sve_int_ptrue<0b01, opc, asm, PPR16>; + def _S : sve_int_ptrue<0b10, opc, asm, PPR32>; + def _D : sve_int_ptrue<0b11, opc, asm, PPR64>; + + def : InstAlias(NAME # _B) PPR8:$Pd, 0b11111), 1>; + def : InstAlias(NAME # _H) PPR16:$Pd, 0b11111), 1>; + def : InstAlias(NAME # _S) PPR32:$Pd, 0b11111), 1>; + def : InstAlias(NAME # _D) PPR64:$Pd, 0b11111), 1>; +} + +let Predicates = [HasSVE] in { + defm PTRUE : sve_int_ptrue<0b000, "ptrue">; + defm PTRUES : sve_int_ptrue<0b001, "ptrues">; +} + //===----------------------------------------------------------------------===// // SVE Integer Arithmetic - Unpredicated Group. //===----------------------------------------------------------------------===// @@ -100,4 +162,4 @@ def _H : sve_int_perm_bin_perm_pp; def _S : sve_int_perm_bin_perm_pp; def _D : sve_int_perm_bin_perm_pp; -} \ No newline at end of file +} Index: test/MC/AArch64/SVE/ptrue-diagnostics.s =================================================================== --- /dev/null +++ test/MC/AArch64/SVE/ptrue-diagnostics.s @@ -0,0 +1,29 @@ +// RUN: not llvm-mc -triple=aarch64 -show-encoding -mattr=+sve 2>&1 < %s| FileCheck %s + +// --------------------------------------------------------------------------// +// Invalid pattern name +// --------------------------------------------------------------------------// + +ptrue p0.s, vl512 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid predicate pattern +// CHECK-NEXT: ptrue p0.s, vl512 +// CHECK-NOT: [[@LINE-3]]:{{[0-9]+}}: + +ptrue p0.s, vl9 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid predicate pattern +// CHECK-NEXT: ptrue p0.s, vl9 +// CHECK-NOT: [[@LINE-3]]:{{[0-9]+}}: + +// --------------------------------------------------------------------------// +// Invalid immediate range +// --------------------------------------------------------------------------// + +ptrue p0.s, #-1 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid predicate pattern +// CHECK-NEXT: ptrue p0.s, #-1 +// CHECK-NOT: [[@LINE-3]]:{{[0-9]+}}: + +ptrue p0.s, #32 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid predicate pattern +// CHECK-NEXT: ptrue p0.s, #32 +// CHECK-NOT: [[@LINE-3]]:{{[0-9]+}}: Index: test/MC/AArch64/SVE/ptrue.s =================================================================== --- /dev/null +++ test/MC/AArch64/SVE/ptrue.s @@ -0,0 +1,264 @@ +// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sve < %s \ +// RUN: | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST +// RUN: not llvm-mc -triple=aarch64 -show-encoding < %s 2>&1 \ +// RUN: | FileCheck %s --check-prefix=CHECK-ERROR +// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sve < %s \ +// RUN: | llvm-objdump -d -mattr=+sve - | FileCheck %s --check-prefix=CHECK-INST +// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sve < %s \ +// RUN: | llvm-objdump -d - | FileCheck %s --check-prefix=CHECK-UNKNOWN + +// ---------------------------------------------------------------------------// +// Test all predicate sizes for pow2 pattern +// ---------------------------------------------------------------------------// + +ptrue p0.b, pow2 +// CHECK-INST: ptrue p0.b, pow2 +// CHECK-ENCODING: [0x00,0xe0,0x18,0x25] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: 00 e0 18 25 + +ptrue p0.h, pow2 +// CHECK-INST: ptrue p0.h, pow2 +// CHECK-ENCODING: [0x00,0xe0,0x58,0x25] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: 00 e0 58 25 + +ptrue p0.s, pow2 +// CHECK-INST: ptrue p0.s, pow2 +// CHECK-ENCODING: [0x00,0xe0,0x98,0x25] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: 00 e0 98 25 + +ptrue p0.d, pow2 +// CHECK-INST: ptrue p0.d, pow2 +// CHECK-ENCODING: [0x00,0xe0,0xd8,0x25] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: 00 e0 d8 25 + +// ---------------------------------------------------------------------------// +// Test all predicate sizes without explicit pattern +// ---------------------------------------------------------------------------// + +ptrue p15.b +// CHECK-INST: ptrue p15.b +// CHECK-ENCODING: [0xef,0xe3,0x18,0x25] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: ef e3 18 25 + +ptrue p15.h +// CHECK-INST: ptrue p15.h +// CHECK-ENCODING: [0xef,0xe3,0x58,0x25] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: ef e3 58 25 + +ptrue p15.s +// CHECK-INST: ptrue p15.s +// CHECK-ENCODING: [0xef,0xe3,0x98,0x25] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: ef e3 98 25 + +ptrue p15.d +// CHECK-INST: ptrue p15.d +// CHECK-ENCODING: [0xef,0xe3,0xd8,0x25] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: ef e3 d8 25 + +// ---------------------------------------------------------------------------// +// Test available patterns +// ---------------------------------------------------------------------------// + +ptrue p7.s, #1 +// CHECK-INST: ptrue p7.s, vl1 +// CHECK-ENCODING: [0x27,0xe0,0x98,0x25] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: 27 e0 98 25 + +ptrue p7.s, vl1 +// CHECK-INST: ptrue p7.s, vl1 +// CHECK-ENCODING: [0x27,0xe0,0x98,0x25] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: 27 e0 98 25 + +ptrue p7.s, vl2 +// CHECK-INST: ptrue p7.s, vl2 +// CHECK-ENCODING: [0x47,0xe0,0x98,0x25] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: 47 e0 98 25 + +ptrue p7.s, vl3 +// CHECK-INST: ptrue p7.s, vl3 +// CHECK-ENCODING: [0x67,0xe0,0x98,0x25] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: 67 e0 98 25 + +ptrue p7.s, vl4 +// CHECK-INST: ptrue p7.s, vl4 +// CHECK-ENCODING: [0x87,0xe0,0x98,0x25] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: 87 e0 98 25 + +ptrue p7.s, vl5 +// CHECK-INST: ptrue p7.s, vl5 +// CHECK-ENCODING: [0xa7,0xe0,0x98,0x25] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: a7 e0 98 25 + +ptrue p7.s, vl6 +// CHECK-INST: ptrue p7.s, vl6 +// CHECK-ENCODING: [0xc7,0xe0,0x98,0x25] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: c7 e0 98 25 + +ptrue p7.s, vl7 +// CHECK-INST: ptrue p7.s, vl7 +// CHECK-ENCODING: [0xe7,0xe0,0x98,0x25] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: e7 e0 98 25 + +ptrue p7.s, vl8 +// CHECK-INST: ptrue p7.s, vl8 +// CHECK-ENCODING: [0x07,0xe1,0x98,0x25] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: 07 e1 98 25 + +ptrue p7.s, vl16 +// CHECK-INST: ptrue p7.s, vl16 +// CHECK-ENCODING: [0x27,0xe1,0x98,0x25] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: 27 e1 98 25 + +ptrue p7.s, vl32 +// CHECK-INST: ptrue p7.s, vl32 +// CHECK-ENCODING: [0x47,0xe1,0x98,0x25] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: 47 e1 98 25 + +ptrue p7.s, vl64 +// CHECK-INST: ptrue p7.s, vl64 +// CHECK-ENCODING: [0x67,0xe1,0x98,0x25] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: 67 e1 98 25 + +ptrue p7.s, vl128 +// CHECK-INST: ptrue p7.s, vl128 +// CHECK-ENCODING: [0x87,0xe1,0x98,0x25] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: 87 e1 98 25 + +ptrue p7.s, vl256 +// CHECK-INST: ptrue p7.s, vl256 +// CHECK-ENCODING: [0xa7,0xe1,0x98,0x25] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: a7 e1 98 25 + +ptrue p7.s, mul4 +// CHECK-INST: ptrue p7.s, mul4 +// CHECK-ENCODING: [0xa7,0xe3,0x98,0x25] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: a7 e3 98 25 + +ptrue p7.s, mul3 +// CHECK-INST: ptrue p7.s, mul3 +// CHECK-ENCODING: [0xc7,0xe3,0x98,0x25] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: c7 e3 98 25 + +ptrue p7.s, all +// CHECK-INST: ptrue p7.s +// CHECK-ENCODING: [0xe7,0xe3,0x98,0x25] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: e7 e3 98 25 + +// ---------------------------------------------------------------------------// +// Test immediate values not corresponding to a named pattern +// ---------------------------------------------------------------------------// + +ptrue p7.s, #14 +// CHECK-INST: ptrue p7.s, #14 +// CHECK-ENCODING: [0xc7,0xe1,0x98,0x25] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: c7 e1 98 25 + +ptrue p7.s, #15 +// CHECK-INST: ptrue p7.s, #15 +// CHECK-ENCODING: [0xe7,0xe1,0x98,0x25] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: e7 e1 98 25 + +ptrue p7.s, #16 +// CHECK-INST: ptrue p7.s, #16 +// CHECK-ENCODING: [0x07,0xe2,0x98,0x25] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: 07 e2 98 25 + +ptrue p7.s, #17 +// CHECK-INST: ptrue p7.s, #17 +// CHECK-ENCODING: [0x27,0xe2,0x98,0x25] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: 27 e2 98 25 + +ptrue p7.s, #18 +// CHECK-INST: ptrue p7.s, #18 +// CHECK-ENCODING: [0x47,0xe2,0x98,0x25] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: 47 e2 98 25 + +ptrue p7.s, #19 +// CHECK-INST: ptrue p7.s, #19 +// CHECK-ENCODING: [0x67,0xe2,0x98,0x25] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: 67 e2 98 25 + +ptrue p7.s, #20 +// CHECK-INST: ptrue p7.s, #20 +// CHECK-ENCODING: [0x87,0xe2,0x98,0x25] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: 87 e2 98 25 + +ptrue p7.s, #21 +// CHECK-INST: ptrue p7.s, #21 +// CHECK-ENCODING: [0xa7,0xe2,0x98,0x25] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: a7 e2 98 25 + +ptrue p7.s, #22 +// CHECK-INST: ptrue p7.s, #22 +// CHECK-ENCODING: [0xc7,0xe2,0x98,0x25] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: c7 e2 98 25 + +ptrue p7.s, #23 +// CHECK-INST: ptrue p7.s, #23 +// CHECK-ENCODING: [0xe7,0xe2,0x98,0x25] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: e7 e2 98 25 + +ptrue p7.s, #24 +// CHECK-INST: ptrue p7.s, #24 +// CHECK-ENCODING: [0x07,0xe3,0x98,0x25] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: 07 e3 98 25 + +ptrue p7.s, #25 +// CHECK-INST: ptrue p7.s, #25 +// CHECK-ENCODING: [0x27,0xe3,0x98,0x25] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: 27 e3 98 25 + +ptrue p7.s, #26 +// CHECK-INST: ptrue p7.s, #26 +// CHECK-ENCODING: [0x47,0xe3,0x98,0x25] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: 47 e3 98 25 + +ptrue p7.s, #27 +// CHECK-INST: ptrue p7.s, #27 +// CHECK-ENCODING: [0x67,0xe3,0x98,0x25] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: 67 e3 98 25 + +ptrue p7.s, #28 +// CHECK-INST: ptrue p7.s, #28 +// CHECK-ENCODING: [0x87,0xe3,0x98,0x25] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: 87 e3 98 25 Index: test/MC/AArch64/SVE/ptrues-diagnostics.s =================================================================== --- /dev/null +++ test/MC/AArch64/SVE/ptrues-diagnostics.s @@ -0,0 +1,29 @@ +// RUN: not llvm-mc -triple=aarch64 -show-encoding -mattr=+sve 2>&1 < %s| FileCheck %s + +// --------------------------------------------------------------------------// +// Invalid pattern name +// --------------------------------------------------------------------------// + +ptrues p0.s, vl512 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid predicate pattern +// CHECK-NEXT: ptrues p0.s, vl512 +// CHECK-NOT: [[@LINE-3]]:{{[0-9]+}}: + +ptrues p0.s, vl9 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid predicate pattern +// CHECK-NEXT: ptrues p0.s, vl9 +// CHECK-NOT: [[@LINE-3]]:{{[0-9]+}}: + +// --------------------------------------------------------------------------// +// Invalid immediate range +// --------------------------------------------------------------------------// + +ptrues p0.s, #-1 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid predicate pattern +// CHECK-NEXT: ptrues p0.s, #-1 +// CHECK-NOT: [[@LINE-3]]:{{[0-9]+}}: + +ptrues p0.s, #32 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid predicate pattern +// CHECK-NEXT: ptrues p0.s, #32 +// CHECK-NOT: [[@LINE-3]]:{{[0-9]+}}: Index: test/MC/AArch64/SVE/ptrues.s =================================================================== --- /dev/null +++ test/MC/AArch64/SVE/ptrues.s @@ -0,0 +1,264 @@ +// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sve < %s \ +// RUN: | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST +// RUN: not llvm-mc -triple=aarch64 -show-encoding < %s 2>&1 \ +// RUN: | FileCheck %s --check-prefix=CHECK-ERROR +// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sve < %s \ +// RUN: | llvm-objdump -d -mattr=+sve - | FileCheck %s --check-prefix=CHECK-INST +// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sve < %s \ +// RUN: | llvm-objdump -d - | FileCheck %s --check-prefix=CHECK-UNKNOWN + +// ---------------------------------------------------------------------------// +// Test all predicate sizes for pow2 pattern +// ---------------------------------------------------------------------------// + +ptrues p0.b, pow2 +// CHECK-INST: ptrues p0.b, pow2 +// CHECK-ENCODING: [0x00,0xe0,0x19,0x25] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: 00 e0 19 25 + +ptrues p0.h, pow2 +// CHECK-INST: ptrues p0.h, pow2 +// CHECK-ENCODING: [0x00,0xe0,0x59,0x25] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: 00 e0 59 25 + +ptrues p0.s, pow2 +// CHECK-INST: ptrues p0.s, pow2 +// CHECK-ENCODING: [0x00,0xe0,0x99,0x25] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: 00 e0 99 25 + +ptrues p0.d, pow2 +// CHECK-INST: ptrues p0.d, pow2 +// CHECK-ENCODING: [0x00,0xe0,0xd9,0x25] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: 00 e0 d9 25 + +// ---------------------------------------------------------------------------// +// Test all predicate sizes without explicit pattern +// ---------------------------------------------------------------------------// + +ptrues p15.b +// CHECK-INST: ptrues p15.b +// CHECK-ENCODING: [0xef,0xe3,0x19,0x25] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: ef e3 19 25 + +ptrues p15.h +// CHECK-INST: ptrues p15.h +// CHECK-ENCODING: [0xef,0xe3,0x59,0x25] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: ef e3 59 25 + +ptrues p15.s +// CHECK-INST: ptrues p15.s +// CHECK-ENCODING: [0xef,0xe3,0x99,0x25] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: ef e3 99 25 + +ptrues p15.d +// CHECK-INST: ptrues p15.d +// CHECK-ENCODING: [0xef,0xe3,0xd9,0x25] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: ef e3 d9 25 + +// ---------------------------------------------------------------------------// +// Test available patterns +// ---------------------------------------------------------------------------// + +ptrues p7.s, #1 +// CHECK-INST: ptrues p7.s, vl1 +// CHECK-ENCODING: [0x27,0xe0,0x99,0x25] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: 27 e0 99 25 + +ptrues p7.s, vl1 +// CHECK-INST: ptrues p7.s, vl1 +// CHECK-ENCODING: [0x27,0xe0,0x99,0x25] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: 27 e0 99 25 + +ptrues p7.s, vl2 +// CHECK-INST: ptrues p7.s, vl2 +// CHECK-ENCODING: [0x47,0xe0,0x99,0x25] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: 47 e0 99 25 + +ptrues p7.s, vl3 +// CHECK-INST: ptrues p7.s, vl3 +// CHECK-ENCODING: [0x67,0xe0,0x99,0x25] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: 67 e0 99 25 + +ptrues p7.s, vl4 +// CHECK-INST: ptrues p7.s, vl4 +// CHECK-ENCODING: [0x87,0xe0,0x99,0x25] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: 87 e0 99 25 + +ptrues p7.s, vl5 +// CHECK-INST: ptrues p7.s, vl5 +// CHECK-ENCODING: [0xa7,0xe0,0x99,0x25] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: a7 e0 99 25 + +ptrues p7.s, vl6 +// CHECK-INST: ptrues p7.s, vl6 +// CHECK-ENCODING: [0xc7,0xe0,0x99,0x25] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: c7 e0 99 25 + +ptrues p7.s, vl7 +// CHECK-INST: ptrues p7.s, vl7 +// CHECK-ENCODING: [0xe7,0xe0,0x99,0x25] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: e7 e0 99 25 + +ptrues p7.s, vl8 +// CHECK-INST: ptrues p7.s, vl8 +// CHECK-ENCODING: [0x07,0xe1,0x99,0x25] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: 07 e1 99 25 + +ptrues p7.s, vl16 +// CHECK-INST: ptrues p7.s, vl16 +// CHECK-ENCODING: [0x27,0xe1,0x99,0x25] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: 27 e1 99 25 + +ptrues p7.s, vl32 +// CHECK-INST: ptrues p7.s, vl32 +// CHECK-ENCODING: [0x47,0xe1,0x99,0x25] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: 47 e1 99 25 + +ptrues p7.s, vl64 +// CHECK-INST: ptrues p7.s, vl64 +// CHECK-ENCODING: [0x67,0xe1,0x99,0x25] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: 67 e1 99 25 + +ptrues p7.s, vl128 +// CHECK-INST: ptrues p7.s, vl128 +// CHECK-ENCODING: [0x87,0xe1,0x99,0x25] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: 87 e1 99 25 + +ptrues p7.s, vl256 +// CHECK-INST: ptrues p7.s, vl256 +// CHECK-ENCODING: [0xa7,0xe1,0x99,0x25] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: a7 e1 99 25 + +ptrues p7.s, mul4 +// CHECK-INST: ptrues p7.s, mul4 +// CHECK-ENCODING: [0xa7,0xe3,0x99,0x25] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: a7 e3 99 25 + +ptrues p7.s, mul3 +// CHECK-INST: ptrues p7.s, mul3 +// CHECK-ENCODING: [0xc7,0xe3,0x99,0x25] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: c7 e3 99 25 + +ptrues p7.s, all +// CHECK-INST: ptrues p7.s +// CHECK-ENCODING: [0xe7,0xe3,0x99,0x25] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: e7 e3 99 25 + +// ---------------------------------------------------------------------------// +// Test immediate values not corresponding to a named pattern +// ---------------------------------------------------------------------------// + +ptrues p7.s, #14 +// CHECK-INST: ptrues p7.s, #14 +// CHECK-ENCODING: [0xc7,0xe1,0x99,0x25] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: c7 e1 99 25 + +ptrues p7.s, #15 +// CHECK-INST: ptrues p7.s, #15 +// CHECK-ENCODING: [0xe7,0xe1,0x99,0x25] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: e7 e1 99 25 + +ptrues p7.s, #16 +// CHECK-INST: ptrues p7.s, #16 +// CHECK-ENCODING: [0x07,0xe2,0x99,0x25] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: 07 e2 99 25 + +ptrues p7.s, #17 +// CHECK-INST: ptrues p7.s, #17 +// CHECK-ENCODING: [0x27,0xe2,0x99,0x25] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: 27 e2 99 25 + +ptrues p7.s, #18 +// CHECK-INST: ptrues p7.s, #18 +// CHECK-ENCODING: [0x47,0xe2,0x99,0x25] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: 47 e2 99 25 + +ptrues p7.s, #19 +// CHECK-INST: ptrues p7.s, #19 +// CHECK-ENCODING: [0x67,0xe2,0x99,0x25] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: 67 e2 99 25 + +ptrues p7.s, #20 +// CHECK-INST: ptrues p7.s, #20 +// CHECK-ENCODING: [0x87,0xe2,0x99,0x25] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: 87 e2 99 25 + +ptrues p7.s, #21 +// CHECK-INST: ptrues p7.s, #21 +// CHECK-ENCODING: [0xa7,0xe2,0x99,0x25] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: a7 e2 99 25 + +ptrues p7.s, #22 +// CHECK-INST: ptrues p7.s, #22 +// CHECK-ENCODING: [0xc7,0xe2,0x99,0x25] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: c7 e2 99 25 + +ptrues p7.s, #23 +// CHECK-INST: ptrues p7.s, #23 +// CHECK-ENCODING: [0xe7,0xe2,0x99,0x25] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: e7 e2 99 25 + +ptrues p7.s, #24 +// CHECK-INST: ptrues p7.s, #24 +// CHECK-ENCODING: [0x07,0xe3,0x99,0x25] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: 07 e3 99 25 + +ptrues p7.s, #25 +// CHECK-INST: ptrues p7.s, #25 +// CHECK-ENCODING: [0x27,0xe3,0x99,0x25] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: 27 e3 99 25 + +ptrues p7.s, #26 +// CHECK-INST: ptrues p7.s, #26 +// CHECK-ENCODING: [0x47,0xe3,0x99,0x25] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: 47 e3 99 25 + +ptrues p7.s, #27 +// CHECK-INST: ptrues p7.s, #27 +// CHECK-ENCODING: [0x67,0xe3,0x99,0x25] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: 67 e3 99 25 + +ptrues p7.s, #28 +// CHECK-INST: ptrues p7.s, #28 +// CHECK-ENCODING: [0x87,0xe3,0x99,0x25] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: 87 e3 99 25