This is an archive of the discontinued LLVM Phabricator instance.

[AArch64][SVE] Asm: Predicate patterns
ClosedPublic

Authored by sdesmalen on Jan 8 2018, 5:56 AM.

Details

Summary

This patch adds support for parsing/printing of named or unnamed
patterns that are used in SVE's PTRUE instruction, amongst others.

The pattern can be specified as a named pattern to initialize the predicate
vector or it can be specified as an immediate in the range 0-31.

Diff Detail

Event Timeline

sdesmalen created this revision.Jan 8 2018, 5:56 AM
fhahn added inline comments.Jan 22 2018, 1:24 AM
lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp
528

no brackets needed.

lib/Target/AArch64/InstPrinter/AArch64InstPrinter.cpp
1350

IIUC this case happens if we want to print a pattern that is not in lookupSVEPREDPATByEncoding, right? Could we use an assert here, as I think this case should not happen if we do everything correctly?

sdesmalen added inline comments.Jan 22 2018, 1:52 AM
lib/Target/AArch64/InstPrinter/AArch64InstPrinter.cpp
1350

Correct, however we cannot assert here since this case needs to be supported. See for instance the tests in D41819 like ptrue p7.s, #15. Immediate 15 does not have an associate pattern string and should be printed as immediate instead.

fhahn accepted this revision.Jan 22 2018, 1:59 AM

LGTM, uses and test cases in D41819

lib/Target/AArch64/InstPrinter/AArch64InstPrinter.cpp
1350

Right, thanks.

This revision is now accepted and ready to land.Jan 22 2018, 1:59 AM
This revision was automatically updated to reflect the committed changes.