diff --git a/llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp b/llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp --- a/llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp +++ b/llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp @@ -7642,9 +7642,10 @@ return Match_Success; return Match_InvalidOperand; - // If the kind is a token for a literal immediate, check if our asm - // operand matches. This is for InstAliases which have a fixed-value - // immediate in the syntax. + // If the kind is a token for a literal immediate, check if our asm operand + // matches. This is for InstAliases which have a fixed-value immediate in + // the asm string, such as hints which are parsed into a specific + // instruction definition. #define MATCH_HASH(N) \ case MCK__HASH_##N: \ return MatchesOpImmediate(N); @@ -7654,10 +7655,20 @@ MATCH_HASH(3) MATCH_HASH(4) MATCH_HASH(6) + MATCH_HASH(7) MATCH_HASH(8) + MATCH_HASH(10) MATCH_HASH(12) + MATCH_HASH(14) MATCH_HASH(16) MATCH_HASH(24) + MATCH_HASH(25) + MATCH_HASH(26) + MATCH_HASH(27) + MATCH_HASH(28) + MATCH_HASH(29) + MATCH_HASH(30) + MATCH_HASH(31) MATCH_HASH(32) MATCH_HASH(40) MATCH_HASH(48) diff --git a/llvm/test/MC/AArch64/armv8.3a-signed-pointer.s b/llvm/test/MC/AArch64/armv8.3a-signed-pointer.s --- a/llvm/test/MC/AArch64/armv8.3a-signed-pointer.s +++ b/llvm/test/MC/AArch64/armv8.3a-signed-pointer.s @@ -96,44 +96,83 @@ // ALL-EMPTY: // ALL-EMPTY: + hint #25 paciasp // CHECK-NEXT: paciasp // encoding: [0x3f,0x23,0x03,0xd5] +// CHECK-NEXT: paciasp // encoding: [0x3f,0x23,0x03,0xd5] +// NO83-NEXT: hint #25 // encoding: [0x3f,0x23,0x03,0xd5] // NO83-NEXT: hint #25 // encoding: [0x3f,0x23,0x03,0xd5] + hint #29 autiasp // CHECK-NEXT: autiasp // encoding: [0xbf,0x23,0x03,0xd5] +// CHECK-NEXT: autiasp // encoding: [0xbf,0x23,0x03,0xd5] +// NO83-NEXT: hint #29 // encoding: [0xbf,0x23,0x03,0xd5] // NO83-NEXT: hint #29 // encoding: [0xbf,0x23,0x03,0xd5] + hint #24 paciaz // CHECK-NEXT: paciaz // encoding: [0x1f,0x23,0x03,0xd5] +// CHECK-NEXT: paciaz // encoding: [0x1f,0x23,0x03,0xd5] +// NO83-NEXT: hint #24 // encoding: [0x1f,0x23,0x03,0xd5] // NO83-NEXT: hint #24 // encoding: [0x1f,0x23,0x03,0xd5] + hint #28 autiaz // CHECK-NEXT: autiaz // encoding: [0x9f,0x23,0x03,0xd5] +// CHECK-NEXT: autiaz // encoding: [0x9f,0x23,0x03,0xd5] // NO83-NEXT: hint #28 // encoding: [0x9f,0x23,0x03,0xd5] +// NO83-NEXT: hint #28 // encoding: [0x9f,0x23,0x03,0xd5] + hint #8 pacia1716 // CHECK-NEXT: pacia1716 // encoding: [0x1f,0x21,0x03,0xd5] +// CHECK-NEXT: pacia1716 // encoding: [0x1f,0x21,0x03,0xd5] +// NO83-NEXT: hint #8 // encoding: [0x1f,0x21,0x03,0xd5] // NO83-NEXT: hint #8 // encoding: [0x1f,0x21,0x03,0xd5] + hint #12 autia1716 // CHECK-NEXT: autia1716 // encoding: [0x9f,0x21,0x03,0xd5] +// CHECK-NEXT: autia1716 // encoding: [0x9f,0x21,0x03,0xd5] +// NO83-NEXT: hint #12 // encoding: [0x9f,0x21,0x03,0xd5] // NO83-NEXT: hint #12 // encoding: [0x9f,0x21,0x03,0xd5] + hint #27 pacibsp // CHECK-NEXT: pacibsp // encoding: [0x7f,0x23,0x03,0xd5] +// CHECK-NEXT: pacibsp // encoding: [0x7f,0x23,0x03,0xd5] // NO83-NEXT: hint #27 // encoding: [0x7f,0x23,0x03,0xd5] +// NO83-NEXT: hint #27 // encoding: [0x7f,0x23,0x03,0xd5] + hint #31 autibsp // CHECK-NEXT: autibsp // encoding: [0xff,0x23,0x03,0xd5] +// CHECK-NEXT: autibsp // encoding: [0xff,0x23,0x03,0xd5] // NO83-NEXT: hint #31 // encoding: [0xff,0x23,0x03,0xd5] +// NO83-NEXT: hint #31 // encoding: [0xff,0x23,0x03,0xd5] + hint #26 pacibz // CHECK-NEXT: pacibz // encoding: [0x5f,0x23,0x03,0xd5] +// CHECK-NEXT: pacibz // encoding: [0x5f,0x23,0x03,0xd5] // NO83-NEXT: hint #26 // encoding: [0x5f,0x23,0x03,0xd5] +// NO83-NEXT: hint #26 // encoding: [0x5f,0x23,0x03,0xd5] + hint #30 autibz // CHECK-NEXT: autibz // encoding: [0xdf,0x23,0x03,0xd5] +// CHECK-NEXT: autibz // encoding: [0xdf,0x23,0x03,0xd5] +// NO83-NEXT: hint #30 // encoding: [0xdf,0x23,0x03,0xd5] // NO83-NEXT: hint #30 // encoding: [0xdf,0x23,0x03,0xd5] + hint #10 pacib1716 // CHECK-NEXT: pacib1716 // encoding: [0x5f,0x21,0x03,0xd5] +// CHECK-NEXT: pacib1716 // encoding: [0x5f,0x21,0x03,0xd5] +// NO83-NEXT: hint #10 // encoding: [0x5f,0x21,0x03,0xd5] // NO83-NEXT: hint #10 // encoding: [0x5f,0x21,0x03,0xd5] + hint #14 autib1716 // CHECK-NEXT: autib1716 // encoding: [0xdf,0x21,0x03,0xd5] +// CHECK-NEXT: autib1716 // encoding: [0xdf,0x21,0x03,0xd5] // NO83-NEXT: hint #14 // encoding: [0xdf,0x21,0x03,0xd5] +// NO83-NEXT: hint #14 // encoding: [0xdf,0x21,0x03,0xd5] + hint #7 xpaclri // CHECK-NEXT: xpaclri // encoding: [0xff,0x20,0x03,0xd5] +// CHECK-NEXT: xpaclri // encoding: [0xff,0x20,0x03,0xd5] +// NO83-NEXT: hint #7 // encoding: [0xff,0x20,0x03,0xd5] // NO83-NEXT: hint #7 // encoding: [0xff,0x20,0x03,0xd5] // ALL-EMPTY: