This is an archive of the discontinued LLVM Phabricator instance.

[AArch64][SVE] Asm: error on unexpected SVE vector register type suffix
ClosedPublic

Authored by c-rhodes on Mar 21 2019, 4:47 AM.

Details

Summary

This patch fixes an assembler bug that allowed SVE vector registers to contain a
type suffix when not expected. The SVE unpredicated movprfx instruction is the
only instruction affected.

The following are examples of what was previously valid:

movprfx z0.b, z0.b
movprfx z0.b, z0.s
movprfx z0, z0.s

These instructions are now erroneous.

Diff Detail

Repository
rL LLVM

Event Timeline

c-rhodes created this revision.Mar 21 2019, 4:47 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 21 2019, 4:47 AM
sdesmalen accepted this revision.Mar 22 2019, 9:51 AM

Thanks @c-rhodes, this was indeed a mismatch with the SVE spec. Minor nit: the SVE spill/fill instructions also take ZPRAny operands, you could add some tests for those instructions as well to ensure it is not limited to movprfx alone.

This revision is now accepted and ready to land.Mar 22 2019, 9:51 AM

@sdesmalen np, I'll add tests for those instructions also.

c-rhodes updated this revision to Diff 192059.Mar 25 2019, 2:34 AM
c-rhodes edited the summary of this revision. (Show Details)
  • Fixed a typo in an error message.
  • Added further tests for LDR/STR for full coverage on instructions using ZPRAny.
  • Added another small testcase to movprfx to test type suffix only on the last vector register.
sdesmalen added inline comments.Mar 25 2019, 2:40 AM
lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp
1093 ↗(On Diff #192059)

nit: unnecessary parentheses around Reg.ElementWidth == ElementWidth

c-rhodes updated this revision to Diff 192061.Mar 25 2019, 2:55 AM

Removed unnecessary parenthesis.

c-rhodes marked an inline comment as done.Mar 25 2019, 2:56 AM
sdesmalen accepted this revision.Mar 25 2019, 2:59 AM

Thanks @c-rhodes, LGTM.

This revision was automatically updated to reflect the committed changes.