summaryrefslogtreecommitdiff
path: root/Source
diff options
context:
space:
mode:
authorshuffle2 <godisgovernment@gmail.com>2017-06-06 03:28:19 -0700
committerGitHub <noreply@github.com>2017-06-06 03:28:19 -0700
commit3c0bdd747314fc40eaebd1b1e76d0063d53edbee (patch)
treea2aba5b62ccd75ee7bf3eef91f82f506172dc8f3 /Source
parent3d6c278892ad92f8f0c93c1c9c16dc937146f69c (diff)
parent7702771d61dd9cc5ce507a2d1da2ebb765e4d1a0 (diff)
Merge pull request #5558 from Tilka/fix_warnings
Interpreter: simplify srawx/srawix
Diffstat (limited to 'Source')
-rw-r--r--Source/Core/Core/PowerPC/Interpreter/Interpreter_Integer.cpp34
1 files changed, 6 insertions, 28 deletions
diff --git a/Source/Core/Core/PowerPC/Interpreter/Interpreter_Integer.cpp b/Source/Core/Core/PowerPC/Interpreter/Interpreter_Integer.cpp
index f49ced547e..406814ac77 100644
--- a/Source/Core/Core/PowerPC/Interpreter/Interpreter_Integer.cpp
+++ b/Source/Core/Core/PowerPC/Interpreter/Interpreter_Integer.cpp
@@ -356,21 +356,10 @@ void Interpreter::srawx(UGeckoInstruction inst)
else
{
int amount = rb & 0x1f;
- if (amount == 0)
- {
- rGPR[inst.RA] = rGPR[inst.RS];
- SetCarry(0);
- }
- else
- {
- s32 rrs = rGPR[inst.RS];
- rGPR[inst.RA] = rrs >> amount;
+ s32 rrs = rGPR[inst.RS];
+ rGPR[inst.RA] = rrs >> amount;
- if ((rrs < 0) && (rrs << (32 - amount)))
- SetCarry(1);
- else
- SetCarry(0);
- }
+ SetCarry(rrs < 0 && (u32(rrs) << (32 - amount)) != 0);
}
if (inst.Rc)
@@ -381,21 +370,10 @@ void Interpreter::srawix(UGeckoInstruction inst)
{
int amount = inst.SH;
- if (amount != 0)
- {
- s32 rrs = rGPR[inst.RS];
- rGPR[inst.RA] = rrs >> amount;
+ s32 rrs = rGPR[inst.RS];
+ rGPR[inst.RA] = rrs >> amount;
- if ((rrs < 0) && (rrs << (32 - amount)))
- SetCarry(1);
- else
- SetCarry(0);
- }
- else
- {
- SetCarry(0);
- rGPR[inst.RA] = rGPR[inst.RS];
- }
+ SetCarry(rrs < 0 && (u32(rrs) << (32 - amount)) != 0);
if (inst.Rc)
Helper_UpdateCR0(rGPR[inst.RA]);