summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/cpu/powerpc/ppcfe.cpp
diff options
context:
space:
mode:
author 987123879113 <63495610+987123879113@users.noreply.github.com>2023-08-28 02:54:20 +0900
committer GitHub <noreply@github.com>2023-08-28 03:54:20 +1000
commitbced77dec95faea0a2adaa3de09dd1cb48b5ae92 (patch)
tree3eb67c6d92715036192174bd2f647f7fed4243ad /src/devices/cpu/powerpc/ppcfe.cpp
parent59e8aef15e24d1e960ae2b4fbeb4974cfa87b52b (diff)
-cpu/powerpc: Don't overwrite RA in lmw instruction. (#11512)
* For 4xx series and 601, skip over the register update. * For any other flavor, raise an illegal instruction exception. -konami/stingnet: Added ATA CS1 to address map, and removed comment about crash which has been fixed.
Diffstat (limited to 'src/devices/cpu/powerpc/ppcfe.cpp')
-rw-r--r--src/devices/cpu/powerpc/ppcfe.cpp17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/devices/cpu/powerpc/ppcfe.cpp b/src/devices/cpu/powerpc/ppcfe.cpp
index bbb8b4ff4f0..f4abd4a9004 100644
--- a/src/devices/cpu/powerpc/ppcfe.cpp
+++ b/src/devices/cpu/powerpc/ppcfe.cpp
@@ -289,8 +289,21 @@ bool ppc_device::frontend::describe(opcode_desc &desc, const opcode_desc *prev)
case 0x2e: // LMW
GPR_USED_OR_ZERO(desc, G_RA(op));
- for (regnum = G_RD(op); regnum < 32; regnum++)
- GPR_MODIFIED(desc, regnum);
+
+ if (G_RD(op) <= G_RA(op) && !(m_ppc.m_cap & PPCCAP_4XX) && !is_601_class())
+ {
+ // Undefined invalid form that has different behavior between CPUs
+ // See ppcdrc.cpp for a more detailed explanation
+ desc.flags |= OPFLAG_INVALID_OPCODE;
+ }
+ else
+ {
+ for (regnum = G_RD(op); regnum < 32; regnum++)
+ {
+ if (regnum != G_RA(op) || ((m_ppc.m_cap & PPCCAP_4XX) && regnum == 31))
+ GPR_MODIFIED(desc, regnum);
+ }
+ }
desc.flags |= OPFLAG_READS_MEMORY;
desc.cycles = 32 - G_RD(op);
return true;