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.

llvm-svn: 28884
This commit is contained in:
Chris Lattner 2006-06-20 22:38:59 +00:00
parent 7e742e46ac
commit 9834ad2fc6
1 changed files with 5 additions and 5 deletions

View File

@ -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))>;