Received: from eggs.gnu.org ([2001:4830:134:3::10]:42605) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c1C1H-0006LP-JU for qemu-devel@nongnu.org; Mon, 31 Oct 2016 08:48:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c1C1E-0005Ph-A4 for qemu-devel@nongnu.org; Mon, 31 Oct 2016 08:48:55 -0400 Received: from mail-yb0-x22e.google.com ([2607:f8b0:4002:c09::22e]:33602) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1c1C1E-0005PU-4T for qemu-devel@nongnu.org; Mon, 31 Oct 2016 08:48:52 -0400 Received: by mail-yb0-x22e.google.com with SMTP id o7so3487269ybb.0 for ; Mon, 31 Oct 2016 05:48:51 -0700 (PDT) Sender: Richard Henderson References: <1477695673-25601-1-git-send-email-laurent@vivier.eu> <1477695673-25601-2-git-send-email-laurent@vivier.eu> From: Richard Henderson Message-ID: Date: Mon, 31 Oct 2016 05:48:47 -0700 MIME-Version: 1.0 In-Reply-To: <1477695673-25601-2-git-send-email-laurent@vivier.eu> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2 1/2] target-m68k: add 64bit mull List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Laurent Vivier , qemu-devel@nongnu.org Cc: schwab@linux-m68k.org, agraf@suse.de, gerg@uclinux.org On 10/28/2016 04:01 PM, Laurent Vivier wrote: > + if (ext & 0x400) { > + if (!m68k_feature(s->env, M68K_FEATURE_QUAD_MULDIV)) { > + gen_exception(s, s->pc - 4, EXCP_UNSUPPORTED); > + return; > + } > + > + SRC_EA(env, src1, OS_LONG, 0, NULL); > + > + if (sign) { > + tcg_gen_muls2_i32(DREG(ext, 12), DREG(ext, 0), src1, DREG(ext, 12)); > + } else { > + tcg_gen_mulu2_i32(DREG(ext, 12), DREG(ext, 0), src1, DREG(ext, 12)); > + } TCG will react badly if Dl == Dh, and thus the two outputs are the same. This is undefined in the spec, but guests violating the spec shouldn't cause qemu to crash. I think you should compute this into N and Z and move the results (perhaps in an order matching real hw?) to the data registers afterward. r~