From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56551) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vtl4e-0002Ri-Uq for qemu-devel@nongnu.org; Thu, 19 Dec 2013 16:24:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vtl4Z-0000gD-Ur for qemu-devel@nongnu.org; Thu, 19 Dec 2013 16:24:04 -0500 Received: from mail-pb0-f41.google.com ([209.85.160.41]:43989) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vtl4Z-0000g8-Oq for qemu-devel@nongnu.org; Thu, 19 Dec 2013 16:23:59 -0500 Received: by mail-pb0-f41.google.com with SMTP id jt11so1689872pbb.14 for ; Thu, 19 Dec 2013 13:23:59 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <52B35F6D.9050809@twiddle.net> References: <1387293144-11554-1-git-send-email-peter.maydell@linaro.org> <1387293144-11554-18-git-send-email-peter.maydell@linaro.org> <52B35F6D.9050809@twiddle.net> From: Peter Maydell Date: Thu, 19 Dec 2013 21:23:38 +0000 Message-ID: Content-Type: text/plain; charset=UTF-8 Subject: Re: [Qemu-devel] [PATCH 17/21] target-arm: A64: add support for conditional compare insns List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Richard Henderson Cc: Patch Tracking , Michael Matz , QEMU Developers , Claudio Fontana , Dirk Mueller , Will Newton , Laurent Desnogues , =?UTF-8?B?QWxleCBCZW5uw6ll?= , "kvmarm@lists.cs.columbia.edu" , Christoffer Dall On 19 December 2013 21:04, Richard Henderson wrote: > On 12/17/2013 07:12 AM, Peter Maydell wrote: > >> + tcg_tmp = tcg_temp_new_i64(); >> + >> + if (cond < 0x0e) { /* not always */ >> + int label_match = gen_new_label(); >> + label_continue = gen_new_label(); >> + arm_gen_test_cc(cond, label_match); >> + /* nomatch: */ >> + tcg_gen_movi_i64(tcg_tmp, nzcv << 28); >> + gen_set_nzcv(tcg_tmp); >> + tcg_gen_br(label_continue); >> + gen_set_label(label_match); >> + } > > You can't re-use tcg_tmp across basic blocks like this. Hmm. I clearly don't entirely understand the rules here. The TCG README says "temporaries are only live in a basic block" and "After the end of a basic block, the content of temporaries is destroyed", which I took to mean that the value in the temp was dead after the branch, but that I could freely reuse it for something else afterwards as long as I wrote a new value to it (as we're doing here). I guess that's wrong? thanks -- PMM