This is an archive of the discontinued LLVM Phabricator instance.

[AArch64][ASMParser] Refuse equal source/destination for LDRAA/LDRAB
ClosedPublic

Authored by Pierre-vh on Feb 19 2020, 2:28 AM.

Diff Detail

Event Timeline

Pierre-vh created this revision.Feb 19 2020, 2:28 AM

The exact line in the architecture manual is if wback && n == t && n != 31 then. I _think_ we already get the n != 31 case correct, because we will parse one operand to XZR and the other to SP, but could you please add a test for this?

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

s/source/destination/ ?

Pierre-vh added inline comments.Feb 19 2020, 5:28 AM
llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp
4123

What do you mean? Should I change the error message? What do you suggest?

Pierre-vh updated this revision to Diff 245389.Feb 19 2020, 6:01 AM

I changed the error message like you suggested and I also added more tests (suggested by @DavidSpickett )

Pierre-vh marked 2 inline comments as done.Feb 19 2020, 6:02 AM
Pierre-vh updated this revision to Diff 245392.Feb 19 2020, 6:08 AM

Forgot the ldraa variant for the sp/sp xzr/xzr test

ostannard accepted this revision.Feb 19 2020, 6:11 AM

LGTM

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

The change you've made is what I meant: the last word of the message is referring to Xt, which is a destination register, not as source.

This revision is now accepted and ready to land.Feb 19 2020, 6:11 AM
This revision was automatically updated to reflect the committed changes.