This is an archive of the discontinued LLVM Phabricator instance.

[AArch64][AsmParser] NFC: Cleanup parsing of scalar registers.
ClosedPublic

Authored by sdesmalen on Apr 16 2018, 7:34 AM.

Details

Summary
  • Renamed tryParseRegister to tryParseScalarRegister, which now returns an OperandMatchResultTy.
  • Moved matching of certain aliases into matchRegisterNameAlias.
  • Changed type of most 'Reg' variables to 'unsigned'.

This is patch [1/4] in a series to add assembler/disassembler support for
SVE's contiguous LD1 (scalar+scalar) instructions:

Diff Detail

Event Timeline

sdesmalen created this revision.Apr 16 2018, 7:34 AM
  • Fixed 'typo' where a condition expression tested the wrong variable in tryParseScalarRegister ('RegNum' vs 'Reg').
samparker accepted this revision.Apr 18 2018, 1:31 AM
samparker added a subscriber: samparker.

Hi Sander,

This is a nice cleanup. LGTM with the one inline nit.

cheers,
sam

lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp
4537–4538

RegisterKind variable can be removed right? Same below too.

This revision is now accepted and ready to land.Apr 18 2018, 1:31 AM

This is a nice cleanup. LGTM with the one inline nit.

Thanks!

lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp
4537–4538

RegisterKind is still used for the pair that is inserted into RegisterReqs, so that it can be looked up for that register kind in matchRegisterNameAlias.

sdesmalen edited the summary of this revision. (Show Details)Apr 19 2018, 12:26 AM
This revision was automatically updated to reflect the committed changes.