From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52115) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZOWz0-0000Uc-TB for qemu-devel@nongnu.org; Sun, 09 Aug 2015 16:14:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZOWyw-0005Mc-A3 for qemu-devel@nongnu.org; Sun, 09 Aug 2015 16:14:14 -0400 Received: from smtp4-g21.free.fr ([212.27.42.4]:40370) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZOWyw-0005Ln-4E for qemu-devel@nongnu.org; Sun, 09 Aug 2015 16:14:10 -0400 From: Laurent Vivier Date: Sun, 9 Aug 2015 22:13:21 +0200 Message-Id: <1439151229-27747-3-git-send-email-laurent@vivier.eu> In-Reply-To: <1439151229-27747-1-git-send-email-laurent@vivier.eu> References: <1439151229-27747-1-git-send-email-laurent@vivier.eu> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH for-2.5 02/30] m68k: manage scaled index List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, peter.crosthwaite@xilinx.com, Andreas Schwab , Laurent Vivier , gerg@uclinux.org Scaled index is not supported by 68000, 68008, and 68010. EA =3D (bd + PC) + Xn.SIZE*SCALE + od Ignore it: M68000 FAMILY PROGRAMMER=E2=80=99S 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 --- 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, Disas= Context *s, TCGv base) if ((ext & 0x800) =3D=3D 0 && !m68k_feature(s->env, M68K_FEATURE_WOR= D_INDEX)) return NULL_QREG; =20 + if (m68k_feature(s->env, M68K_FEATURE_M68000) && + !m68k_feature(s->env, M68K_FEATURE_SCALED_INDEX)) { + ext &=3D ~(3 << 9); + } + if (ext & 0x100) { /* full extension word format */ if (!m68k_feature(s->env, M68K_FEATURE_EXT_FULL)) --=20 2.4.3