Skip to content

Commit 14b66fe

Browse files
[AArch64][MC]Add diagnostic message for Multiple of 2/4 for ZPR128 (#90600)
This patch fix the crash reported in: #90589
1 parent 23f0f7b commit 14b66fe

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6136,13 +6136,15 @@ bool AArch64AsmParser::showMatchError(SMLoc Loc, unsigned ErrCode,
61366136
case Match_InvalidSVEVectorListMul2x16:
61376137
case Match_InvalidSVEVectorListMul2x32:
61386138
case Match_InvalidSVEVectorListMul2x64:
6139+
case Match_InvalidSVEVectorListMul2x128:
61396140
return Error(Loc, "Invalid vector list, expected list with 2 consecutive "
61406141
"SVE vectors, where the first vector is a multiple of 2 "
61416142
"and with matching element types");
61426143
case Match_InvalidSVEVectorListMul4x8:
61436144
case Match_InvalidSVEVectorListMul4x16:
61446145
case Match_InvalidSVEVectorListMul4x32:
61456146
case Match_InvalidSVEVectorListMul4x64:
6147+
case Match_InvalidSVEVectorListMul4x128:
61466148
return Error(Loc, "Invalid vector list, expected list with 4 consecutive "
61476149
"SVE vectors, where the first vector is a multiple of 4 "
61486150
"and with matching element types");
@@ -6739,10 +6741,12 @@ bool AArch64AsmParser::MatchAndEmitInstruction(SMLoc IDLoc, unsigned &Opcode,
67396741
case Match_InvalidSVEVectorListMul2x16:
67406742
case Match_InvalidSVEVectorListMul2x32:
67416743
case Match_InvalidSVEVectorListMul2x64:
6744+
case Match_InvalidSVEVectorListMul2x128:
67426745
case Match_InvalidSVEVectorListMul4x8:
67436746
case Match_InvalidSVEVectorListMul4x16:
67446747
case Match_InvalidSVEVectorListMul4x32:
67456748
case Match_InvalidSVEVectorListMul4x64:
6749+
case Match_InvalidSVEVectorListMul4x128:
67466750
case Match_InvalidSVEVectorListStrided2x8:
67476751
case Match_InvalidSVEVectorListStrided2x16:
67486752
case Match_InvalidSVEVectorListStrided2x32:

llvm/test/MC/AArch64/SME2/zip-diagnostics.s

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,12 @@ zip {z20.b-z23.b}, {z9.b-z12.b}
2323
// CHECK-NEXT: zip {z20.b-z23.b}, {z9.b-z12.b}
2424
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
2525

26+
zip {z1.q-z2.q}, z0.q, z0.q
27+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: Invalid vector list, expected list with 2 consecutive SVE vectors, where the first vector is a multiple of 2 and with matching element types
28+
// CHECK-NEXT: zip {z1.q-z2.q}, z0.q, z0.q
29+
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
30+
31+
zip {z1.q-z4.q}, z0.q, z0.q
32+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: Invalid vector list, expected list with 4 consecutive SVE vectors, where the first vector is a multiple of 4 and with matching element types
33+
// CHECK-NEXT: zip {z1.q-z4.q}, z0.q, z0.q
34+
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:

0 commit comments

Comments
 (0)