HomePhabricator

AMDGPU/SI: Assembler: Unify parsing/printing of operands.

Authored by nhaustov on Apr 29 2016, 2:02 AM.

Description

AMDGPU/SI: Assembler: Unify parsing/printing of operands.

Summary:
The goal is for each operand type to have its own parse function and
at the same time share common code for tracking state as different
instruction types share operand types (e.g. glc/glc_flat, etc).

Introduce parseAMDGPUOperand which can parse any optional operand.
DPP and Clamp/OMod have custom handling for now. Sam also suggested
to have class hierarchy for operand types instead of table. This
can be done in separate change.

Remove parseVOP3OptionalOps, parseDS*OptionalOps, parseFlatOptionalOps,
parseMubufOptionalOps, parseDPPOptionalOps.
Reduce number of definitions of AsmOperand's and MatchClasses' by using common base class.
Rename AsmMatcher/InstPrinter methods accordingly.
Print immediate type when printing parsed immediate operand.
Use 'off' if offset/index register is unused instead of skipping it to make it more readable (also agreed with SP3).
Update tests.

Reviewers: tstellarAMD, SamWot, artem.tamazov

Subscribers: qcolombet, arsenm, llvm-commits

Differential Revision: http://reviews.llvm.org/D19584

llvm-svn: 268015

Details

Committed
nhaustovApr 29 2016, 2:02 AM
Differential Revision
D19584: AMDGPU/SI: Assembler: Unify parsing/printing of operands.
Parents
rG5779fb61b0d3: [InstCombine][SSE] Regenerated x86 pshufb tests
Branches
Unknown
Tags
Unknown