From patchwork Fri Jan 13 18:36:29 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 9516213 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 70573601E5 for ; Fri, 13 Jan 2017 18:41:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 61E7B286B6 for ; Fri, 13 Jan 2017 18:41:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 569872875D; Fri, 13 Jan 2017 18:41:53 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id DCA05286B6 for ; Fri, 13 Jan 2017 18:41:52 +0000 (UTC) Received: from localhost ([::1]:44691 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cS6nP-00042H-Qa for patchwork-qemu-devel@patchwork.kernel.org; Fri, 13 Jan 2017 13:41:51 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53159) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cS6iX-0008Id-RR for qemu-devel@nongnu.org; Fri, 13 Jan 2017 13:36:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cS6iT-0008Fp-VF for qemu-devel@nongnu.org; Fri, 13 Jan 2017 13:36:49 -0500 Received: from mout.kundenserver.de ([212.227.17.10]:64060) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cS6iT-0008FS-KW for qemu-devel@nongnu.org; Fri, 13 Jan 2017 13:36:45 -0500 Received: from Quad.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue102 [212.227.15.183]) with ESMTPSA (Nemesis) id 0LpOFB-1cxqcq27Mr-00f71F; Fri, 13 Jan 2017 19:36:37 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Date: Fri, 13 Jan 2017 19:36:29 +0100 Message-Id: <1484332593-16782-2-git-send-email-laurent@vivier.eu> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1484332593-16782-1-git-send-email-laurent@vivier.eu> References: <1484332593-16782-1-git-send-email-laurent@vivier.eu> X-Provags-ID: V03:K0:cPHY2cChdMT/9aO7cuKuoZvLkoZJi/aNBGhRuQJbYNw2ZuHAtVP 5bcLdODsFqqqAxqPZ1iRENvPz7HMZWMtjhp/I3mrra3uUpJFtJG6ED+lTqLdBONcZ6p5c9a fZivKYw/tJlOOFnuhOBjumiK4UCiI7YfB9nuijrHD0RfGtj0iSzQJjKhu28//U4Cy0YGsUc miiVG5/j1z1wmGg9qXqzg== X-UI-Out-Filterresults: notjunk:1; V01:K0:747gDRrZHKM=:d6eV+i9aJk/r+2THmFEZ5q +Kyp7fIxZjteZobGm+iMR5It2GZdFImCKd93903uFZjwx8zhKHNFq6lHBTdhP6vfVfS+Q+Pnc cVg/CtxzP04HgC9tvc3bycXZPq6ugrql6kFPD/wpfpNvrE9MXg8FBbI6LILN6sms3GTgsIEXZ 0oGgpmZgkxfVPfPoHdPStqf1fke6Ndr0kL9jCFmtrCEi0/x/miFXL0+6pD+fMgxwjTqB+NB0f EHnonk7a9vJgMq0nTQAviShYsXvIxqi0LyQ9lt4/EIloAP54Fs+TU367PrRB5DTLtp58K6DXo L1ONAKqKfA5hSkuIfsSF4cU2vZbIyeHg3ztxn3qzSIs7kLT00elDqVmH+fXKNhMqTNsrU3r6W SvgP2eZApyggffsuzQUHqimaYpYVRhZoYMsZ5IB4bCZlipXcuWWPO/FiJRZIlrCZziBqjDPzV S0/d+vHKNqpr5XBtRZfJ5rZpKAYwg2Ry3hipX5mL9eTZ4y9jf59I6QQTFGwo1ywoKth1e29y3 9uP/+4rNjN6GQf9lbjPi3PKrKhPOsaZgP8OXChdhUXCaPv784HY7PLYWsPfidAM1dupRiDgpU eFqH2k+DzmL5rZ8K5us5zJVkRxWUcwypNe54eEQc6USkLRelkM0sdxJx3jRM91QiKn3HCXIUT r6+BY0QkMEuzXjn/W4WXayw0c0pc1VPomJ+6lY8Jg8yahV9bh7HVQqOs4UCgbPNmqFD4= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 212.227.17.10 Subject: [Qemu-devel] [PATCH v3 1/5] target-m68k: fix bit operation with immediate value X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Huth , Laurent Vivier , rth@twiddle.net Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP M680x0 bit operations with an immediate value use 9 bits of the 16bit value, while coldfire ones use only 8 bits. Signed-off-by: Laurent Vivier Reviewed-by: Richard Henderson --- target/m68k/translate.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/target/m68k/translate.c b/target/m68k/translate.c index 5f7357e..410f56a 100644 --- a/target/m68k/translate.c +++ b/target/m68k/translate.c @@ -1801,9 +1801,16 @@ DISAS_INSN(bitop_im) op = (insn >> 6) & 3; bitnum = read_im16(env, s); - if (bitnum & 0xff00) { - disas_undef(env, s, insn); - return; + if (m68k_feature(s->env, M68K_FEATURE_M68000)) { + if (bitnum & 0xfe00) { + disas_undef(env, s, insn); + return; + } + } else { + if (bitnum & 0xff00) { + disas_undef(env, s, insn); + return; + } } SRC_EA(env, src1, opsize, 0, op ? &addr: NULL);