From d6e160d14d33fa4ad71b9b5f2790418c25e8ff60 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Tue, 20 Jun 2006 21:39:30 +0000 Subject: [PATCH] 64-bit bugfix: 0xFFFF0000 cannot be formed with a single lis. llvm-svn: 28880 --- llvm/lib/Target/PowerPC/PPCInstrInfo.td | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/llvm/lib/Target/PowerPC/PPCInstrInfo.td b/llvm/lib/Target/PowerPC/PPCInstrInfo.td index 943885feac6e..3d7eb9a6ca72 100644 --- a/llvm/lib/Target/PowerPC/PPCInstrInfo.td +++ b/llvm/lib/Target/PowerPC/PPCInstrInfo.td @@ -143,7 +143,11 @@ def immZExt16 : PatLeaf<(imm), [{ def imm16Shifted : PatLeaf<(imm), [{ // imm16Shifted predicate - True if only bits in the top 16-bits of the // immediate are set. Used by instructions like 'addis'. - return ((unsigned)N->getValue() & 0xFFFF0000U) == (unsigned)N->getValue(); + if (N->getValue() & 0xFFFF) return false; + if (N->getValueType(0) == MVT::i32) + return true; + // For 64-bit, make sure it is sext right. + return N->getValue() == (uint64_t)(int)N->getValue(); }], HI16>; -- GitLab