Add instruction subset required for disassembling:
- All compact (16-bit) instruction formats;
- A couple of 32-bit instructions;
- Ability to print symbolic information for branch and call instructions.
clang-format is applied.
Paths
| Differential D37983
Add instruction subset for the ARC backend ClosedPublic Authored by tatyana-krasnukha on Sep 18 2017, 10:42 AM.
Details Summary Add instruction subset required for disassembling:
clang-format is applied.
Diff Detail
Event TimelineComment Actions Hi Tatyana, Thanks for working on this!
Comment Actions Hi Pete, thank you for review! I'll do suggested corrections as soon as I'll have tests written.
Comment Actions Hello Tatyana, I am mostly going with the style/conventions observed in the other backends/disassemblers. Can we use these current conventions for this patch? I feel like ARCDisassembler doesn't need many changes to enable the new instructions. So, I view the goal of this patch is to provide enough 16-bit instruction format information so we can disassemble all 16-bit instructions with these formats.
Comment Actions Hello Tatyana, Thanks again for the work here.
Comment Actions Thanks for comment, Pete! Fixed the order of declarations and using of functions. Comment Actions I'm getting a few errors when running these tests now? misc.txt:25:10: error: expected string not found in input # CHECK: bl -2028 ^ <stdin>:9:2: note: scanning from here bl -1996 br.txt:6:10: error: expected string not found in input # CHECK: brlo %r10, %r4, -112 ^ <stdin>:3:2: note: scanning from here brlo %r10, %r4, -108 ^ compact.txt:81:10: error: expected string not found in input # CHECK: b_s 256 ^ <stdin>:28:2: note: scanning from here b_s 316 ^ This revision is now accepted and ready to land.Nov 8 2017, 8:35 AM Comment Actions Hi Pete,
Comment Actions I don't personally feel strongly about either of these. This revision now requires changes to proceed.Nov 8 2017, 10:51 AM Comment Actions I agree that matching the style in other backends is very important, but it is hard to be consistent with last, because it was written long before even c++11 was released... tatyana-krasnukha edited edge metadata. Comment ActionsUse type of instruction for its fields instead of 'auto'. This revision is now accepted and ready to land.Nov 13 2017, 6:52 PM Comment Actions @kparzysz, procedural question...am I OK to commit this for Tatyana, or do we need someone else to also sign off on this as well? Comment Actions When I added instructions, I didn't care about properties like isBranch, isBarrier, etc., because didn't know its purpose. But it was found that debugger cannot step over a range of instructions correctly without this knowing, thus, I've added appropriate fields to instructions. Also, replaced empty { } with ; Comment Actions OK, I was aware of these...but didn't know that you'd need them for the debugger. There are a couple of others (mayLoad, mayStore, Defs STATUS32), but I was going to add them when the code generation uses them. Thanks! Comment Actions Hi Pete, Closed by commit rL319609: [ARC] Add instruction subset for the ARC backend. (authored by tkrasnukha). · Explain WhyDec 1 2017, 9:25 PM This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 115671 ARC/ARCInstrFormats.tdARC/ARCInstrInfo.td
ARC/Disassembler/ARCDisassembler.cpp
ARC/InstPrinter/ARCInstPrinter.cpp
|
For consistency, can we change asmstr#"stuff" -> !strconcat(asmstr, "stuff")?