From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53370) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZPf8w-0002BB-Aw for qemu-devel@nongnu.org; Wed, 12 Aug 2015 19:09:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZPf8r-00064W-Bu for qemu-devel@nongnu.org; Wed, 12 Aug 2015 19:09:10 -0400 Received: from mail-qk0-x22e.google.com ([2607:f8b0:400d:c09::22e]:35897) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZPf8r-00064M-6v for qemu-devel@nongnu.org; Wed, 12 Aug 2015 19:09:05 -0400 Received: by qkdv3 with SMTP id v3so10483708qkd.3 for ; Wed, 12 Aug 2015 16:09:05 -0700 (PDT) Sender: Richard Henderson References: <1439151229-27747-1-git-send-email-laurent@vivier.eu> <1439151229-27747-21-git-send-email-laurent@vivier.eu> <55CB7CDA.9090000@twiddle.net> <55CBCBF8.3010100@vivier.eu> From: Richard Henderson Message-ID: <55CBD20D.1040406@twiddle.net> Date: Wed, 12 Aug 2015 16:09:01 -0700 MIME-Version: 1.0 In-Reply-To: <55CBCBF8.3010100@vivier.eu> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH for-2.5 20/30] m68k: add exg List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Laurent Vivier , qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, peter.crosthwaite@xilinx.com, Andreas Schwab , gerg@uclinux.org On 08/12/2015 03:43 PM, Laurent Vivier wrote: > > > Le 12/08/2015 19:05, Richard Henderson a écrit : >> On 08/09/2015 01:13 PM, Laurent Vivier wrote: >>> Signed-off-by: Laurent Vivier >>> --- >>> target-m68k/translate.c | 34 +++++++++++++++++++++++++++++++++- >>> 1 file changed, 33 insertions(+), 1 deletion(-) >>> >>> diff --git a/target-m68k/translate.c b/target-m68k/translate.c >>> index adf4521..b7d15e9 100644 >>> --- a/target-m68k/translate.c >>> +++ b/target-m68k/translate.c >>> @@ -2035,10 +2035,42 @@ DISAS_INSN(and) >>> TCGv dest; >>> TCGv addr; >>> int opsize; >>> + int exg_mode; >>> >>> + dest = tcg_temp_new(); >>> + >>> + /* exg */ >>> + >>> + exg_mode = insn & 0x1f8; >> >> Likewise, surely we can decode EXG separately from AND, and avoid doing so for >> coldfire. > > I agree for CMPM, not for EXG. > > Let's have a look to instructions encoding :) > > AND 1100dddooommmrrr > > ddd data register number > ooo opmode, invalid: 011, 111 > mmmrrr ea mode, if ooo = { 000, 001, 010} invalid: 001000 .. 001111 > if ooo = { 100, 101, 110} invalid; 000000 .. 001111 > > EXG 1100xxx1oooooyyy > > xxx register > ooooo valid: 01000, 01001, 10001 > yyy register > > So, EXG is an AND with > > ooo 101, 110 > mmm 000, 001 > > which are invalid combinations for AND. > > IMHO, EXG looks like a wart on the AND and should be decoded like that... Hmm, perhaps you're right. On the other hand, maybe we should rename the function and_exg, and also properly check for M68000 before accepting exg? r~