From: Chris Lattner Date: Tue, 20 Jun 2006 22:38:59 +0000 (+0000) Subject: Instead of li/xoris use li/oris. Note that this doesn't work if bit 15 is X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=eded521a17fa2b39f6b1f9af5943036312bb3149;p=oota-llvm.git Instead of li/xoris use li/oris. Note that this doesn't work if bit 15 is set, so disable the pattern in that case. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28884 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Target/PowerPC/PPCInstr64Bit.td b/lib/Target/PowerPC/PPCInstr64Bit.td index 41996502ca3..8fd656b0aaf 100644 --- a/lib/Target/PowerPC/PPCInstr64Bit.td +++ b/lib/Target/PowerPC/PPCInstr64Bit.td @@ -227,12 +227,12 @@ def sext_0x0000_0000_FFFF_FFFF_i16 : PatLeaf<(imm), [{ def : Pat<(i64 sext_0x0000_0000_FFFF_FFFF_i16:$imm), (ORI8 (LIS8 (HI16 imm:$imm)), (LO16 imm:$imm))>; -// zext(0x0000_0000_FFFF_FFFF, i16) -> xoris (li lo16(imm)), imm>>16 -def zext_0x0000_0000_FFFF_FFFF_i16 : PatLeaf<(imm), [{ - return (N->getValue() & 0xFFFFFFFF00000000ULL) == 0; +// zext(0x0000_0000_FFFF_7FFF, i16) -> oris (li lo16(imm)), imm>>16 +def zext_0x0000_0000_FFFF_7FFF_i16 : PatLeaf<(imm), [{ + return (N->getValue() & 0xFFFFFFFF00008000ULL) == 0; }]>; -def : Pat<(i64 zext_0x0000_0000_FFFF_FFFF_i16:$imm), - (XORIS8 (LI8 (LO16 imm:$imm)), (HI16 imm:$imm))>; +def : Pat<(i64 zext_0x0000_0000_FFFF_7FFF_i16:$imm), + (ORIS8 (LI8 (LO16 imm:$imm)), (HI16 imm:$imm))>;