Support little-endian encodings in the FixedLenDecoderEmitter
authorHal Finkel <hfinkel@anl.gov>
Tue, 17 Dec 2013 22:37:50 +0000 (22:37 +0000)
committerHal Finkel <hfinkel@anl.gov>
Tue, 17 Dec 2013 22:37:50 +0000 (22:37 +0000)
commitaf73dfe6f1703aafa79f0c57ef2bd154be154686
treecd0175afa91992ecb1c62e05ea59ba9bac0e7633
parent51037451f9d00c1a44128c54fe30e8acafc7bd4a
Support little-endian encodings in the FixedLenDecoderEmitter

The convention used to specify the PowerPC ISA is that bits are numbered in
reverse order (0 is the index of the high bit). To support this "little endian"
encoding convention, CodeEmitterGen will reverse the bit numberings prior to
generating the encoding tables. In order to generate a disassembler,
FixedLenDecoderEmitter needs to do the same.

This moves the bit reversal logic out of CodeEmitterGen and into CodeGenTarget
(where it can be used by both CodeEmitterGen and FixedLenDecoderEmitter). This
is prep work for disassembly support in the PPC backend (which is the only
in-tree user of this little-endian encoding support).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197532 91177308-0d34-0410-b5e6-96231b3b80d8
utils/TableGen/CodeEmitterGen.cpp
utils/TableGen/CodeGenTarget.cpp
utils/TableGen/CodeGenTarget.h
utils/TableGen/FixedLenDecoderEmitter.cpp