JitIL: Fixed the folding rules. This was the underlying bug of the bad collision checking bug reported in Issue 3097.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6283 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
nodchip 2010-10-15 07:48:20 +00:00
parent 59381f8343
commit 8e6a866a5b

View File

@ -549,7 +549,7 @@ InstLoc IRBuilder::FoldSub(InstLoc Op1, InstLoc Op2) {
// Fold Mul opcode. Some rules are ported from LLVM
InstLoc IRBuilder::FoldMul(InstLoc Op1, InstLoc Op2) {
simplifyCommutative(Or, Op1, Op2);
simplifyCommutative(Mul, Op1, Op2);
// i0 * i1 => (i0 * i1)
if (isImm(*Op1) && isImm(*Op2)) {
@ -774,7 +774,7 @@ InstLoc IRBuilder::FoldOr(InstLoc Op1, InstLoc Op2) {
}
InstLoc IRBuilder::FoldXor(InstLoc Op1, InstLoc Op2) {
simplifyCommutative(Or, Op1, Op2);
simplifyCommutative(Xor, Op1, Op2);
if (isImm(*Op1) && isImm(*Op2)) {
return EmitIntConst(GetImmValue(Op1) ^ GetImmValue(Op2));