From 20f8ec9afa7ba91cd85ddd9185d28e91f67d74bd Mon Sep 17 00:00:00 2001 From: Lioncash Date: Wed, 20 Aug 2014 14:26:16 -0400 Subject: [PATCH] Core: Join a few if statements in IR.cpp --- Source/Core/Core/PowerPC/JitILCommon/IR.cpp | 23 +++++++-------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/Source/Core/Core/PowerPC/JitILCommon/IR.cpp b/Source/Core/Core/PowerPC/JitILCommon/IR.cpp index 1049147472..f078a4cac9 100644 --- a/Source/Core/Core/PowerPC/JitILCommon/IR.cpp +++ b/Source/Core/Core/PowerPC/JitILCommon/IR.cpp @@ -1049,10 +1049,9 @@ InstLoc IRBuilder::FoldShl(InstLoc Op1, InstLoc Op2) InstLoc IRBuilder::FoldShrl(InstLoc Op1, InstLoc Op2) { - if (isImm(*Op2)) + if (isImm(*Op1) && isImm(*Op2)) { - if (isImm(*Op1)) - return EmitIntConst(GetImmValue(Op1) >> (GetImmValue(Op2) & 31)); + return EmitIntConst(GetImmValue(Op1) >> (GetImmValue(Op2) & 31)); } return EmitBiOp(Shrl, Op1, Op2); @@ -1161,13 +1160,10 @@ InstLoc IRBuilder::FoldICmp(unsigned Opcode, InstLoc Op1, InstLoc Op2) InstLoc IRBuilder::FoldICmpCRSigned(InstLoc Op1, InstLoc Op2) { - if (isImm(*Op1)) + if (isImm(*Op1) && isImm(*Op2)) { - if (isImm(*Op2)) - { - s64 diff = (s64)(s32)GetImmValue(Op1) - (s64)(s32)GetImmValue(Op2); - return EmitIntConst64((u64)diff); - } + s64 diff = (s64)(s32)GetImmValue(Op1) - (s64)(s32)GetImmValue(Op2); + return EmitIntConst64((u64)diff); } return EmitBiOp(ICmpCRSigned, Op1, Op2); @@ -1175,13 +1171,10 @@ InstLoc IRBuilder::FoldICmpCRSigned(InstLoc Op1, InstLoc Op2) InstLoc IRBuilder::FoldICmpCRUnsigned(InstLoc Op1, InstLoc Op2) { - if (isImm(*Op1)) + if (isImm(*Op1) && isImm(*Op2)) { - if (isImm(*Op2)) - { - u64 diff = (u64)GetImmValue(Op1) - (u64)GetImmValue(Op2); - return EmitIntConst64(diff); - } + u64 diff = (u64)GetImmValue(Op1) - (u64)GetImmValue(Op2); + return EmitIntConst64(diff); } return EmitBiOp(ICmpCRUnsigned, Op1, Op2);