summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/Mips/MipsCondMov.td
diff options
context:
space:
mode:
authorAkira Hatanaka <ahatanaka@mips.com>2012-05-09 02:29:29 +0000
committerAkira Hatanaka <ahatanaka@mips.com>2012-05-09 02:29:29 +0000
commitca41d13bbd1f630d47c02dc6bf87116cb5733f66 (patch)
tree088ef3d92491605df7d4aeb6092ad46d13b6f2b4 /llvm/lib/Target/Mips/MipsCondMov.td
parent7e21d617efe632464134ff8b3ebe92ddaa51bb15 (diff)
downloadbcm5719-llvm-ca41d13bbd1f630d47c02dc6bf87116cb5733f66.tar.gz
bcm5719-llvm-ca41d13bbd1f630d47c02dc6bf87116cb5733f66.zip
Add another peephole pattern for conditional moves.
llvm-svn: 156460
Diffstat (limited to 'llvm/lib/Target/Mips/MipsCondMov.td')
-rw-r--r--llvm/lib/Target/Mips/MipsCondMov.td10
1 files changed, 10 insertions, 0 deletions
diff --git a/llvm/lib/Target/Mips/MipsCondMov.td b/llvm/lib/Target/Mips/MipsCondMov.td
index da336804e51..40f0958bdc2 100644
--- a/llvm/lib/Target/Mips/MipsCondMov.td
+++ b/llvm/lib/Target/Mips/MipsCondMov.td
@@ -83,6 +83,12 @@ multiclass MovzPats1<RegisterClass CRC, RegisterClass DRC,
(MOVZInst DRC:$T, CRC:$lhs, DRC:$F)>;
}
+multiclass MovzPats2<RegisterClass CRC, RegisterClass DRC,
+ Instruction MOVZInst, Instruction XORiOp> {
+ def : Pat<(select (i32 (seteq CRC:$lhs, immZExt16:$uimm16)), DRC:$T, DRC:$F),
+ (MOVZInst DRC:$T, (XORiOp CRC:$lhs, immZExt16:$uimm16), DRC:$F)>;
+}
+
multiclass MovnPats<RegisterClass CRC, RegisterClass DRC, Instruction MOVNInst,
Instruction XOROp> {
def : Pat<(select (i32 (setne CRC:$lhs, CRC:$rhs)), DRC:$T, DRC:$F),
@@ -170,6 +176,7 @@ let Predicates = [IsFP64bit], DecoderNamespace = "Mips64" in {
// Instantiation of conditional move patterns.
defm : MovzPats0<CPURegs, CPURegs, MOVZ_I_I, SLT, SLTu, SLTi, SLTiu>;
defm : MovzPats1<CPURegs, CPURegs, MOVZ_I_I, XOR>;
+defm : MovzPats2<CPURegs, CPURegs, MOVZ_I_I, XORi>;
let Predicates = [HasMips64] in {
defm : MovzPats0<CPURegs, CPU64Regs, MOVZ_I_I64, SLT, SLTu, SLTi, SLTiu>;
defm : MovzPats0<CPU64Regs, CPURegs, MOVZ_I_I, SLT64, SLTu64, SLTi64,
@@ -179,6 +186,9 @@ let Predicates = [HasMips64] in {
defm : MovzPats1<CPURegs, CPU64Regs, MOVZ_I_I64, XOR>;
defm : MovzPats1<CPU64Regs, CPURegs, MOVZ_I64_I, XOR64>;
defm : MovzPats1<CPU64Regs, CPU64Regs, MOVZ_I64_I64, XOR64>;
+ defm : MovzPats2<CPURegs, CPU64Regs, MOVZ_I_I64, XORi>;
+ defm : MovzPats2<CPU64Regs, CPURegs, MOVZ_I64_I, XORi64>;
+ defm : MovzPats2<CPU64Regs, CPU64Regs, MOVZ_I64_I64, XORi64>;
}
defm : MovnPats<CPURegs, CPURegs, MOVN_I_I, XOR>;
OpenPOWER on IntegriCloud