Skip to content

Commit 85f3d5c

Browse files
authored
[AArch64] Add assembly/disassembly for SVE COMPACT (b/h) and EXPAND (llvm#114053)
This patch adds assembly/disassembly support for the following SVE2.2 instructions - COMPACT (byte, halfword) - EXPAND - Allow selection of `COMPACT` (word/halfword) in streaming mode if the target has FEAT_SME2p2 (see [COMPACT ]( https://developer.arm.com/documentation/ddi0602/2024-09/SVE-Instructions/COMPACT--Copy-active-vector-elements-to-lower-numbered-elements-)) - Rename predicates guarding instructions that are illegal in streaming SVE mode without FEAT_SME2p2 - In accordance with https://developer.arm.com/documentation/ddi0602/2024-09/SVE-Instructions Co-authored-by: Marian Lukac [email protected]
1 parent 55e4e3f commit 85f3d5c

File tree

10 files changed

+320
-15
lines changed

10 files changed

+320
-15
lines changed

llvm/lib/Target/AArch64/AArch64.td

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,8 @@ def SVEUnsupported : AArch64Unsupported {
7373
SVE2Unsupported.F);
7474
}
7575

76-
let F = [HasSME2p2, HasSVE2p2orSME2p2] in
76+
let F = [HasSME2p2, HasSVE2p2orSME2p2, HasNonStreamingSVEorSME2p2,
77+
HasNonStreamingSVE2p2orSME2p2] in
7778
def SME2p2Unsupported : AArch64Unsupported;
7879

7980
def SME2p1Unsupported : AArch64Unsupported {

llvm/lib/Target/AArch64/AArch64InstrInfo.td

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ def HasSVEorSME
244244
: Predicate<"Subtarget->hasSVE() || (Subtarget->isStreaming() && Subtarget->hasSME())">,
245245
AssemblerPredicateWithAll<(any_of FeatureSVE, FeatureSME),
246246
"sve or sme">;
247-
def HasSVEorSME2p2
247+
def HasNonStreamingSVEorSME2p2
248248
: Predicate<"(Subtarget->isSVEAvailable() && Subtarget->hasSVE()) ||"
249249
"(Subtarget->isSVEorStreamingSVEAvailable() && Subtarget->hasSME2p2())">,
250250
AssemblerPredicateWithAll<(any_of FeatureSVE, FeatureSME2p2),
@@ -281,6 +281,11 @@ def HasSMEF16F16orSMEF8F16
281281
: Predicate<"Subtarget->isStreaming() && (Subtarget->hasSMEF16F16() || Subtarget->hasSMEF8F16())">,
282282
AssemblerPredicateWithAll<(any_of FeatureSMEF16F16, FeatureSMEF8F16),
283283
"sme-f16f16 or sme-f8f16">;
284+
def HasNonStreamingSVE2p2orSME2p2
285+
: Predicate<"(Subtarget->isSVEAvailable() && Subtarget->hasSVE2p2()) ||"
286+
"(Subtarget->isSVEorStreamingSVEAvailable() && Subtarget->hasSME2p2())">,
287+
AssemblerPredicateWithAll<(any_of FeatureSVE2p2, FeatureSME2p2),
288+
"sme2p2 or sve2p2">;
284289

285290
// A subset of NEON instructions are legal in Streaming SVE execution mode,
286291
// so don't need the additional check for 'isNeonAvailable'.

llvm/lib/Target/AArch64/AArch64SVEInstrInfo.td

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -928,9 +928,10 @@ let Predicates = [HasSVEorSME] in {
928928
defm SPLICE_ZPZ : sve_int_perm_splice<"splice", AArch64splice>;
929929
} // End HasSVEorSME
930930

931-
let Predicates = [HasSVE] in {
932-
defm COMPACT_ZPZ : sve_int_perm_compact<"compact", int_aarch64_sve_compact>;
933-
} // End HasSVE
931+
// COMPACT - word and doubleword
932+
let Predicates = [HasNonStreamingSVEorSME2p2] in {
933+
defm COMPACT_ZPZ : sve_int_perm_compact_sd<"compact", int_aarch64_sve_compact>;
934+
}
934935

935936
let Predicates = [HasSVEorSME] in {
936937
defm INSR_ZR : sve_int_perm_insrs<"insr", AArch64insr>;
@@ -4305,6 +4306,16 @@ let Predicates = [HasSVE2p2orSME2p2] in {
43054306

43064307
} // End HasSME2p2orSVE2p2
43074308

4309+
//===----------------------------------------------------------------------===//
4310+
// SME2.2 or SVE2.2 instructions - Legal in streaming mode iff target has SME2p2
4311+
//===----------------------------------------------------------------------===//
4312+
let Predicates = [HasNonStreamingSVE2p2orSME2p2] in {
4313+
// SVE2 EXPAND
4314+
defm EXPAND_ZPZ : sve2_int_perm_expand<"expand">;
4315+
// SVE COMPACT - byte and halfword
4316+
defm COMPACT_ZPZ : sve_int_perm_compact_bh<"compact">;
4317+
}
4318+
43084319
//===----------------------------------------------------------------------===//
43094320
// SVE2 FP8 instructions
43104321
//===----------------------------------------------------------------------===//

llvm/lib/Target/AArch64/SVEInstrFormats.td

Lines changed: 37 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7315,6 +7315,32 @@ multiclass sve2_int_perm_splice_cons<string asm> {
73157315
def _D : sve2_int_perm_splice_cons<0b11, asm, ZPR64, ZZ_d>;
73167316
}
73177317

7318+
class sve2_int_perm_expand<bits<2> sz, string asm,
7319+
ZPRRegOp zprty>
7320+
: I<(outs zprty:$Zd), (ins PPR3bAny:$Pg, zprty:$Zn),
7321+
asm, "\t$Zd, $Pg, $Zn",
7322+
"",
7323+
[]>, Sched<[]> {
7324+
bits<3> Pg;
7325+
bits<5> Zn;
7326+
bits<5> Zd;
7327+
let Inst{31-24} = 0b00000101;
7328+
let Inst{23-22} = sz;
7329+
let Inst{21-13} = 0b110001100;
7330+
let Inst{12-10} = Pg;
7331+
let Inst{9-5} = Zn;
7332+
let Inst{4-0} = Zd;
7333+
7334+
let hasSideEffects = 0;
7335+
}
7336+
7337+
multiclass sve2_int_perm_expand<string asm> {
7338+
def _B : sve2_int_perm_expand<0b00, asm, ZPR8>;
7339+
def _H : sve2_int_perm_expand<0b01, asm, ZPR16>;
7340+
def _S : sve2_int_perm_expand<0b10, asm, ZPR32>;
7341+
def _D : sve2_int_perm_expand<0b11, asm, ZPR64>;
7342+
}
7343+
73187344
class sve_int_perm_rev<bits<2> sz8_64, bits<2> opc, string asm,
73197345
ZPRRegOp zprty>
73207346
: I<(outs zprty:$Zd), (ins zprty:$_Zd, PPR3bAny:$Pg, zprty:$Zn),
@@ -7476,16 +7502,16 @@ multiclass sve_int_perm_cpy_v<string asm, SDPatternOperator op> {
74767502
(!cast<Instruction>(NAME # _H) $passthru, $pg, $splat)>;
74777503
}
74787504

7479-
class sve_int_perm_compact<bit sz, string asm, ZPRRegOp zprty>
7505+
class sve_int_perm_compact<bits<2> sz, string asm, ZPRRegOp zprty>
74807506
: I<(outs zprty:$Zd), (ins PPR3bAny:$Pg, zprty:$Zn),
74817507
asm, "\t$Zd, $Pg, $Zn",
74827508
"",
74837509
[]>, Sched<[]> {
74847510
bits<3> Pg;
74857511
bits<5> Zd;
74867512
bits<5> Zn;
7487-
let Inst{31-23} = 0b000001011;
7488-
let Inst{22} = sz;
7513+
let Inst{31-24} = 0b00000101;
7514+
let Inst{23-22} = sz;
74897515
let Inst{21-13} = 0b100001100;
74907516
let Inst{12-10} = Pg;
74917517
let Inst{9-5} = Zn;
@@ -7494,16 +7520,21 @@ class sve_int_perm_compact<bit sz, string asm, ZPRRegOp zprty>
74947520
let hasSideEffects = 0;
74957521
}
74967522

7497-
multiclass sve_int_perm_compact<string asm, SDPatternOperator op> {
7498-
def _S : sve_int_perm_compact<0b0, asm, ZPR32>;
7499-
def _D : sve_int_perm_compact<0b1, asm, ZPR64>;
7523+
multiclass sve_int_perm_compact_sd<string asm, SDPatternOperator op> {
7524+
def _S : sve_int_perm_compact<0b10, asm, ZPR32>;
7525+
def _D : sve_int_perm_compact<0b11, asm, ZPR64>;
75007526

75017527
def : SVE_2_Op_Pat<nxv4i32, op, nxv4i1, nxv4i32, !cast<Instruction>(NAME # _S)>;
75027528
def : SVE_2_Op_Pat<nxv4f32, op, nxv4i1, nxv4f32, !cast<Instruction>(NAME # _S)>;
75037529
def : SVE_2_Op_Pat<nxv2i64, op, nxv2i1, nxv2i64, !cast<Instruction>(NAME # _D)>;
75047530
def : SVE_2_Op_Pat<nxv2f64, op, nxv2i1, nxv2f64, !cast<Instruction>(NAME # _D)>;
75057531
}
75067532

7533+
multiclass sve_int_perm_compact_bh<string asm> {
7534+
def _B : sve_int_perm_compact<0b00, asm, ZPR8>;
7535+
def _H : sve_int_perm_compact<0b01, asm, ZPR16>;
7536+
}
7537+
75077538
//===----------------------------------------------------------------------===//
75087539
// SVE Memory - Contiguous Load Group
75097540
//===----------------------------------------------------------------------===//

llvm/test/MC/AArch64/SVE/compact-diagnostics.s

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,12 @@ compact z31.s, p7, z31.d
2828
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
2929

3030
compact z31.b, p7, z31.b
31-
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width
31+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction requires: sme2p2 or sve2p2
3232
// CHECK-NEXT: compact z31.b, p7, z31.b
3333
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
3434

3535
compact z31.h, p7, z31.h
36-
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width
36+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction requires: sme2p2 or sve2p2
3737
// CHECK-NEXT: compact z31.h, p7, z31.h
3838
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
3939

llvm/test/MC/AArch64/SVE/compact.s

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@
1212
compact z31.s, p7, z31.s
1313
// CHECK-INST: compact z31.s, p7, z31.s
1414
// CHECK-ENCODING: [0xff,0x9f,0xa1,0x05]
15-
// CHECK-ERROR: instruction requires: sve
15+
// CHECK-ERROR: instruction requires: sve or sme2p2
1616
// CHECK-UNKNOWN: 05a19fff <unknown>
1717

1818
compact z31.d, p7, z31.d
1919
// CHECK-INST: compact z31.d, p7, z31.d
2020
// CHECK-ENCODING: [0xff,0x9f,0xe1,0x05]
21-
// CHECK-ERROR: instruction requires: sve
21+
// CHECK-ERROR: instruction requires: sve or sme2p2
2222
// CHECK-UNKNOWN: 05e19fff <unknown>
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
// RUN: not llvm-mc -triple=aarch64 -show-encoding -mattr=+sve2p2 2>&1 < %s| FileCheck %s
2+
3+
// --------------------------------------------------------------------------//
4+
// Invalid element widths
5+
6+
compact z31.h, p7, z31.b
7+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width
8+
// CHECK-NEXT: compact z31.h, p7, z31.b
9+
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
10+
11+
compact z31.b, p7, z31.h
12+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width
13+
// CHECK-NEXT: compact z31.b, p7, z31.h
14+
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
15+
16+
// --------------------------------------------------------------------------//
17+
// Invalid predicate operation
18+
19+
compact z23.b, p7/m, z13.b
20+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction
21+
// CHECK-NEXT: compact z23.b, p7/m, z13.b
22+
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
23+
24+
compact z23.b, p7.b, z13.b
25+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid restricted predicate register, expected p0..p7 (without element suffix)
26+
// CHECK-NEXT: compact z23.b, p7.b, z13.b
27+
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
28+
29+
compact z23.h, p7/z, z13.h
30+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction
31+
// CHECK-NEXT: compact z23.h, p7/z, z13.h
32+
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
33+
34+
compact z23.h, p7.h, z13.h
35+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid restricted predicate register, expected p0..p7 (without element suffix)
36+
// CHECK-NEXT: compact z23.h, p7.h, z13.h
37+
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
38+
39+
// --------------------------------------------------------------------------//
40+
// Predicate not in restricted predicate range
41+
42+
compact z23.b, p8, z13.b
43+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid restricted predicate register, expected p0..p7 (without element suffix)
44+
// CHECK-NEXT: compact z23.b, p8, z13.b
45+
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
46+
47+
compact z23.h, p8, z13.h
48+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid restricted predicate register, expected p0..p7 (without element suffix)
49+
// CHECK-NEXT: compact z23.h, p8, z13.h
50+
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
51+
52+
// --------------------------------------------------------------------------//
53+
// Negative tests for instructions that are incompatible with movprfx
54+
55+
movprfx z31.b, p7/z, z6.b
56+
compact z31.b, p7, z31.b
57+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a movprfx, suggest replacing movprfx with mov
58+
// CHECK-NEXT: compact z31.b, p7, z31.b
59+
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
60+
61+
movprfx z31, z6
62+
compact z31.h, p7, z31.h
63+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a movprfx, suggest replacing movprfx with mov
64+
// CHECK-NEXT: compact z31.h, p7, z31.h
65+
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:

llvm/test/MC/AArch64/SVE2p2/compact.s

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sve2p2 < %s \
2+
// RUN: | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST
3+
// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sme2p2 < %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=+sve2p2 < %s \
8+
// RUN: | llvm-objdump -d --mattr=+sve2p2 - | FileCheck %s --check-prefix=CHECK-INST
9+
// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sve2p2 < %s \
10+
// RUN: | llvm-objdump -d --mattr=-sve2p2 - | FileCheck %s --check-prefix=CHECK-UNKNOWN
11+
// Disassemble encoding and check the re-encoding (-show-encoding) matches.
12+
// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sve2p2 < %s \
13+
// RUN: | sed '/.text/d' | sed 's/.*encoding: //g' \
14+
// RUN: | llvm-mc -triple=aarch64 -mattr=+sve2p2 -disassemble -show-encoding \
15+
// RUN: | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST
16+
17+
compact z0.b, p0, z0.b // 00000101-00100001-10000000-00000000
18+
// CHECK-INST: compact z0.b, p0, z0.b
19+
// CHECK-ENCODING: [0x00,0x80,0x21,0x05]
20+
// CHECK-ERROR: instruction requires: sme2p2 or sve2p2
21+
// CHECK-UNKNOWN: 05218000 <unknown>
22+
23+
compact z21.b, p5, z10.b // 00000101-00100001-10010101-01010101
24+
// CHECK-INST: compact z21.b, p5, z10.b
25+
// CHECK-ENCODING: [0x55,0x95,0x21,0x05]
26+
// CHECK-ERROR: instruction requires: sme2p2 or sve2p2
27+
// CHECK-UNKNOWN: 05219555 <unknown>
28+
29+
compact z31.h, p7, z31.h // 00000101-01100001-10011111-11111111
30+
// CHECK-INST: compact z31.h, p7, z31.h
31+
// CHECK-ENCODING: [0xff,0x9f,0x61,0x05]
32+
// CHECK-ERROR: instruction requires: sme2p2 or sve2p2
33+
// CHECK-UNKNOWN: 05619fff <unknown>
Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
// RUN: not llvm-mc -triple=aarch64 -show-encoding -mattr=+sve2p2 2>&1 < %s| FileCheck %s
2+
3+
// ------------------------------------------------------------------------- //
4+
// Invalid element widths.
5+
6+
expand z23.b, p3, z13.d
7+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width
8+
// CHECK-NEXT: expand z23.b, p3, z13.d
9+
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
10+
11+
expand z23.h, p3, z13.b
12+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width
13+
// CHECK-NEXT: expand z23.h, p3, z13.b
14+
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
15+
16+
expand z23.s, p3, z13.h
17+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width
18+
// CHECK-NEXT: expand z23.s, p3, z13.h
19+
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
20+
21+
expand z23.d, p3, z13.s
22+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width
23+
// CHECK-NEXT: expand z23.d, p3, z13.s
24+
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
25+
26+
expand z23.q, p3, z13.q
27+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width
28+
// CHECK-NEXT: expand z23.q, p3, z13.q
29+
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
30+
31+
// --------------------------------------------------------------------------//
32+
// Invalid predicate operation
33+
34+
expand z23.b, p3/z, z13.b
35+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction
36+
// CHECK-NEXT: expand z23.b, p3/z, z13.b
37+
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
38+
39+
expand z23.b, p3.b, z13.b
40+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid restricted predicate register, expected p0..p7 (without element suffix)
41+
// CHECK-NEXT: expand z23.b, p3.b, z13.b
42+
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
43+
44+
expand z23.h, p3/m, z13.h
45+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction
46+
// CHECK-NEXT: expand z23.h, p3/m, z13.h
47+
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
48+
49+
expand z23.h, p3.h, z13.h
50+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid restricted predicate register, expected p0..p7 (without element suffix)
51+
// CHECK-NEXT: expand z23.h, p3.h, z13.h
52+
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
53+
54+
expand z23.s, p3/z, z13.s
55+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction
56+
// CHECK-NEXT: expand z23.s, p3/z, z13.s
57+
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
58+
59+
expand z23.s, p3.s, z13.s
60+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid restricted predicate register, expected p0..p7 (without element suffix)
61+
// CHECK-NEXT: expand z23.s, p3.s, z13.s
62+
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
63+
64+
expand z23.d, p3/m, z13.d
65+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction
66+
// CHECK-NEXT: expand z23.d, p3/m, z13.d
67+
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
68+
69+
expand z23.d, p3.d, z13.d
70+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid restricted predicate register, expected p0..p7 (without element suffix)
71+
// CHECK-NEXT: expand z23.d, p3.d, z13.d
72+
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
73+
74+
// --------------------------------------------------------------------------//
75+
// Predicate not in restricted predicate range
76+
77+
expand z23.b, p8, z13.b
78+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid restricted predicate register, expected p0..p7 (without element suffix)
79+
// CHECK-NEXT: expand z23.b, p8, z13.b
80+
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
81+
82+
expand z23.b, p3.b, z13.b
83+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid restricted predicate register, expected p0..p7 (without element suffix)
84+
// CHECK-NEXT: expand z23.b, p3.b, z13.b
85+
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
86+
87+
expand z23.h, p8, z13.h
88+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid restricted predicate register, expected p0..p7 (without element suffix)
89+
// CHECK-NEXT: expand z23.h, p8, z13.h
90+
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
91+
92+
expand z23.h, p3.h, z13.h
93+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid restricted predicate register, expected p0..p7 (without element suffix)
94+
// CHECK-NEXT: expand z23.h, p3.h, z13.h
95+
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}
96+
97+
expand z23.s, p8, z13.s
98+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid restricted predicate register, expected p0..p7 (without element suffix)
99+
// CHECK-NEXT: expand z23.s, p8, z13.s
100+
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
101+
102+
expand z23.d, p8, z13.d
103+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid restricted predicate register, expected p0..p7 (without element suffix)
104+
// CHECK-NEXT: expand z23.d, p8, z13.d
105+
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
106+
107+
// --------------------------------------------------------------------------//
108+
// Negative tests for instructions that are incompatible with movprfx
109+
110+
movprfx z31, z6
111+
expand z31.b, p7, z31.b
112+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a movprfx, suggest replacing movprfx with mov
113+
// CHECK-NEXT: expand z31.b, p7, z31.b
114+
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
115+
116+
movprfx z31.b, p0/z, z6.b
117+
expand z31.b, p0, z31.b
118+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a movprfx, suggest replacing movprfx with mov
119+
// CHECK-NEXT: expand z31.b, p0, z31.b
120+
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:

0 commit comments

Comments
 (0)