qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v2] target-sparc: fix --enable-debug build
@ 2010-02-20 10:45 Jay Foad
  2010-02-20 11:12 ` Blue Swirl
  0 siblings, 1 reply; 5+ messages in thread
From: Jay Foad @ 2010-02-20 10:45 UTC (permalink / raw)
  To: qemu-devel

Use 32-bit arithmetic for the address offset calculation to fix a
build failure on 32-bit hosts.

Signed-off-by: Jay Foad <jay.foad@gmail.com>
---
 target-sparc/translate.c |   22 +++++++++++-----------
 1 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/target-sparc/translate.c b/target-sparc/translate.c
index 7e9f0cf..b7d2a32 100644
--- a/target-sparc/translate.c
+++ b/target-sparc/translate.c
@@ -1663,27 +1663,27 @@ static inline TCGv get_src2(unsigned int insn, TCGv def)
 #ifdef TARGET_SPARC64
 static inline void gen_load_trap_state_at_tl(TCGv_ptr r_tsptr,
TCGv_ptr cpu_env)
 {
-    TCGv r_tl = tcg_temp_new();
+    TCGv_i32 r_tl = tcg_temp_new_i32();

     /* load env->tl into r_tl */
-    {
-        TCGv_i32 r_tl_tmp = tcg_temp_new_i32();
-        tcg_gen_ld_i32(r_tl_tmp, cpu_env, offsetof(CPUSPARCState, tl));
-        tcg_gen_ext_i32_tl(r_tl, r_tl_tmp);
-        tcg_temp_free_i32(r_tl_tmp);
-    }
+    tcg_gen_ld_i32(r_tl, cpu_env, offsetof(CPUSPARCState, tl));

     /* tl = [0 ... MAXTL_MASK] where MAXTL_MASK must be power of 2 */
-    tcg_gen_andi_tl(r_tl, r_tl, MAXTL_MASK);
+    tcg_gen_andi_i32(r_tl, r_tl, MAXTL_MASK);

     /* calculate offset to current trap state from env->ts, reuse r_tl */
-    tcg_gen_muli_tl(r_tl, r_tl, sizeof (trap_state));
+    tcg_gen_muli_i32(r_tl, r_tl, sizeof (trap_state));
     tcg_gen_addi_ptr(r_tsptr, cpu_env, offsetof(CPUState, ts));

     /* tsptr = env->ts[env->tl & MAXTL_MASK] */
-    tcg_gen_add_ptr(r_tsptr, r_tsptr, r_tl);
+    {
+        TCGv_ptr r_tl_tmp = tcg_temp_new_ptr();
+        tcg_gen_ext_i32_ptr(r_tl_tmp, r_tl);
+        tcg_gen_add_ptr(r_tsptr, r_tsptr, r_tl_tmp);
+        tcg_temp_free_i32(r_tl_tmp);
+    }

-    tcg_temp_free(r_tl);
+    tcg_temp_free_i32(r_tl);
 }
 #endif

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] [PATCH v2] target-sparc: fix --enable-debug build
  2010-02-20 10:45 [Qemu-devel] [PATCH v2] target-sparc: fix --enable-debug build Jay Foad
@ 2010-02-20 11:12 ` Blue Swirl
  2010-02-25 18:05   ` [Qemu-devel] [PATCH] target-sparc: fix --enable-debug build for 64 bit host Stefan Weil
  0 siblings, 1 reply; 5+ messages in thread
From: Blue Swirl @ 2010-02-20 11:12 UTC (permalink / raw)
  To: Jay Foad; +Cc: qemu-devel

Thanks, applied.

On 2/20/10, Jay Foad <jay.foad@gmail.com> wrote:
> Use 32-bit arithmetic for the address offset calculation to fix a
>  build failure on 32-bit hosts.
>
>  Signed-off-by: Jay Foad <jay.foad@gmail.com>
>  ---
>   target-sparc/translate.c |   22 +++++++++++-----------
>   1 files changed, 11 insertions(+), 11 deletions(-)
>
>  diff --git a/target-sparc/translate.c b/target-sparc/translate.c
>  index 7e9f0cf..b7d2a32 100644
>  --- a/target-sparc/translate.c
>  +++ b/target-sparc/translate.c
>  @@ -1663,27 +1663,27 @@ static inline TCGv get_src2(unsigned int insn, TCGv def)
>   #ifdef TARGET_SPARC64
>   static inline void gen_load_trap_state_at_tl(TCGv_ptr r_tsptr,
>  TCGv_ptr cpu_env)
>   {
>  -    TCGv r_tl = tcg_temp_new();
>  +    TCGv_i32 r_tl = tcg_temp_new_i32();
>
>      /* load env->tl into r_tl */
>  -    {
>  -        TCGv_i32 r_tl_tmp = tcg_temp_new_i32();
>  -        tcg_gen_ld_i32(r_tl_tmp, cpu_env, offsetof(CPUSPARCState, tl));
>  -        tcg_gen_ext_i32_tl(r_tl, r_tl_tmp);
>  -        tcg_temp_free_i32(r_tl_tmp);
>  -    }
>  +    tcg_gen_ld_i32(r_tl, cpu_env, offsetof(CPUSPARCState, tl));
>
>      /* tl = [0 ... MAXTL_MASK] where MAXTL_MASK must be power of 2 */
>  -    tcg_gen_andi_tl(r_tl, r_tl, MAXTL_MASK);
>  +    tcg_gen_andi_i32(r_tl, r_tl, MAXTL_MASK);
>
>      /* calculate offset to current trap state from env->ts, reuse r_tl */
>  -    tcg_gen_muli_tl(r_tl, r_tl, sizeof (trap_state));
>  +    tcg_gen_muli_i32(r_tl, r_tl, sizeof (trap_state));
>      tcg_gen_addi_ptr(r_tsptr, cpu_env, offsetof(CPUState, ts));
>
>      /* tsptr = env->ts[env->tl & MAXTL_MASK] */
>  -    tcg_gen_add_ptr(r_tsptr, r_tsptr, r_tl);
>  +    {
>  +        TCGv_ptr r_tl_tmp = tcg_temp_new_ptr();
>  +        tcg_gen_ext_i32_ptr(r_tl_tmp, r_tl);
>  +        tcg_gen_add_ptr(r_tsptr, r_tsptr, r_tl_tmp);
>  +        tcg_temp_free_i32(r_tl_tmp);
>  +    }
>
>  -    tcg_temp_free(r_tl);
>  +    tcg_temp_free_i32(r_tl);
>   }
>   #endif
>
>
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Qemu-devel] [PATCH] target-sparc: fix --enable-debug build for 64 bit host
  2010-02-20 11:12 ` Blue Swirl
