This is an archive of the discontinued LLVM Phabricator instance.

TableGen: Allow custom register operand decoder method
ClosedPublic

Authored by arsenm on Jul 12 2016, 10:38 PM.

Details

Reviewers
hfinkel
Summary

This is for a situation where the encoding for a register may be
different depending on the specific operand. For some instructions,
we want to apply additional restrictions beyond the encoding's
constraints.

In AMDGPU some operands are VSrc_32, using the VS_32 pseudo register
class which accept VGPRs, SGPRs, or immediates in the encoding.
Some specific instructions with the same encoding operand do not want
to allow immediates or SGPRs, but the encoding format is different
in this case than a regular VGPR_32 operand.

This allows specifying the encoding should be treated the same
without introducing yet another dummy register class.

Diff Detail

Event Timeline

arsenm updated this revision to Diff 63778.Jul 12 2016, 10:38 PM
arsenm retitled this revision from to TableGen: Allow custom register operand decoder method.
arsenm updated this object.
arsenm added a subscriber: llvm-commits.
hfinkel accepted this revision.Jul 14 2016, 4:37 PM
hfinkel added a reviewer: hfinkel.
hfinkel added a subscriber: hfinkel.

LGTM

utils/TableGen/FixedLenDecoderEmitter.cpp
1701

Please update the comment (e.g. "At this point" is no longer clear) and the FIXME to reflect the new state of the code.

This revision is now accepted and ready to land.Jul 14 2016, 4:37 PM
arsenm closed this revision.Jul 18 2016, 4:28 PM
arsenm marked an inline comment as done.

r275929