diff --git a/utils/TableGen/CodeEmitterGen.cpp b/utils/TableGen/CodeEmitterGen.cpp index b733fdf4316..15b35d5d5db 100644 --- a/utils/TableGen/CodeEmitterGen.cpp +++ b/utils/TableGen/CodeEmitterGen.cpp @@ -112,6 +112,10 @@ void CodeEmitterGen::run(std::ostream &o) { NewBI->setBit(middle, BI->getBit(middle)); } BI = NewBI; + + // Update the bits in reversed order so that emitInstrOpBits will get the + // correct endianness. + R->getValue("Inst")->setValue(NewBI); } unsigned Value = 0;