Skip to content

Commit bfd1395

Browse files
committed
[AArch64][SVE2] Add the SVE2.1 while predicate-as-counter instructions
This patch adds the assembly/disassembly for the following predicate-as-counter instructions: whilelt: While incrementing signed scalar less than scalar whilele: While incrementing signed scalar less than or equal to scalar whilegt: While incrementing signed scalar greater than scalar whilege: While incrementing signed scalar greater than or equal to scalar whilelo: While incrementing unsigned scalar lower than scalar whilels: While incrementing unsigned scalar lower or same as scalar whilehs: While decrementing unsigned scalar higher or same as scalar whilehi: While decrementing unsigned scalar higher than scalar The reference can be found here: https://developer.arm.com/documentation/ddi0602/2022-09 Differential Revision: https://reviews.llvm.org/D136750
1 parent d421080 commit bfd1395

18 files changed

+1163
-0
lines changed

llvm/lib/Target/AArch64/AArch64SVEInstrInfo.td

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3671,4 +3671,13 @@ defm STNT1B_4Z_IMM : sve2p1_mem_cst_si_4z<"stnt1b", 0b00, 0b1, ZZZZ_b_mul_r>;
36713671
defm STNT1H_4Z_IMM : sve2p1_mem_cst_si_4z<"stnt1h", 0b01, 0b1, ZZZZ_h_mul_r>;
36723672
defm STNT1W_4Z_IMM : sve2p1_mem_cst_si_4z<"stnt1w", 0b10, 0b1, ZZZZ_s_mul_r>;
36733673
defm STNT1D_4Z_IMM : sve2p1_mem_cst_si_4z<"stnt1d", 0b11, 0b1, ZZZZ_d_mul_r>;
3674+
3675+
defm WHILEGE_CXX : sve2p1_int_while_rr_pn<"whilege", 0b000>;
3676+
defm WHILEGT_CXX : sve2p1_int_while_rr_pn<"whilegt", 0b001>;
3677+
defm WHILELT_CXX : sve2p1_int_while_rr_pn<"whilelt", 0b010>;
3678+
defm WHILELE_CXX : sve2p1_int_while_rr_pn<"whilele", 0b011>;
3679+
defm WHILEHS_CXX : sve2p1_int_while_rr_pn<"whilehs", 0b100>;
3680+
defm WHILEHI_CXX : sve2p1_int_while_rr_pn<"whilehi", 0b101>;
3681+
defm WHILELO_CXX : sve2p1_int_while_rr_pn<"whilelo", 0b110>;
3682+
defm WHILELS_CXX : sve2p1_int_while_rr_pn<"whilels", 0b111>;
36743683
} // End HasSVE2p1_or_HasSME2