@ 2010-02-25 18:05   ` Stefan Weil
  2010-02-25 18:08     ` [Qemu-devel] " Jay Foad
  2010-02-25 18:41     ` Blue Swirl
  0 siblings, 2 replies; 5+ messages in thread
From: Stefan Weil @ 2010-02-25 18:05 UTC (permalink / raw)
  To: blauwirbel; +Cc: jay.foad, qemu-devel

b551ec04ca45d1925417dd2ec7c1b7f115c84f1d fixed
the compilation for 32 bit hosts, but introduced
a new error for 64 bit hosts:

tcg_temp_new_ptr needs a matching tcg_temp_free_ptr.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
---
 target-sparc/translate.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/target-sparc/translate.c b/target-sparc/translate.c
index 18ec65a..9d1ceea 100644
--- a/target-sparc/translate.c
+++ b/target-sparc/translate.c
@@ -1681,7 +1681,7 @@ static inline void gen_load_trap_state_at_tl(TCGv_ptr r_tsptr, TCGv_ptr cpu_env)
         TCGv_ptr r_tl_tmp = tcg_temp_new_ptr();
         tcg_gen_ext_i32_ptr(r_tl_tmp, r_tl);
         tcg_gen_add_ptr(r_tsptr, r_tsptr, r_tl_tmp);
-        tcg_temp_free_i32(r_tl_tmp);
+        tcg_temp_free_ptr(r_tl_tmp);
     }
 
     tcg_temp_free_i32(r_tl);
-- 
1.5.6.5

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [Qemu-devel] Re: [PATCH] target-sparc: fix --enable-debug build for 64 bit host
  2010-02-25 18:05   ` [Qemu-devel] [PATCH] target-sparc: fix --enable-debug build for 64 bit host Stefan Weil
