This is an archive of the discontinued LLVM Phabricator instance.

[AVR] Disassemble instructions with fixed Z operand
ClosedPublic

Authored by aykevl on Jun 18 2020, 5:59 AM.

Details

Summary

Some instructions have a fixed Z register and don't have an explicit register operand. This can be worked around by simply printing the operand directly if the particular register class is detected.

The lpm and elpm instructions also needed a custom decoder, which is also included in this patch.


Note: I don't know whether the way I've made the Z register printable is the correct way. Maybe the register should be added to the MCInst instead.

Diff Detail

Event Timeline

aykevl created this revision.Jun 18 2020, 5:59 AM
dylanmckay accepted this revision.Jun 18 2020, 10:23 PM

Note: I don't know whether the way I've made the Z register printable is the correct way. Maybe the register should be added to the MCInst instead.

The way you've done it looks correct to me - it both prints the operand with the special Z symbol and adds the register to the MCInst, and is consistent with the existing printOperand logic. Nice work.

This revision is now accepted and ready to land.Jun 18 2020, 10:23 PM
This revision was automatically updated to reflect the committed changes.