From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53358) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bmUZY-00052R-WF for qemu-devel@nongnu.org; Tue, 20 Sep 2016 19:35:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bmUZU-0000CX-R3 for qemu-devel@nongnu.org; Tue, 20 Sep 2016 19:35:31 -0400 Received: from mail-yw0-x230.google.com ([2607:f8b0:4002:c05::230]:35178) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bmUZU-0000CT-MN for qemu-devel@nongnu.org; Tue, 20 Sep 2016 19:35:28 -0400 Received: by mail-yw0-x230.google.com with SMTP id u82so26500535ywc.2 for ; Tue, 20 Sep 2016 16:35:28 -0700 (PDT) Sender: Richard Henderson References: <1473373930-31547-1-git-send-email-mrolnik@gmail.com> <1473373930-31547-5-git-send-email-mrolnik@gmail.com> From: Richard Henderson Message-ID: Date: Tue, 20 Sep 2016 16:35:25 -0700 MIME-Version: 1.0 In-Reply-To: <1473373930-31547-5-git-send-email-mrolnik@gmail.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH RFC v1 04/29] target-arc: AND, OR, XOR, BIC, TST List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Michael Rolnik , qemu-devel@nongnu.org On 09/08/2016 03:31 PM, Michael Rolnik wrote: > +int arc_gen_AND(DisasCtxt *ctx, TCGv dest, TCGv src1, TCGv src2) > +{ > + TCGv rslt = dest; > + > + if (TCGV_EQUAL(dest, src1) || TCGV_EQUAL(dest, src2)) { > + rslt = tcg_temp_new_i32(); > + } > + > + tcg_gen_and_tl(rslt, src1, src2); > + > + if (ctx->opt.f) { > + tcg_gen_setcond_tl(TCG_COND_EQ, cpu_Zf, rslt, ctx->zero); > + tcg_gen_shri_tl(cpu_Nf, rslt, 31); > + } > + > + if (!TCGV_EQUAL(dest, rslt)) { > + tcg_gen_mov_tl(dest, rslt); > + tcg_temp_free_i32(rslt); > + } There is no reason for this rslt temporary stuff. Unlike with add & sub, src1 & src2 are not used after the operation, for any of the logical operations. r~