Fix JIT encoding of two-addr instructions.
llvm-svn: 30111
diff --git a/llvm/utils/TableGen/CodeEmitterGen.cpp b/llvm/utils/TableGen/CodeEmitterGen.cpp
index f0a0287..3dcaea4 100644
--- a/llvm/utils/TableGen/CodeEmitterGen.cpp
+++ b/llvm/utils/TableGen/CodeEmitterGen.cpp
@@ -161,6 +161,11 @@
+ utostr(op++)
+ "));\n";
gotOp = true;
+
+ // If this is a two-address instruction and we just got the dest
+ // op, skip the src op.
+ if (op == 1 && Target.getInstruction(InstName).isTwoAddress)
+ ++op;
}
unsigned opMask = (1 << N) - 1;