emit TIED_TO correctly
authorChris Lattner <sabre@nondot.org>
Tue, 7 Nov 2006 01:27:55 +0000 (01:27 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 7 Nov 2006 01:27:55 +0000 (01:27 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31484 91177308-0d34-0410-b5e6-96231b3b80d8

utils/TableGen/CodeGenTarget.cpp

index aaf21b5d6c06987bbcdaad4fc4f5d4bf0fc4d925..440e7c6703465649ba93ca0f3eb004cc907fc013 100644 (file)
@@ -297,7 +297,7 @@ static std::string ParseConstraint(const std::string &CStr,
     throw "Illegal tied-to operand constraint '" + CStr + "'";
   
   // Build the string.
-  return "((" + utostr(TIdx) + " << 16) | TargetInstrInfo::TIED_TO)";
+  return "((" + utostr(TIdx) + " << 16) | (1 << TargetInstrInfo::TIED_TO))";
 }
 
 static void ParseConstraints(const std::string &CStr, CodeGenInstruction *I) {
@@ -408,7 +408,7 @@ CodeGenInstruction::CodeGenInstruction(Record *R, const std::string &AsmStr)
   // For backward compatibility: isTwoAddress means operand 1 is tied to
   // operand 0.
   if (isTwoAddress && OperandList[1].Constraint.empty())
-    OperandList[1].Constraint = "((0 << 16) | TargetInstrInfo::TIED_TO)";
+    OperandList[1].Constraint = "((0 << 16) | (1 << TargetInstrInfo::TIED_TO))";
   
   // Any operands with unset constraints get 0 as their constraint.
   for (unsigned op = 0, e = OperandList.size(); op != e; ++op)