This is an archive of the discontinued LLVM Phabricator instance.

[AArch64][SME] Fix LDR and STR asm parser
ClosedPublic

Authored by CarolineConcatto on Apr 5 2023, 7:34 AM.

Details

Summary

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.

Diff Detail

Event Timeline

Herald added a project: Restricted Project. · View Herald TranscriptApr 5 2023, 7:34 AM
CarolineConcatto requested review of this revision.Apr 5 2023, 7:34 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 5 2023, 7:34 AM

Nice fix @CarolineConcatto! Just one minor comment ...

llvm/test/MC/AArch64/SME/ldr-diagnostics.s
56

If it's not too much trouble, could you also add a similar test for str as well?

  • Add missing str test
CarolineConcatto marked an inline comment as done.Apr 6 2023, 12:41 AM
CarolineConcatto added inline comments.
llvm/test/MC/AArch64/SME/ldr-diagnostics.s
56

Sorry, I totally missed that. Now it is done

david-arm accepted this revision.Apr 6 2023, 12:55 AM

LGTM! Thanks @CarolineConcatto. :)

This revision is now accepted and ready to land.Apr 6 2023, 12:55 AM
This revision was landed with ongoing or failed builds.Apr 6 2023, 4:05 AM
This revision was automatically updated to reflect the committed changes.
CarolineConcatto marked an inline comment as done.