qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [4313] CRIS: Convert divide step to TCG.
Date: Sat, 03 May 2008 21:34:40 +0000	[thread overview]
Message-ID: <E1JsPNQ-0005Fg-RD@cvs.savannah.gnu.org> (raw)

Revision: 4313
          http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=4313
Author:   edgar_igl
Date:     2008-05-03 21:34:39 +0000 (Sat, 03 May 2008)

Log Message:
-----------
CRIS: Convert divide step to TCG.

Modified Paths:
--------------
    trunk/target-cris/translate.c

Modified: trunk/target-cris/translate.c
===================================================================
--- trunk/target-cris/translate.c	2008-05-03 20:52:26 UTC (rev 4312)
+++ trunk/target-cris/translate.c	2008-05-03 21:34:39 UTC (rev 4313)
@@ -375,6 +375,23 @@
 	tcg_gen_discard_i32(n);
 }
 
+static void t_gen_cris_dstep(TCGv d, TCGv s)
+{
+	int l1;
+
+	l1 = gen_new_label();
+
+	/* 
+	 * d <<= 1
+	 * if (d >= s)
+	 *    d -= s;
+	 */
+	tcg_gen_shli_tl(d, d, 1);
+	tcg_gen_brcond_tl(TCG_COND_LTU, d, s, l1);
+	tcg_gen_sub_tl(d, d, s);
+	gen_set_label(l1);
+}
+
 /* Extended arithmetics on CRIS.  */
 static inline void t_gen_add_flag(TCGv d, int flag)
 {
@@ -725,7 +742,7 @@
 		}
 		break;
 		case CC_OP_DSTEP:
-			gen_op_dstep_T0_T1();
+			t_gen_cris_dstep(cpu_T[0], cpu_T[1]);
 			break;
 		case CC_OP_BOUND:
 		{

                 reply	other threads:[~2008-05-03 21:34 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E1JsPNQ-0005Fg-RD@cvs.savannah.gnu.org \
    --to=edgar.iglesias@gmail.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).