From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=59265 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PmrSd-0003pM-6E for qemu-devel@nongnu.org; Tue, 08 Feb 2011 12:34:43 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PmrR8-00025A-KU for qemu-devel@nongnu.org; Tue, 08 Feb 2011 12:33:11 -0500 Received: from a.mail.sonic.net ([64.142.16.245]:34334) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PmrR8-00024n-DR for qemu-devel@nongnu.org; Tue, 08 Feb 2011 12:33:10 -0500 Message-ID: <4D517E49.3080309@twiddle.net> Date: Tue, 08 Feb 2011 09:32:57 -0800 From: Richard Henderson MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH 02/17] lm32: translation routines References: <1296433846-18097-1-git-send-email-michael@walle.cc> <1296433846-18097-3-git-send-email-michael@walle.cc> In-Reply-To: <1296433846-18097-3-git-send-email-michael@walle.cc> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Michael Walle Cc: "Edgar E. Iglesias" , qemu-devel@nongnu.org, Alexander Graf On 01/30/2011 04:30 PM, Michael Walle wrote: > + if (dc->format == OP_FMT_RI) { > + tcg_gen_brcondi_tl(cond, cpu_R[rY], sign_extend(dc->imm16, 16), l1); > + } else { > + tcg_gen_brcond_tl(cond, cpu_R[rY], cpu_R[rZ], l1); > + } > + tcg_gen_movi_tl(cpu_R[rX], 0); > + tcg_gen_br(l2); > + gen_set_label(l1); > + tcg_gen_movi_tl(cpu_R[rX], 1); > + gen_set_label(l2); This is tcg_gen_setcond_tl. BTW, why the extensive extra LOG_DIS code? Why not just run the regular disassembler, like other ports? > + if (!(dc->env->features & LM32_FEATURE_MULTIPLY)) { > + cpu_abort(dc->env, "hardware multiplier is not available\n"); > + } Aborting the VM, rather than raising an exception? > + tcg_gen_xor_tl(cpu_R[dc->r2], cpu_R[dc->r0], cpu_R[dc->r1]); > + tcg_gen_not_tl(cpu_R[dc->r2], cpu_R[dc->r2]); This is tcg_gen_eqv_tl. > + /* Large switch for all insns. */ > + for (i = 0; i < ARRAY_SIZE(decinfo); i++) { > + if ((dc->opcode & decinfo[i].mask) == decinfo[i].bits) { > + decinfo[i].dec(dc); > + break; > + } > + } > +} No check that *some* opcode matched? It would seem like a "return" here instead of a break, and then an illegal opcode exception after the loop would be in order. r~