Correctly handle scattered operands where the bits of the operand are contiguous, but out of order.
llvm-svn: 136534
diff --git a/llvm/utils/TableGen/FixedLenDecoderEmitter.cpp b/llvm/utils/TableGen/FixedLenDecoderEmitter.cpp
index 8091003..b87634b 100644
--- a/llvm/utils/TableGen/FixedLenDecoderEmitter.cpp
+++ b/llvm/utils/TableGen/FixedLenDecoderEmitter.cpp
@@ -1295,6 +1295,11 @@
Base = bi;
Width = 1;
Offset = BI->getBitNum();
+ } else if (BI->getBitNum() != Offset + Width) {
+ OpInfo.addField(Base, Width, Offset);
+ Base = bi;
+ Width = 1;
+ Offset = BI->getBitNum();
} else {
++Width;
}