This is an archive of the discontinued LLVM Phabricator instance.

[RISCV] Move vtype decoding and printing from RISCVInstPrinter to RISCVBaseInfo. Share with the assembly parser's debug output
ClosedPublic

Authored by craig.topper on Dec 11 2020, 5:30 PM.

Details

Summary

This moves the vtype decoding and printing to RISCVBaseInfo. This keeps all of the decoding code in the same area as the encoding code. This will make it easier to change the decoding for the 1.0 spec in the future.

We're now sharing the printing with the debug output for operands in the assembler. This also fixes that debug output to include the tail and mask agnostic bits. Since the printing code works on the vtype immediate value, we now encode the immediate during parsing and store just the immediate in the operand.

Diff Detail

Event Timeline

craig.topper created this revision.Dec 11 2020, 5:30 PM
craig.topper requested review of this revision.Dec 11 2020, 5:30 PM
Herald added a project: Restricted Project. · View Herald TranscriptDec 11 2020, 5:30 PM
Herald added a subscriber: MaskRay. · View Herald Transcript
frasercrmck accepted this revision.Dec 14 2020, 6:26 AM

LGTM other than nits.

llvm/lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp
754

nit: are these parens needed?

1578

nit: can't remember the llvm style but should these parens be here?

This revision is now accepted and ready to land.Dec 14 2020, 6:26 AM