This is an archive of the discontinued LLVM Phabricator instance.

[AVR] Implement disassembly of 32-bit instructions
ClosedPublic

Authored by aykevl on Jun 16 2020, 12:45 PM.

Details

Summary

This needed two fixes:

  • 32-bit instructions were read in the wrong order. The machine code swaps the two 16-bit instruction words, which wasn't undone when decoding instructions.
  • Jump and call instructions don't encode the lowest address bit, which is always zero. Therefore, the address needed to be shifted by one to fix that.

Note: I didn't add all address decode tests to the call instruction as all of that should already be tested with the jmp instruction (which has the same format). I can of course add it if needed.

Diff Detail

Event Timeline

aykevl created this revision.Jun 16 2020, 12:45 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 16 2020, 12:45 PM
aykevl edited the summary of this revision. (Show Details)Jun 16 2020, 12:47 PM
dylanmckay accepted this revision.Jun 17 2020, 10:47 PM
This revision is now accepted and ready to land.Jun 17 2020, 10:47 PM
This revision was automatically updated to reflect the committed changes.