qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Igor Kovalenko" <igor.v.kovalenko@gmail.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH] sparc64 correct 32bit carry flag for add instruction
Date: Sun, 17 Aug 2008 11:54:09 +0400	[thread overview]
Message-ID: <b2fa41d60808170054h4197b208o3b1995337d569c14@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 334 bytes --]

Hi!

The attached sparc64-add-carry-icc.patch should fix a problem with
setting 32bit carry flag after add instruction.
This at least fixes a problem with silo vprinf printing only least
significant digit of integers (now it can output address where it
loads kernel instead of 0x0)

Please apply.

-- 
Kind regards,
Igor V. Kovalenko

[-- Attachment #2: sparc64-add-carry-icc.patch --]
[-- Type: application/octet-stream, Size: 944 bytes --]

Index: target-sparc/translate.c
===================================================================
--- target-sparc/translate.c	(revision 5012)
+++ target-sparc/translate.c	(working copy)
@@ -349,16 +349,19 @@
 */
 static inline void gen_cc_C_add_icc(TCGv dst, TCGv src1)
 {
-    TCGv r_temp;
+    TCGv r_temp1, r_temp2;
     int l1;
 
     l1 = gen_new_label();
-    r_temp = tcg_temp_new(TCG_TYPE_TL);
-    tcg_gen_andi_tl(r_temp, dst, 0xffffffffULL);
-    tcg_gen_brcond_tl(TCG_COND_GEU, dst, src1, l1);
+    r_temp1 = tcg_temp_new(TCG_TYPE_TL);
+    r_temp2 = tcg_temp_new(TCG_TYPE_TL);
+    tcg_gen_andi_tl(r_temp1, dst, 0xffffffffULL);
+    tcg_gen_andi_tl(r_temp2, src1, 0xffffffffULL);
+    tcg_gen_brcond_tl(TCG_COND_GEU, r_temp1, r_temp2, l1);
     tcg_gen_ori_i32(cpu_psr, cpu_psr, PSR_CARRY);
     gen_set_label(l1);
-    tcg_temp_free(r_temp);
+    tcg_temp_free(r_temp1);
+    tcg_temp_free(r_temp2);
 }
 
 #ifdef TARGET_SPARC64

             reply	other threads:[~2008-08-17  7:54 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-17  7:54 Igor Kovalenko [this message]
2008-08-17  8:34 ` [Qemu-devel] [PATCH] sparc64 correct 32bit carry flag for add instruction Blue Swirl

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=b2fa41d60808170054h4197b208o3b1995337d569c14@mail.gmail.com \
    --to=igor.v.kovalenko@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).