This is an archive of the discontinued LLVM Phabricator instance.

[AVR] Implement disassembly support for I/O instructions
ClosedPublic

Authored by aykevl on Feb 5 2020, 6:30 AM.

Details

Summary

The in, out, and sbi/cbi family of instructions seem to require a custom decoder. I'm not exactly sure why and would prefer to convince TableGen to provide the correct decoders for these, but I can't seem to convince it to do so. They simply disassemble without any operands.


Note: all other instructions also seem to require custom decoders. I decided to break this up into multiple commits to make it easier to review.

Diff Detail

Event Timeline

aykevl created this revision.Feb 5 2020, 6:30 AM
aykevl edited the summary of this revision. (Show Details)Feb 5 2020, 6:30 AM
dylanmckay requested changes to this revision.Feb 24 2020, 2:56 AM
dylanmckay added inline comments.
llvm/lib/Target/AVR/Disassembler/AVRDisassembler.cpp
116

Place the early return on a new line for visibility

126

Place the early return on a new line for visibility

llvm/test/MC/AVR/inst-cbi.s
17

Add a couple instructions that exercise all the instruction bits, so that all bitshifts and masks are exercised

for example, cbi 31, 7, which should correspond to A=11111 and b=111, the max according to the datasheet.

llvm/test/MC/AVR/inst-in.s
23

Add a test for in r31, 63 to exercise all the bits

llvm/test/MC/AVR/inst-out.s
24

Add a test for out 63, r31 to exercise all the bits

llvm/test/MC/AVR/inst-sbi.s
23

Add test for sbi 31, 7

llvm/test/MC/AVR/inst-sbic.s
22

Add test for sbic 31, 7

llvm/test/MC/AVR/inst-sbis.s
22

Add test for sbis 31, 7

This revision now requires changes to proceed.Feb 24 2020, 2:56 AM
aykevl updated this revision to Diff 260166.Apr 26 2020, 7:54 AM
  • better formatting of return statement
  • added testcases to exercise all the bits in every instruction
dylanmckay accepted this revision.May 10 2020, 11:24 PM
This revision is now accepted and ready to land.May 10 2020, 11:24 PM
This revision was automatically updated to reflect the committed changes.