Merge pull request #7156 from lioncash/psq

Interpreter_LoadStorePaired: Generate a program exception if non-indexed paired-single load/stores are used and HID2.LSQE is not set
This commit is contained in:
Pierre Bourdon 2018-06-25 01:41:48 +02:00 committed by GitHub
commit 8129a3db6c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 25 additions and 0 deletions

View File

@ -10,6 +10,7 @@
#include "Common/BitUtils.h" #include "Common/BitUtils.h"
#include "Common/CommonTypes.h" #include "Common/CommonTypes.h"
#include "Common/MathUtil.h" #include "Common/MathUtil.h"
#include "Core/PowerPC/Interpreter/ExceptionUtils.h"
#include "Core/PowerPC/Interpreter/Interpreter.h" #include "Core/PowerPC/Interpreter/Interpreter.h"
#include "Core/PowerPC/Interpreter/Interpreter_FPUtils.h" #include "Core/PowerPC/Interpreter/Interpreter_FPUtils.h"
#include "Core/PowerPC/MMU.h" #include "Core/PowerPC/MMU.h"
@ -306,12 +307,24 @@ void Interpreter::Helper_Dequantize(u32 addr, u32 instI, u32 instRD, u32 instW)
void Interpreter::psq_l(UGeckoInstruction inst) void Interpreter::psq_l(UGeckoInstruction inst)
{ {
if (HID2.LSQE == 0)
{
GenerateProgramException();
return;
}
const u32 EA = inst.RA ? (rGPR[inst.RA] + inst.SIMM_12) : (u32)inst.SIMM_12; const u32 EA = inst.RA ? (rGPR[inst.RA] + inst.SIMM_12) : (u32)inst.SIMM_12;
Helper_Dequantize(EA, inst.I, inst.RD, inst.W); Helper_Dequantize(EA, inst.I, inst.RD, inst.W);
} }
void Interpreter::psq_lu(UGeckoInstruction inst) void Interpreter::psq_lu(UGeckoInstruction inst)
{ {
if (HID2.LSQE == 0)
{
GenerateProgramException();
return;
}
const u32 EA = rGPR[inst.RA] + inst.SIMM_12; const u32 EA = rGPR[inst.RA] + inst.SIMM_12;
Helper_Dequantize(EA, inst.I, inst.RD, inst.W); Helper_Dequantize(EA, inst.I, inst.RD, inst.W);
@ -324,12 +337,24 @@ void Interpreter::psq_lu(UGeckoInstruction inst)
void Interpreter::psq_st(UGeckoInstruction inst) void Interpreter::psq_st(UGeckoInstruction inst)
{ {
if (HID2.LSQE == 0)
{
GenerateProgramException();
return;
}
const u32 EA = inst.RA ? (rGPR[inst.RA] + inst.SIMM_12) : (u32)inst.SIMM_12; const u32 EA = inst.RA ? (rGPR[inst.RA] + inst.SIMM_12) : (u32)inst.SIMM_12;
Helper_Quantize(EA, inst.I, inst.RS, inst.W); Helper_Quantize(EA, inst.I, inst.RS, inst.W);
} }
void Interpreter::psq_stu(UGeckoInstruction inst) void Interpreter::psq_stu(UGeckoInstruction inst)
{ {
if (HID2.LSQE == 0)
{
GenerateProgramException();
return;
}
const u32 EA = rGPR[inst.RA] + inst.SIMM_12; const u32 EA = rGPR[inst.RA] + inst.SIMM_12;
Helper_Quantize(EA, inst.I, inst.RS, inst.W); Helper_Quantize(EA, inst.I, inst.RS, inst.W);