summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-03-08 18:52:55 +0000
committerChris Lattner <sabre@nondot.org>2010-03-08 18:52:55 +0000
commit6742f1f338c3095623c9b92c40e59723e1df7831 (patch)
treeeb04701ababa92fe802cac4d0e9cfb5ff66f29ff /llvm/lib/Target
parentb8a74276368a4b464fb22a3b56ac303b3dd98b85 (diff)
downloadbcm5719-llvm-6742f1f338c3095623c9b92c40e59723e1df7831.tar.gz
bcm5719-llvm-6742f1f338c3095623c9b92c40e59723e1df7831.zip
fix a type compatibility bug. imm is i32 in the input
pattern, not i64. llvm-svn: 97956
Diffstat (limited to 'llvm/lib/Target')
-rw-r--r--llvm/lib/Target/SystemZ/SystemZInstrInfo.td3
-rw-r--r--llvm/lib/Target/SystemZ/SystemZOperands.td4
2 files changed, 6 insertions, 1 deletions
diff --git a/llvm/lib/Target/SystemZ/SystemZInstrInfo.td b/llvm/lib/Target/SystemZ/SystemZInstrInfo.td
index a44f6d9754f..a75b85de6f0 100644
--- a/llvm/lib/Target/SystemZ/SystemZInstrInfo.td
+++ b/llvm/lib/Target/SystemZ/SystemZInstrInfo.td
@@ -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),
diff --git a/llvm/lib/Target/SystemZ/SystemZOperands.td b/llvm/lib/Target/SystemZ/SystemZOperands.td
index 156cace9c37..0de50fde582 100644
--- a/llvm/lib/Target/SystemZ/SystemZOperands.td
+++ b/llvm/lib/Target/SystemZ/SystemZOperands.td
@@ -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.
OpenPOWER on IntegriCloud