From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40295) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VPZE7-0002dr-VJ for qemu-devel@nongnu.org; Fri, 27 Sep 2013 10:41:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VPZDz-0005jm-Fb for qemu-devel@nongnu.org; Fri, 27 Sep 2013 10:41:03 -0400 Received: from mail-pa0-x231.google.com ([2607:f8b0:400e:c03::231]:62538) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VPZDz-0005jh-7i for qemu-devel@nongnu.org; Fri, 27 Sep 2013 10:40:55 -0400 Received: by mail-pa0-f49.google.com with SMTP id ld10so2846026pab.8 for ; Fri, 27 Sep 2013 07:40:54 -0700 (PDT) Sender: Richard Henderson Message-ID: <524598F1.5040706@twiddle.net> Date: Fri, 27 Sep 2013 07:40:49 -0700 From: Richard Henderson MIME-Version: 1.0 References: <1380242934-20953-1-git-send-email-agraf@suse.de> <1380242934-20953-10-git-send-email-agraf@suse.de> In-Reply-To: <1380242934-20953-10-git-send-email-agraf@suse.de> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 09/60] AArch64: Add b and bl handling List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexander Graf Cc: Peter Maydell , Michael Matz , qemu-devel@nongnu.org, C Fontana , Dirk Mueller , Laurent Desnogues , Christoffer Dall On 09/26/2013 05:48 PM, Alexander Graf wrote: > +static int get_bits(uint32_t inst, int start, int len) > +{ > + return (inst >> start) & ((1 << len) - 1); > +} > + > +static int get_sbits(uint32_t inst, int start, int len) > +{ > + int r = get_bits(inst, start, len); > + if (r & (1 << (len - 1))) { > + /* Extend the MSB 1 to the higher bits */ > + r |= -1 & ~((1ULL << len) - 1); > + } > + return r; > +} extract32 and sextract32 please. > +static TCGv_i64 cpu_reg(int reg) > +{ > + if (reg == 31) { > + /* XXX leaks temps */ > + return tcg_const_i64(0); > + } else { > + return cpu_X[reg]; > + } > +} See how we treat temporaries in the sparc translator. We record them in the DisasContext to be freed at the end of the insn. > + tb = s->tb; > + if ((tb->pc & TARGET_PAGE_MASK) == (dest & TARGET_PAGE_MASK)) { Not the only conditions you need to check. In particular, no single-stepping or tb->flags & CF_LAST_IO. C.f. target-alpha's use_goto_tb function. r~