summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/cpu/arm/arm.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/cpu/arm/arm.cpp')
-rw-r--r--src/devices/cpu/arm/arm.cpp22
1 files changed, 14 insertions, 8 deletions
diff --git a/src/devices/cpu/arm/arm.cpp b/src/devices/cpu/arm/arm.cpp
index eb4de54e86d..884b22896cd 100644
--- a/src/devices/cpu/arm/arm.cpp
+++ b/src/devices/cpu/arm/arm.cpp
@@ -635,13 +635,7 @@ void arm_cpu_device::HandleMemSingle( uint32_t insn )
rnv = (R15 & ADDRESS_MASK) - off;
}
- if (insn & INSN_SDT_W)
- {
- SetRegister(rn,rnv);
- if (ARM_DEBUG_CORE && rn == eR15)
- logerror("writeback R15 %08x\n", R15);
- }
- else if (rn == eR15)
+ if (rn == eR15)
{
rnv = rnv + 8;
}
@@ -685,7 +679,7 @@ void arm_cpu_device::HandleMemSingle( uint32_t insn )
In other cases, 4 is subracted from R15 here to account for pipelining.
*/
- if ((cpu_read32(rnv)&3)==0)
+ if (m_copro_type == ARM_COPRO_TYPE_VL86C020 || (cpu_read32(rnv)&3)==0)
R15 -= 4;
m_icount -= S_CYCLE + N_CYCLE;
@@ -716,6 +710,18 @@ void arm_cpu_device::HandleMemSingle( uint32_t insn )
}
}
+ /* Do pre-indexing writeback */
+ if ((insn & INSN_SDT_P) && (insn & INSN_SDT_W))
+ {
+ if ((insn & INSN_SDT_L) && rd == rn)
+ SetRegister(rn, GetRegister(rd));
+ else
+ SetRegister(rn, rnv);
+
+ if (ARM_DEBUG_CORE && rn == eR15)
+ logerror("writeback R15 %08x\n", R15);
+ }
+
/* Do post-indexing writeback */
if (!(insn & INSN_SDT_P)/* && (insn&INSN_SDT_W)*/)
{