diff options
author | Hal Finkel <hfinkel@anl.gov> | 2013-12-17 22:37:50 +0000 |
---|---|---|
committer | Hal Finkel <hfinkel@anl.gov> | 2013-12-17 22:37:50 +0000 |
commit | 81e6fccbd72ac4be2be9ad014d78cf0c09e5a1bb (patch) | |
tree | 043e26fc56125a61305244263113e5ef5955b62d /llvm/utils/TableGen/FixedLenDecoderEmitter.cpp | |
parent | 98e79a06048d877169b5a0587df0ff6473aa4e8d (diff) | |
download | bcm5719-llvm-81e6fccbd72ac4be2be9ad014d78cf0c09e5a1bb.tar.gz bcm5719-llvm-81e6fccbd72ac4be2be9ad014d78cf0c09e5a1bb.zip |
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).
llvm-svn: 197532
Diffstat (limited to 'llvm/utils/TableGen/FixedLenDecoderEmitter.cpp')
-rw-r--r-- | llvm/utils/TableGen/FixedLenDecoderEmitter.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/utils/TableGen/FixedLenDecoderEmitter.cpp b/llvm/utils/TableGen/FixedLenDecoderEmitter.cpp index 87d18cdb9d4..d2d3f3dd076 100644 --- a/llvm/utils/TableGen/FixedLenDecoderEmitter.cpp +++ b/llvm/utils/TableGen/FixedLenDecoderEmitter.cpp @@ -2012,6 +2012,8 @@ void FixedLenDecoderEmitter::run(raw_ostream &o) { emitFieldFromInstruction(OS); + Target.reverseBitsForLittleEndianEncoding(); + // Parameterize the decoders based on namespace and instruction width. NumberedInstructions = &Target.getInstructionsByEnumValue(); std::map<std::pair<std::string, unsigned>, |