This is an archive of the discontinued LLVM Phabricator instance.

Fix TableGen -gen-disassembler output for certain bit field definitions.
ClosedPublic

Authored by srking on Sep 25 2014, 8:07 PM.

Details

Reviewers
craig.topper
Summary

TableGen -gen-disassembler extracts incorrect operand values for certain bit fields with an offset. The result is that disassembly silently fails with incorrect operand values. Bit assignments like:
Inst{7-0} = Foo{9-2}
are vulnerable to this problem.

Diff Detail

Event Timeline

srking updated this revision to Diff 14091.Sep 25 2014, 8:07 PM
srking retitled this revision from to Fix TableGen -gen-disassembler output for certain bit field definitions..
srking updated this object.
srking edited the test plan for this revision. (Show Details)
srking added a subscriber: Unknown Object (MLST).

LGTM. Though I wonder if the if and else couldn't be better combined.

srking updated this revision to Diff 14122.Sep 26 2014, 9:41 AM

Changes from previous patch:

  1. Use more succinct test file name "BitOffsetDecoder.td"
  2. Update test file comments to use "offset" instead of "shift"

Verified all tests pass.

srking updated this revision to Diff 14123.Sep 26 2014, 9:47 AM

Operator error: uploaded old patch again. Here is the new patch with renamed regression test file.

craig.topper accepted this revision.Sep 26 2014, 9:54 PM
craig.topper added a reviewer: craig.topper.
This revision is now accepted and ready to land.Sep 26 2014, 9:54 PM
craig.topper closed this revision.Sep 26 2014, 9:54 PM

Commited in r218560.