3 Commits

Author SHA1 Message Date
Michael Liao
ba58d61270 [TableGen] Correct the shift to the proper bit width.
- Replace the previous 32-bit shift with 64-bit one matching `OpInit`.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368513 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-10 16:15:06 +00:00
Daniel Sanders
bf5acac9ab [TableGen] Add "InitValue": Handle operands with set bit values in decoder methods
Summary:
The problem:
  When an operand had bits explicitly set to "1" (as in the InitValue.td test case attached), the decoder was ignoring those bits, and the DecoderMethod was receiving an input where the bits were still zero.

The solution:
  We added an "InitValue" variable that stores the initial value of the operand based on what bits were explicitly initialized to 1 in TableGen code. The generated decoder code then uses that initial value to initialize the "tmp" variable, then calls fieldFromInstruction to read the values for the remaining bits that were left unknown in TableGen.

This is mainly useful when there are variations of an instruction that differ based on what bits are set in the operands, since this change makes it possible to access those bits in a DecoderMethod. The DecoderMethod can use those bits to know how to handle the input.

Patch by Nicolas Guillemot

Reviewers: craig.topper, dsanders, fhahn

Reviewed By: dsanders

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D63741

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368458 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-09 17:30:33 +00:00
Daniel Sanders
5367c02582 [tblgen][disasm] Emit record names again when decoder conflicts occur.
And add a test for it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350277 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-03 00:14:33 +00:00