summaryrefslogtreecommitdiff
path: root/Source/Core
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2014-08-20 14:26:16 -0400
committerLioncash <mathew1800@gmail.com>2014-08-20 14:26:16 -0400
commit20f8ec9afa7ba91cd85ddd9185d28e91f67d74bd (patch)
treeaaa85433b868cb7ac18163659624d00d71202f77 /Source/Core
parent99ae79f7f9b1fc643734f0c37a2ac82c9bddd0cb (diff)
Core: Join a few if statements in IR.cpp
Diffstat (limited to 'Source/Core')
-rw-r--r--Source/Core/Core/PowerPC/JitILCommon/IR.cpp23
1 files 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);