[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH for-2.5 02/30] m68k: manage scaled index
From: |
Laurent Vivier |
Subject: |
[Qemu-devel] [PATCH for-2.5 02/30] m68k: manage scaled index |
Date: |
Sun, 9 Aug 2015 22:13:21 +0200 |
Scaled index is not supported by 68000, 68008, and 68010.
EA = (bd + PC) + Xn.SIZE*SCALE + od
Ignore it:
M68000 FAMILY PROGRAMMER’S REFERENCE MANUAL
2.4 BRIEF EXTENSION WORD FORMAT COMPATIBILITY
"If the MC68000 were to execute an instruction that
encoded a scaling factor, the scaling factor would be
ignored and would not access the desired memory address.
The earlier microprocessors do not recognize the brief
extension word formats implemented by newer processors.
Although they can detect illegal instructions, they do not
decode invalid encodings of the brief extension word formats
as exceptions."
Signed-off-by: Laurent Vivier <address@hidden>
---
target-m68k/translate.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/target-m68k/translate.c b/target-m68k/translate.c
index ca8d10c..f190f19 100644
--- a/target-m68k/translate.c
+++ b/target-m68k/translate.c
@@ -307,6 +307,11 @@ static TCGv gen_lea_indexed(CPUM68KState *env,
DisasContext *s, TCGv base)
if ((ext & 0x800) == 0 && !m68k_feature(s->env, M68K_FEATURE_WORD_INDEX))
return NULL_QREG;
+ if (m68k_feature(s->env, M68K_FEATURE_M68000) &&
+ !m68k_feature(s->env, M68K_FEATURE_SCALED_INDEX)) {
+ ext &= ~(3 << 9);
+ }
+
if (ext & 0x100) {
/* full extension word format */
if (!m68k_feature(s->env, M68K_FEATURE_EXT_FULL))
--
2.4.3
- Re: [Qemu-devel] [PATCH for-2.5 03/30] m68k: introduce read_imXX() functions, (continued)
- [Qemu-devel] [PATCH for-2.5 09/30] m68k: add X flag helpers, Laurent Vivier, 2015/08/09
- [Qemu-devel] [PATCH for-2.5 10/30] m68k: tst bugfix, Laurent Vivier, 2015/08/09
- [Qemu-devel] [PATCH for-2.5 11/30] m68k: improve clr/moveq, Laurent Vivier, 2015/08/09
- [Qemu-devel] [PATCH for-2.5 06/30] m68k: REG() macro cleanup, Laurent Vivier, 2015/08/09
- [Qemu-devel] [PATCH for-2.5 02/30] m68k: manage scaled index,
Laurent Vivier <=
- [Qemu-devel] [PATCH for-2.5 05/30] m68k: define operand sizes, Laurent Vivier, 2015/08/09
- [Qemu-devel] [PATCH for-2.5 12/30] m68k: Manage divw overflow, Laurent Vivier, 2015/08/09
- [Qemu-devel] [PATCH for-2.5 14/30] m68k: allow adda/suba to add/sub word, Laurent Vivier, 2015/08/09
- [Qemu-devel] [PATCH for-2.5 13/30] m68k: set Z and N on divu/muls overflow as a real 68040, Laurent Vivier, 2015/08/09