@ 2010-02-25 18:08     ` Jay Foad
  2010-02-25 18:41     ` Blue Swirl
  1 sibling, 0 replies; 5+ messages in thread
From: Jay Foad @ 2010-02-25 18:08 UTC (permalink / raw)
  To: Stefan Weil; +Cc: blauwirbel, qemu-devel

On 25 February 2010 18:05, Stefan Weil <weil@mail.berlios.de> wrote:
> b551ec04ca45d1925417dd2ec7c1b7f115c84f1d fixed
> the compilation for 32 bit hosts, but introduced
> a new error for 64 bit hosts:

Sorry. Thanks for fixing it.

Jay.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Qemu-devel] Re: [PATCH] target-sparc: fix --enable-debug build for 64 bit host
  2010-02-25 18:05   ` [Qemu-devel] [PATCH] target-sparc: fix --enable-debug build for 64 bit host Stefan Weil
  2010-02-25 18:08     ` [Qemu-devel] " Jay Foad
@ 2010-02-25 18:41     ` Blue Swirl
  1 sibling, 0 replies; 5+ messages in thread
From: Blue Swirl @ 2010-02-25 18:41 UTC (permalink / raw)
  To: Stefan Weil; +Cc: jay.foad, qemu-devel

Thanks, applied.

On 2/25/10, Stefan Weil <weil@mail.berlios.de> wrote:
> b551ec04ca45d1925417dd2ec7c1b7f115c84f1d fixed
>  the compilation for 32 bit hosts, but introduced
>  a new error for 64 bit hosts:
>
>  tcg_temp_new_ptr needs a matching tcg_temp_free_ptr.
>
>  Signed-off-by: Stefan Weil <weil@mail.berlios.de>
>  ---
>   target-sparc/translate.c |    2 +-
>   1 files changed, 1 insertions(+), 1 deletions(-)
>
>  diff --git a/target-sparc/translate.c b/target-sparc/translate.c
>  index 18ec65a..9d1ceea 100644
>  --- a/target-sparc/translate.c
>  +++ b/target-sparc/translate.c
>  @@ -1681,7 +1681,7 @@ static inline void gen_load_trap_state_at_tl(TCGv_ptr r_tsptr, TCGv_ptr cpu_env)
>          TCGv_ptr r_tl_tmp = tcg_temp_new_ptr();
>          tcg_gen_ext_i32_ptr(r_tl_tmp, r_tl);
>          tcg_gen_add_ptr(r_tsptr, r_tsptr, r_tl_tmp);
>  -        tcg_temp_free_i32(r_tl_tmp);
>  +        tcg_temp_free_ptr(r_tl_tmp);
>      }
>
>      tcg_temp_free_i32(r_tl);
>
> --
>  1.5.6.5
>
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-02-25 18:41 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-20 10:45 [Qemu-devel] [PATCH v2] target-sparc: fix --enable-debug build Jay Foad
2010-02-20 11:12 ` Blue Swirl
2010-02-25 18:05   ` [Qemu-devel] [PATCH] target-sparc: fix --enable-debug build for 64 bit host Stefan Weil
2010-02-25 18:08     ` [Qemu-devel] " Jay Foad
2010-02-25 18:41     ` Blue Swirl

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).