[AArch64][SME] Fix LDR and STR asm parser
authorCaroline Concatto <caroline.concatto@arm.com>
Thu, 6 Apr 2023 09:53:48 +0000 (09:53 +0000)
committerCaroline Concatto <caroline.concatto@arm.com>
Thu, 6 Apr 2023 11:04:49 +0000 (11:04 +0000)
commitffa0a2ecd4c0042fb0fd8fc5d84bb92ddd3608a3
treeec6ae641f00d6127f0327513ae1006cfae0c6458
parent55bbcbf511b4df0dfe524b2d06fc561a939c6b16
[AArch64][SME] Fix LDR and STR asm parser

The LDR and STR instructions must have the same value for imm4(second operand)
and offset(fourth operand).
The disassembly guarantees that happens, but the Asm parser was not checking that.
This patch fixes that by checking if the second operand and fourth operand are
immediate and have the same value.

Reviewed By: david-arm

Differential Revision: https://reviews.llvm.org/D147617
llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp
llvm/test/MC/AArch64/SME/ldr-diagnostics.s
llvm/test/MC/AArch64/SME/str-diagnostics.s