From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60347) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bmVHM-0000pY-Ju for qemu-devel@nongnu.org; Tue, 20 Sep 2016 20:20:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bmVHH-0003Pm-IH for qemu-devel@nongnu.org; Tue, 20 Sep 2016 20:20:47 -0400 Received: from mail-yw0-x244.google.com ([2607:f8b0:4002:c05::244]:34947) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bmVHH-0003Pe-DL for qemu-devel@nongnu.org; Tue, 20 Sep 2016 20:20:43 -0400 Received: by mail-yw0-x244.google.com with SMTP id u82so1512482ywc.2 for ; Tue, 20 Sep 2016 17:20:43 -0700 (PDT) Sender: Richard Henderson References: <1473373930-31547-1-git-send-email-mrolnik@gmail.com> <1473373930-31547-16-git-send-email-mrolnik@gmail.com> From: Richard Henderson Message-ID: <9444ccf3-585a-48a3-99c3-f9b430f4e12c@twiddle.net> Date: Tue, 20 Sep 2016 17:20:40 -0700 MIME-Version: 1.0 In-Reply-To: <1473373930-31547-16-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 15/29] target-arc: MUL64, MULU64, DIVAW 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: > Signed-off-by: Michael Rolnik > --- > target-arc/translate-inst.c | 105 ++++++++++++++++++++++++++++++++++++++++++++ > target-arc/translate-inst.h | 4 ++ > 2 files changed, 109 insertions(+) > > diff --git a/target-arc/translate-inst.c b/target-arc/translate-inst.c > index 92c75ac..c3795fe 100644 > --- a/target-arc/translate-inst.c > +++ b/target-arc/translate-inst.c > @@ -1546,3 +1546,108 @@ int arc_gen_MPYU(DisasCtxt *ctx, TCGv dest, TCGv src1, TCGv src2) > return BS_NONE; > } > > +/* > + DIVAW > +*/ > +int arc_gen_DIVAW(DisasCtxt *ctx, TCGv dest, TCGv src1, TCGv src2) > +{ > + TCGLabel *label_else = gen_new_label(); > + TCGLabel *label_done = gen_new_label(); > + TCGv rslt = dest; > + TCGv temp = dest; > + > + if (TCGV_EQUAL(dest, src1) || TCGV_EQUAL(dest, src2)) { > + rslt = tcg_temp_new_i32(); > + } > + > + /* > + if (src1 == 0) > + dest = 0 > + else > + { > + src1_temp = src1 << 1 > + if (src1_temp >= src2) > + dest = ((src1_temp - src2) | 0x0000_0001) > + else > + dest = src1_temp > + } > + */ Probably better with two movcond instead of branches. r~