llvm/lib/Target/AArch64/SVEInstrFormats.td

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9058,3 +9058,37 @@ multiclass sve2p1_pcount_pn<string mnemonic, bits<3> opc> {
90589058
def _S : sve2p1_pcount_pn<mnemonic, opc, 0b10, PNR32>;
90599059
def _D : sve2p1_pcount_pn<mnemonic, opc, 0b11, PNR64>;
90609060
}
9061+
9062+
9063+
class sve2p1_int_while_rr_pn<string mnemonic, bits<2> sz, bits<3> opc,
9064+
PNRP8to15RegOp pnrty>
9065+
: I<(outs pnrty:$PNd), (ins GPR64:$Rn, GPR64:$Rm, sve_vec_len_specifier_enum:$vl),
9066+
mnemonic, "\t$PNd, $Rn, $Rm, $vl",
9067+
"", []>, Sched<[]> {
9068+
bits<3> PNd;
9069+
bits<5> Rn;
9070+
bits<1> vl;
9071+
bits<5> Rm;
9072+
let Inst{31-24} = 0b00100101;
9073+
let Inst{23-22} = sz;
9074+
let Inst{21} = 0b1;
9075+
let Inst{20-16} = Rm;
9076+
let Inst{15-14} = 0b01;
9077+
let Inst{13} = vl;
9078+
let Inst{12} = 0b0;
9079+
let Inst{11-10} = opc{2-1};
9080+
let Inst{9-5} = Rn;
9081+
let Inst{4} = 0b1;
9082+
let Inst{3} = opc{0};
9083+
let Inst{2-0} = PNd;
9084+
9085+
let Defs = [NZCV];
9086+
}
9087+
9088+
9089+
multiclass sve2p1_int_while_rr_pn<string mnemonic, bits<3> opc> {
9090+
def _B : sve2p1_int_while_rr_pn<mnemonic, 0b00, opc, PNR8_p8to15>;
9091+
def _H : sve2p1_int_while_rr_pn<mnemonic, 0b01, opc, PNR16_p8to15>;
9092+
def _S : sve2p1_int_while_rr_pn<mnemonic, 0b10, opc, PNR32_p8to15>;
9093+
def _D : sve2p1_int_while_rr_pn<mnemonic, 0b11, opc, PNR64_p8to15>;
9094+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
// RUN: not llvm-mc -triple=aarch64 -show-encoding -mattr=+sve2p1 2>&1 < %s | FileCheck %s
2+
3+
// --------------------------------------------------------------------------//
4+
// Invalid Pattern
5+
6+
whilege pn8.b, x0, x0, vlx1
7+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand
8+
// CHECK-NEXT: whilege pn8.b, x0, x0, vlx1
9+
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
10+
11+
whilege pn8.b, x0, x0
12+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: too few operands for instruction
13+
// CHECK-NEXT: whilege pn8.b, x0, x0
14+
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
15+
16+
// --------------------------------------------------------------------------//
17+
// Invalid use of predicate without suffix
18+
19+
whilege pn8, x0, x0, vlx2
20+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: Invalid predicate register, expected PN in range pn8..pn15 with element suffix.
21+
// CHECK-NEXT: whilege pn8, x0, x0, vlx2
22+
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
23+
24+
// --------------------------------------------------------------------------//
25+
// Out of range Predicate register
26+
27+
whilege pn7.b, x0, x0, vlx2
28+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: Invalid predicate register, expected PN in range pn8..pn15 with element suffix.
29+
// CHECK-NEXT: whilege pn7.b, x0, x0, vlx2
30+
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:

llvm/test/MC/AArch64/SVE2p1/whilege.s

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sme2 < %s \
2+
// RUN: | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST
3+
// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sve2p1 < %s \
4+
// RUN: | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST
5+
// RUN: not llvm-mc -triple=aarch64 -show-encoding < %s 2>&1 \
6+
// RUN: | FileCheck %s --check-prefix=CHECK-ERROR
7+
// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sme2 < %s \
8+
// RUN: | llvm-objdump -d --mattr=+sme2 - | FileCheck %s --check-prefix=CHECK-INST
9+
// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sme2 < %s \
10+
// RUN: | llvm-objdump -d - | FileCheck %s --check-prefix=CHECK-UNKNOWN
11+
// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sme2 < %s \
12+
// RUN: | sed '/.text/d' | sed 's/.*encoding: //g' \
13+
// RUN: | llvm-mc -triple=aarch64 -mattr=+sme2 -disassemble -show-encoding \
14+
// RUN: | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST
15+
16+
whilege pn8.h, x0, x0, vlx2 // 00100101-01100000-01000000-00010000
17+
// CHECK-INST: whilege pn8.h, x0, x0, vlx2
18+
// CHECK-ENCODING: [0x10,0x40,0x60,0x25]
19+
// CHECK-ERROR: instruction requires: sme2 or sve2p1
20+
// CHECK-UNKNOWN: 25604010 <unknown>
21+
22+
whilege pn13.h, x10, x21, vlx2 // 00100101-01110101-01000001-01010101
23+
// CHECK-INST: whilege pn13.h, x10, x21, vlx2
24+
// CHECK-ENCODING: [0x55,0x41,0x75,0x25]
25+
// CHECK-ERROR: instruction requires: sme2 or sve2p1
26+
// CHECK-UNKNOWN: 25754155 <unknown>
27+
28+
whilege pn15.h, x13, x8, vlx4 // 00100101-01101000-01100001-10110111
29+
// CHECK-INST: whilege pn15.h, x13, x8, vlx4
30+
// CHECK-ENCODING: [0xb7,0x61,0x68,0x25]
31+
// CHECK-ERROR: instruction requires: sme2 or sve2p1
32+
// CHECK-UNKNOWN: 256861b7 <unknown>
33+
34+
whilege pn15.h, xzr, xzr, vlx4 // 00100101-01111111-01100011-11110111
35+
// CHECK-INST: whilege pn15.h, xzr, xzr, vlx4
36+
// CHECK-ENCODING: [0xf7,0x63,0x7f,0x25]
37+
// CHECK-ERROR: instruction requires: sme2 or sve2p1
38+
// CHECK-UNKNOWN: 257f63f7 <unknown>
39+
40+
whilege pn8.s, x0, x0, vlx2 // 00100101-10100000-01000000-00010000
41+
// CHECK-INST: whilege pn8.s, x0, x0, vlx2
42+
// CHECK-ENCODING: [0x10,0x40,0xa0,0x25]
43+
// CHECK-ERROR: instruction requires: sme2 or sve2p1
44+
// CHECK-UNKNOWN: 25a04010 <unknown>
45+
46+
whilege pn13.s, x10, x21, vlx2 // 00100101-10110101-01000001-01010101
47+
// CHECK-INST: whilege pn13.s, x10, x21, vlx2
48+
// CHECK-ENCODING: [0x55,0x41,0xb5,0x25]
49+
// CHECK-ERROR: instruction requires: sme2 or sve2p1
50+
// CHECK-UNKNOWN: 25b54155 <unknown>
51+
52+
whilege pn15.s, x13, x8, vlx4 // 00100101-10101000-01100001-10110111
53+
// CHECK-INST: whilege pn15.s, x13, x8, vlx4
54+
// CHECK-ENCODING: [0xb7,0x61,0xa8,0x25]
55+
// CHECK-ERROR: instruction requires: sme2 or sve2p1
56+
// CHECK-UNKNOWN: 25a861b7 <unknown>
57+
58+
whilege pn15.s, xzr, xzr, vlx4 // 00100101-10111111-01100011-11110111
59+
// CHECK-INST: whilege pn15.s, xzr, xzr, vlx4
60+
// CHECK-ENCODING: [0xf7,0x63,0xbf,0x25]
61+
// CHECK-ERROR: instruction requires: sme2 or sve2p1
62+
// CHECK-UNKNOWN: 25bf63f7 <unknown>
63+
64+
whilege pn8.d, x0, x0, vlx2 // 00100101-11100000-01000000-00010000
65+
// CHECK-INST: whilege pn8.d, x0, x0, vlx2
66+
// CHECK-ENCODING: [0x10,0x40,0xe0,0x25]
67+
// CHECK-ERROR: instruction requires: sme2 or sve2p1
68+
// CHECK-UNKNOWN: 25e04010 <unknown>
69+
70+
whilege pn13.d, x10, x21, vlx2 // 00100101-11110101-01000001-01010101
71+
// CHECK-INST: whilege pn13.d, x10, x21, vlx2
72+
// CHECK-ENCODING: [0x55,0x41,0xf5,0x25]
73+
// CHECK-ERROR: instruction requires: sme2 or sve2p1
74+
// CHECK-UNKNOWN: 25f54155 <unknown>
75+
76+
whilege pn15.d, x13, x8, vlx4 // 00100101-11101000-01100001-10110111
77+
// CHECK-INST: whilege pn15.d, x13, x8, vlx4
78+
// CHECK-ENCODING: [0xb7,0x61,0xe8,0x25]
79+
// CHECK-ERROR: instruction requires: sme2 or sve2p1
80+
// CHECK-UNKNOWN: 25e861b7 <unknown>
81+
82+
whilege pn15.d, xzr, xzr, vlx4 // 00100101-11111111-01100011-11110111
83+
// CHECK-INST: whilege pn15.d, xzr, xzr, vlx4
84+
// CHECK-ENCODING: [0xf7,0x63,0xff,0x25]
85+
// CHECK-ERROR: instruction requires: sme2 or sve2p1
86+
// CHECK-UNKNOWN: 25ff63f7 <unknown>
87+
88+
whilege pn8.b, x0, x0, vlx2 // 00100101-00100000-01000000-00010000
89+
// CHECK-INST: whilege pn8.b, x0, x0, vlx2
90+
// CHECK-ENCODING: [0x10,0x40,0x20,0x25]
91+
// CHECK-ERROR: instruction requires: sme2 or sve2p1
92+
// CHECK-UNKNOWN: 25204010 <unknown>
93+
94+
whilege pn13.b, x10, x21, vlx2 // 00100101-00110101-01000001-01010101
95+
// CHECK-INST: whilege pn13.b, x10, x21, vlx2
96+
// CHECK-ENCODING: [0x55,0x41,0x35,0x25]
97+
// CHECK-ERROR: instruction requires: sme2 or sve2p1
98+
// CHECK-UNKNOWN: 25354155 <unknown>
99+
100+
whilege pn15.b, x13, x8, vlx4 // 00100101-00101000-01100001-10110111
101+
// CHECK-INST: whilege pn15.b, x13, x8, vlx4
102+
// CHECK-ENCODING: [0xb7,0x61,0x28,0x25]
103+
// CHECK-ERROR: instruction requires: sme2 or sve2p1
104+
// CHECK-UNKNOWN: 252861b7 <unknown>
105+
106+
whilege pn15.b, xzr, xzr, vlx4 // 00100101-00111111-01100011-11110111
107+
// CHECK-INST: whilege pn15.b, xzr, xzr, vlx4
108+
// CHECK-ENCODING: [0xf7,0x63,0x3f,0x25]
109+
// CHECK-ERROR: instruction requires: sme2 or sve2p1
110+
// CHECK-UNKNOWN: 253f63f7 <unknown>
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
// RUN: not llvm-mc -triple=aarch64 -show-encoding -mattr=+sve2p1 2>&1 < %s | FileCheck %s
2+
3+
// --------------------------------------------------------------------------//
4+
// Invalid Pattern
5+
6+
whilegt pn8.b, x0, x0, vlx1
7+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand
8+
// CHECK-NEXT: whilegt pn8.b, x0, x0, vlx1
9+
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
10+
11+
whilegt pn8.b, x0, x0
12+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: too few operands for instruction
13+
// CHECK-NEXT: whilegt pn8.b, x0, x0
14+
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
15+
16+
// --------------------------------------------------------------------------//
17+
// Invalid use of predicate without suffix
18+
19+
whilegt pn8, x0, x0, vlx2
20+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: Invalid predicate register, expected PN in range pn8..pn15 with element suffix.
21+
// CHECK-NEXT: whilegt pn8, x0, x0, vlx2
22+
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
23+
24+
// --------------------------------------------------------------------------//
25+
// Out of range Predicate register
26+
27+
whilegt pn7.b, x0, x0, vlx2
28+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: Invalid predicate register, expected PN in range pn8..pn15 with element suffix.
29+
// CHECK-NEXT: whilegt pn7.b, x0, x0, vlx2
30+
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:

llvm/test/MC/AArch64/SVE2p1/whilegt.s

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sme2 < %s \
2+
// RUN: | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST
3+
// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sve2p1 < %s \
4+
// RUN: | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST
5+
// RUN: not llvm-mc -triple=aarch64 -show-encoding < %s 2>&1 \
6+
// RUN: | FileCheck %s --check-prefix=CHECK-ERROR
7+
// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sme2 < %s \
8+
// RUN: | llvm-objdump -d --mattr=+sme2 - | FileCheck %s --check-prefix=CHECK-INST
9+
// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sme2 < %s \
10+
// RUN: | llvm-objdump -d - | FileCheck %s --check-prefix=CHECK-UNKNOWN
11+
// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sme2 < %s \
12+
// RUN: | sed '/.text/d' | sed 's/.*encoding: //g' \
13+
// RUN: | llvm-mc -triple=aarch64 -mattr=+sme2 -disassemble -show-encoding \
14+
// RUN: | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST
15+
16+
whilegt pn8.h, x0, x0, vlx2 // 00100101-01100000-01000000-00011000
17+
// CHECK-INST: whilegt pn8.h, x0, x0, vlx2
18+
// CHECK-ENCODING: [0x18,0x40,0x60,0x25]
19+
// CHECK-ERROR: instruction requires: sme2 or sve2p1
20+
// CHECK-UNKNOWN: 25604018 <unknown>
21+
22+
whilegt pn13.h, x10, x21, vlx2 // 00100101-01110101-01000001-01011101
23+
// CHECK-INST: whilegt pn13.h, x10, x21, vlx2
24+
// CHECK-ENCODING: [0x5d,0x41,0x75,0x25]
25+
// CHECK-ERROR: instruction requires: sme2 or sve2p1
26+
// CHECK-UNKNOWN: 2575415d <unknown>
27+
28+
whilegt pn15.h, x13, x8, vlx4 // 00100101-01101000-01100001-10111111
29+
// CHECK-INST: whilegt pn15.h, x13, x8, vlx4
30+
// CHECK-ENCODING: [0xbf,0x61,0x68,0x25]
31+
// CHECK-ERROR: instruction requires: sme2 or sve2p1
32+
// CHECK-UNKNOWN: 256861bf <unknown>
33+
34+
whilegt pn15.h, xzr, xzr, vlx4 // 00100101-01111111-01100011-11111111
35+
// CHECK-INST: whilegt pn15.h, xzr, xzr, vlx4
36+
// CHECK-ENCODING: [0xff,0x63,0x7f,0x25]
37+
// CHECK-ERROR: instruction requires: sme2 or sve2p1
38+
// CHECK-UNKNOWN: 257f63ff <unknown>
39+
40+
whilegt pn8.s, x0, x0, vlx2 // 00100101-10100000-01000000-00011000
41+
// CHECK-INST: whilegt pn8.s, x0, x0, vlx2
42+
// CHECK-ENCODING: [0x18,0x40,0xa0,0x25]
43+
// CHECK-ERROR: instruction requires: sme2 or sve2p1
44+
// CHECK-UNKNOWN: 25a04018 <unknown>
45+
46+
whilegt pn13.s, x10, x21, vlx2 // 00100101-10110101-01000001-01011101
47+
// CHECK-INST: whilegt pn13.s, x10, x21, vlx2
48+
// CHECK-ENCODING: [0x5d,0x41,0xb5,0x25]
49+
// CHECK-ERROR: instruction requires: sme2 or sve2p1
50+
// CHECK-UNKNOWN: 25b5415d <unknown>
51+
52+
whilegt pn15.s, x13, x8, vlx4 // 00100101-10101000-01100001-10111111
53+
// CHECK-INST: whilegt pn15.s, x13, x8, vlx4
54+
// CHECK-ENCODING: [0xbf,0x61,0xa8,0x25]
55+
// CHECK-ERROR: instruction requires: sme2 or sve2p1
56+
// CHECK-UNKNOWN: 25a861bf <unknown>
57+
58+
whilegt pn15.s, xzr, xzr, vlx4 // 00100101-10111111-01100011-11111111
59+
// CHECK-INST: whilegt pn15.s, xzr, xzr, vlx4
60+
// CHECK-ENCODING: [0xff,0x63,0xbf,0x25]
61+
// CHECK-ERROR: instruction requires: sme2 or sve2p1
62+
// CHECK-UNKNOWN: 25bf63ff <unknown>
63+
64+
whilegt pn8.d, x0, x0, vlx2 // 00100101-11100000-01000000-00011000
65+
// CHECK-INST: whilegt pn8.d, x0, x0, vlx2
66+
// CHECK-ENCODING: [0x18,0x40,0xe0,0x25]
67+
// CHECK-ERROR: instruction requires: sme2 or sve2p1
68+
// CHECK-UNKNOWN: 25e04018 <unknown>
69+
70+
whilegt pn13.d, x10, x21, vlx2 // 00100101-11110101-01000001-01011101
71+
// CHECK-INST: whilegt pn13.d, x10, x21, vlx2
72+
// CHECK-ENCODING: [0x5d,0x41,0xf5,0x25]
73+
// CHECK-ERROR: instruction requires: sme2 or sve2p1
74+
// CHECK-UNKNOWN: 25f5415d <unknown>
75+
76+
whilegt pn15.d, x13, x8, vlx4 // 00100101-11101000-01100001-10111111
77+
// CHECK-INST: whilegt pn15.d, x13, x8, vlx4
78+
// CHECK-ENCODING: [0xbf,0x61,0xe8,0x25]
79+
// CHECK-ERROR: instruction requires: sme2 or sve2p1
80+
// CHECK-UNKNOWN: 25e861bf <unknown>
81+
82+
whilegt pn15.d, xzr, xzr, vlx4 // 00100101-11111111-01100011-11111111
83+
// CHECK-INST: whilegt pn15.d, xzr, xzr, vlx4
84+
// CHECK-ENCODING: [0xff,0x63,0xff,0x25]
85+
// CHECK-ERROR: instruction requires: sme2 or sve2p1
86+
// CHECK-UNKNOWN: 25ff63ff <unknown>
87+
88+
whilegt pn8.b, x0, x0, vlx2 // 00100101-00100000-01000000-00011000
89+
// CHECK-INST: whilegt pn8.b, x0, x0, vlx2
90+
// CHECK-ENCODING: [0x18,0x40,0x20,0x25]
91+
// CHECK-ERROR: instruction requires: sme2 or sve2p1
92+
// CHECK-UNKNOWN: 25204018 <unknown>
93+
94+
whilegt pn13.b, x10, x21, vlx2 // 00100101-00110101-01000001-01011101
95+
// CHECK-INST: whilegt pn13.b, x10, x21, vlx2
96+
// CHECK-ENCODING: [0x5d,0x41,0x35,0x25]
97+
// CHECK-ERROR: instruction requires: sme2 or sve2p1
98+
// CHECK-UNKNOWN: 2535415d <unknown>
99+
100+
whilegt pn15.b, x13, x8, vlx4 // 00100101-00101000-01100001-10111111
101+
// CHECK-INST: whilegt pn15.b, x13, x8, vlx4
102+
// CHECK-ENCODING: [0xbf,0x61,0x28,0x25]
103+
// CHECK-ERROR: instruction requires: sme2 or sve2p1
104+
// CHECK-UNKNOWN: 252861bf <unknown>
105+
106+
whilegt pn15.b, xzr, xzr, vlx4 // 00100101-00111111-01100011-11111111
107+
// CHECK-INST: whilegt pn15.b, xzr, xzr, vlx4
108+
// CHECK-ENCODING: [0xff,0x63,0x3f,0x25]
109+
// CHECK-ERROR: instruction requires: sme2 or sve2p1
110+
// CHECK-UNKNOWN: 253f63ff <unknown>
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
// RUN: not llvm-mc -triple=aarch64 -show-encoding -mattr=+sve2p1 2>&1 < %s | FileCheck %s
2+
3+
// --------------------------------------------------------------------------//
4+
// Invalid Pattern
5+
6+
whilehi pn8.b, x0, x0, vlx1
7+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand
8+
// CHECK-NEXT: whilehi pn8.b, x0, x0, vlx1
9+
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
10+
11+
whilehi pn8.b, x0, x0
12+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: too few operands for instruction
13+
// CHECK-NEXT: whilehi pn8.b, x0, x0
14+
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
15+
16+
// --------------------------------------------------------------------------//
17+
// Invalid use of predicate without suffix
18+
19+
whilehi pn8, x0, x0, vlx2
20+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: Invalid predicate register, expected PN in range pn8..pn15 with element suffix.
21+
// CHECK-NEXT: whilehi pn8, x0, x0, vlx2
22+
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
23+
24+
// --------------------------------------------------------------------------//
25+
// Out of range Predicate register
26+
27+
whilehi pn7.b, x0, x0, vlx2
28+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: Invalid predicate register, expected PN in range pn8..pn15 with element suffix.
29+
// CHECK-NEXT: whilehi pn7.b, x0, x0, vlx2
30+
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:

0 commit comments

Comments
 (0)