fix a type compatibility bug. imm is i32 in the input
authorChris Lattner <sabre@nondot.org>
Mon, 8 Mar 2010 18:52:55 +0000 (18:52 +0000)
committerChris Lattner <sabre@nondot.org>
Mon, 8 Mar 2010 18:52:55 +0000 (18:52 +0000)
pattern, not i64.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97956 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/SystemZ/SystemZInstrInfo.td
lib/Target/SystemZ/SystemZOperands.td

index a44f6d9754f47d88e455b6ee7073784e008c0c52..a75b85de6f01ed9085cd698cf39b2f7e9247d911 100644 (file)
@@ -1112,7 +1112,8 @@ def : Pat<(SystemZcall (i64 texternalsym:$dst)), (CALLi texternalsym:$dst)>;
 
 // Arbitrary immediate support.
 def : Pat<(i32 imm:$src),
-          (EXTRACT_SUBREG (MOV64ri32 (i64 imm:$src)), subreg_32bit)>;
+          (EXTRACT_SUBREG (MOV64ri32 (GetI64FromI32 (i32 imm:$src))),
+             subreg_32bit)>;
 
 // Implement in terms of LLIHF/OILF.
 def : Pat<(i64 imm:$imm),
index 156cace9c3746e8a857efee9154bb4937a708120..0de50fde582b8ca76cc9639d30de0d7d504534f3 100644 (file)
@@ -67,6 +67,10 @@ def HI32 : SDNodeXForm<imm, [{
   return getI32Imm(N->getZExtValue() >> 32);
 }]>;
 
+def GetI64FromI32 : SDNodeXForm<imm, [{
+  return CurDAG->getTargetConstant(N->getSExtValue(), MVT::i64);
+}]>;
+
 def i32ll16 : PatLeaf<(i32 imm), [{
   // i32ll16 predicate - true if the 32-bit immediate has only rightmost 16
   // bits set.