qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Blue Swirl" <blauwirbel@gmail.com>
To: Fabrice Bellard <fabrice@bellard.org>
Cc: qemu-devel <qemu-devel@nongnu.org>
Subject: [Qemu-devel] TCG: register survival outside basic block
Date: Sat, 1 Mar 2008 14:07:23 +0200	[thread overview]
Message-ID: <f43fc5580803010407g75ac1204h81c32d376f7830e1@mail.gmail.com> (raw)

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

Hi,

I'd like to use TCG for the remaining Sparc ops, the attached patch
converts addcc for Sparc32. But I have a problem with register
handling. I'd like to use some registers across basic blocks, but
currently they get eliminated like tmp0 and tmp3 below. Is it possible
to add some kind of register locking to prevent this? Or would you
have other suggestions?

IN:
0xffd0ea84:  addcc  %i1, %g3, %i1

OP:
 ld_i64 tmp1,env,$0x20
 ld_i32 T0,tmp1,$0x44
 ld_i32 T1,env,$0xc
 mov_i32 tmp0,T0
 add_i32 T0,T0,T1
 movi_i32 tmp2,$0x0
 mov_i32 tmp3,tmp2
 brcond_i32 T0,tmp2,$0x1,$0x0
 movi_i32 tmp3,$0x400000
 set_label $0x0
 brcond_i32 T0,tmp2,$0x3,$0x1
 or_i32 tmp3,tmp3,$0x800000
 set_label $0x1
 st_i32 tmp3,env,$0xb4
 brcond_i32 T0,tmp0,$0x7,$0x2
 ld_i32 tmp5,env,$0xb4
 or_i32 tmp5,tmp5,$0x100000
 st_i32 tmp5,env,$0xb4
 set_label $0x2
 xor_i32 tmp7,tmp0,T1
 xor_i32 tmp7,tmp7,$0xffffffffffffffff
 xor_i32 tmp8,tmp0,T0
 and_i32 tmp7,tmp7,tmp8
 and_i32 tmp7,tmp7,$0xffffffff80000000
 movi_i32 tmp9,$0x0
 brcond_i32 tmp7,tmp9,$0x0,$0x3
 ld_i32 tmp12,env,$0xb4
 or_i32 tmp12,tmp12,$0x200000
 st_i32 tmp12,env,$0xb4
 set_label $0x3
 ld_i64 tmp1,env,$0x20
 st_i32 T0,tmp1,$0x44
 movi_i32 tmp0,$0xffffffffffd0ea88
 st_i32 tmp0,env,$0xa8
 movi_i32 tmp0,$0xffffffffffd0ea8c
 st_i32 tmp0,env,$0xac
 call $0x48b7e0,$0x0,$0x4
 exit_tb $0x0

OP after la:
 ld_i64 tmp1,env,$0x20
 ld_i32 T0,tmp1,$0x44
 ld_i32 T1,env,$0xc
 nopn $0x2,$0x2
 add_i32 T0,T0,T1
 movi_i32 tmp2,$0x0
 nopn $0x2,$0x2
 brcond_i32 T0,tmp2,$0x1,$0x0
 nopn $0x2,$0x2
 set_label $0x0
 brcond_i32 T0,tmp2,$0x3,$0x1
 nopn $0x3,$0x7,$0x3
 set_label $0x1
 st_i32 tmp3,env,$0xb4
 brcond_i32 T0,tmp0,$0x7,$0x2
 ld_i32 tmp5,env,$0xb4
 or_i32 tmp5,tmp5,$0x100000
 st_i32 tmp5,env,$0xb4
 set_label $0x2
 xor_i32 tmp7,tmp0,T1
 xor_i32 tmp7,tmp7,$0xffffffffffffffff
 xor_i32 tmp8,tmp0,T0
 and_i32 tmp7,tmp7,tmp8
 and_i32 tmp7,tmp7,$0xffffffff80000000
 movi_i32 tmp9,$0x0
 brcond_i32 tmp7,tmp9,$0x0,$0x3
 ld_i32 tmp12,env,$0xb4
 or_i32 tmp12,tmp12,$0x200000
 st_i32 tmp12,env,$0xb4
 set_label $0x3
 ld_i64 tmp1,env,$0x20
 st_i32 T0,tmp1,$0x44
 movi_i32 tmp0,$0xffffffffffd0ea88
 st_i32 tmp0,env,$0xa8
 movi_i32 tmp0,$0xffffffffffd0ea8c
 st_i32 tmp0,env,$0xac
 call $0x48b7e0,$0x0,$0x4
 exit_tb $0x0
 end

[-- Attachment #2: tcg_addcc.diff --]
[-- Type: plain/text, Size: 4372 bytes --]

                 reply	other threads:[~2008-03-01 12:07 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=f43fc5580803010407g75ac1204h81c32d376f7830e1@mail.gmail.com \
    --to=blauwirbel@gmail.com \
    --cc=fabrice@bellard.org \
    --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).