mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-25 12:12:47 +01:00
1. This changes handles the cases of (~x)&y and x&(~y) yielding ANDC, and
(~x)|y and x|(~y) yielding ORC. llvm-svn: 22771
This commit is contained in:
parent
bdc747bc46
commit
7b32c9131d
@ -1717,10 +1717,17 @@ unsigned ISel::SelectExpr(SDOperand N, bool Recording) {
|
|||||||
return Result;
|
return Result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (isOprNot(N.getOperand(1))) {
|
||||||
|
Tmp1 = SelectExpr(N.getOperand(0));
|
||||||
|
Tmp2 = SelectExpr(N.getOperand(1).getOperand(0));
|
||||||
|
BuildMI(BB, PPC::ANDC, 2, Result).addReg(Tmp1).addReg(Tmp2);
|
||||||
|
RecordSuccess = false;
|
||||||
|
return Result;
|
||||||
|
}
|
||||||
if (isOprNot(N.getOperand(0))) {
|
if (isOprNot(N.getOperand(0))) {
|
||||||
Tmp1 = SelectExpr(N.getOperand(0).getOperand(0));
|
Tmp1 = SelectExpr(N.getOperand(1));
|
||||||
Tmp2 = SelectExpr(N.getOperand(1));
|
Tmp2 = SelectExpr(N.getOperand(0).getOperand(0));
|
||||||
BuildMI(BB, PPC::ANDC, 2, Result).addReg(Tmp2).addReg(Tmp1);
|
BuildMI(BB, PPC::ANDC, 2, Result).addReg(Tmp1).addReg(Tmp2);
|
||||||
RecordSuccess = false;
|
RecordSuccess = false;
|
||||||
return Result;
|
return Result;
|
||||||
}
|
}
|
||||||
@ -1737,6 +1744,20 @@ unsigned ISel::SelectExpr(SDOperand N, bool Recording) {
|
|||||||
return Result;
|
return Result;
|
||||||
if (SelectIntImmediateExpr(N, Result, PPC::ORIS, PPC::ORI))
|
if (SelectIntImmediateExpr(N, Result, PPC::ORIS, PPC::ORI))
|
||||||
return Result;
|
return Result;
|
||||||
|
if (isOprNot(N.getOperand(1))) {
|
||||||
|
Tmp1 = SelectExpr(N.getOperand(0));
|
||||||
|
Tmp2 = SelectExpr(N.getOperand(1).getOperand(0));
|
||||||
|
BuildMI(BB, PPC::ORC, 2, Result).addReg(Tmp1).addReg(Tmp2);
|
||||||
|
RecordSuccess = false;
|
||||||
|
return Result;
|
||||||
|
}
|
||||||
|
if (isOprNot(N.getOperand(0))) {
|
||||||
|
Tmp1 = SelectExpr(N.getOperand(1));
|
||||||
|
Tmp2 = SelectExpr(N.getOperand(0).getOperand(0));
|
||||||
|
BuildMI(BB, PPC::ORC, 2, Result).addReg(Tmp1).addReg(Tmp2);
|
||||||
|
RecordSuccess = false;
|
||||||
|
return Result;
|
||||||
|
}
|
||||||
// emit regular or
|
// emit regular or
|
||||||
Tmp1 = SelectExpr(N.getOperand(0));
|
Tmp1 = SelectExpr(N.getOperand(0));
|
||||||
Tmp2 = SelectExpr(N.getOperand(1));
|
Tmp2 = SelectExpr(N.getOperand(1));
|
||||||
|
Loading…
Reference in New Issue
Block a user