This is an archive of the discontinued LLVM Phabricator instance.

[AArch64][SVE] Asm: Add SVE predicate register definitions and parsing support
ClosedPublic

Authored by sdesmalen on Nov 22 2017, 9:24 AM.

Diff Detail

Event Timeline

sdesmalen created this revision.Nov 22 2017, 9:24 AM
fhahn added inline comments.Nov 22 2017, 9:31 AM
lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp
864

nit: would it be enough to just have isSVERegOfWidth() that works for both predicate and data SVE registers? One less template :)

sdesmalen updated this revision to Diff 124058.Nov 23 2017, 3:09 AM

Merged together 'isSVEDataVectorRegOfWidth()' and 'isSVEPredicateVectorRegOfWidth()'.
The benefit of this may not necessarily be obvious for this patch, but future patches will add 'isSVE<restricted register class>RegOfWidth()', at which point it will only require an extra line to the switch statement.

sdesmalen marked an inline comment as done.Nov 23 2017, 3:10 AM
fhahn accepted this revision.Nov 27 2017, 6:59 AM
fhahn added reviewers: echristo, efriedma.

Thanks Sander, looks good to me now. I've added Eli and Eric as reviewers, please wait with committing so they can have a look too.

This revision is now accepted and ready to land.Nov 27 2017, 6:59 AM
efriedma added inline comments.Nov 27 2017, 3:01 PM
lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp
4422

Testcase? (It looks like it should be possible to test this part even without any actual SVE instructions which take a predicate operand.)

sdesmalen updated this revision to Diff 124535.Nov 28 2017, 3:28 AM

Added tests for the .req directive:

  • test/MC/AArch64/SVE/dot-req.s
  • test/MC/AArch64/SVE/dot-req-diagnostics.s
sdesmalen added inline comments.Nov 28 2017, 3:30 AM
lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp
4422

Well spotted, thanks! I've added two test files (test/MC/AArch64/SVE/dot-req.s and test/MC/AArch64/SVE/dot-req-diagnostics.s) which also test the SVE data vector variant.

sdesmalen closed this revision.Nov 29 2017, 6:34 AM
sdesmalen reopened this revision.Nov 29 2017, 7:16 AM

I had to revert r319315 because of unused functions (due to PPR not yet being used by any instructions).
This will be resolved when we commit this patch together with https://reviews.llvm.org/D40361.

This revision is now accepted and ready to land.Nov 29 2017, 7:16 AM
sdesmalen closed this revision.Dec 18 2017, 3:27 AM
rnk added a subscriber: rnk.Dec 18 2017, 1:00 PM

I reverted this patch series in rL321024. It broke parsing of a .s file in libjpeg_turbo. I'll commit a reduced test case for it soon.

rnk added a comment.Dec 18 2017, 2:28 PM

I added the test case in rL321029. I think you just need to try using a pvar .req x0 directive and then using that in place of a GPR. It looks like pvar is treated as a predicate register after this change.