Skip to content

Commit

Permalink
[AArch64][MC]Add diagnostic message for Multiple of 2/4 for ZPR128 (#…
Browse files Browse the repository at this point in the history
…90600)

This patch fix the crash reported in:
#90589
  • Loading branch information
CarolineConcatto committed May 1, 2024
1 parent 23f0f7b commit 14b66fe
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
4 changes: 4 additions & 0 deletions llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6136,13 +6136,15 @@ bool AArch64AsmParser::showMatchError(SMLoc Loc, unsigned ErrCode,
case Match_InvalidSVEVectorListMul2x16:
case Match_InvalidSVEVectorListMul2x32:
case Match_InvalidSVEVectorListMul2x64:
case Match_InvalidSVEVectorListMul2x128:
return Error(Loc, "Invalid vector list, expected list with 2 consecutive "
"SVE vectors, where the first vector is a multiple of 2 "
"and with matching element types");
case Match_InvalidSVEVectorListMul4x8:
case Match_InvalidSVEVectorListMul4x16:
case Match_InvalidSVEVectorListMul4x32:
case Match_InvalidSVEVectorListMul4x64:
case Match_InvalidSVEVectorListMul4x128:
return Error(Loc, "Invalid vector list, expected list with 4 consecutive "
"SVE vectors, where the first vector is a multiple of 4 "
"and with matching element types");
Expand Down Expand Up @@ -6739,10 +6741,12 @@ bool AArch64AsmParser::MatchAndEmitInstruction(SMLoc IDLoc, unsigned &Opcode,
case Match_InvalidSVEVectorListMul2x16:
case Match_InvalidSVEVectorListMul2x32:
case Match_InvalidSVEVectorListMul2x64:
case Match_InvalidSVEVectorListMul2x128:
case Match_InvalidSVEVectorListMul4x8:
case Match_InvalidSVEVectorListMul4x16:
case Match_InvalidSVEVectorListMul4x32:
case Match_InvalidSVEVectorListMul4x64:
case Match_InvalidSVEVectorListMul4x128:
case Match_InvalidSVEVectorListStrided2x8:
case Match_InvalidSVEVectorListStrided2x16:
case Match_InvalidSVEVectorListStrided2x32:
Expand Down
9 changes: 9 additions & 0 deletions llvm/test/MC/AArch64/SME2/zip-diagnostics.s
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,12 @@ zip {z20.b-z23.b}, {z9.b-z12.b}
// CHECK-NEXT: zip {z20.b-z23.b}, {z9.b-z12.b}
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:

zip {z1.q-z2.q}, z0.q, z0.q
// 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
// CHECK-NEXT: zip {z1.q-z2.q}, z0.q, z0.q
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:

zip {z1.q-z4.q}, z0.q, z0.q
// 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
// CHECK-NEXT: zip {z1.q-z4.q}, z0.q, z0.q
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:

0 comments on commit 14b66fe

Please sign in to comment.