Skip to contentSkip to conversation

target-sparc: fix --enable-debug build

PATCH Superseded Jay Foad 2 participants 4 messages Feb 19, 2010 – Feb 20, 2010

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Jay Foad

author
#0 lore raw

PATCH 1/1 target-sparc: fix --enable-debug build

On Linux/x86, configuring with --enable-debug, I get:

 CC    sparc64-linux-user/translate.o /home/foad/git/qemu/target-sparc/translate.c: In function ‘gen_load_trap_state_at_tl’:
/home/foad/git/qemu/target-sparc/translate.c:1684: error: incompatible type for argument 3 of ‘tcg_gen_add_i32’ /home/foad/git/qemu/tcg/tcg-op.h:422: note: expected ‘TCGv_i32’ but argument is of type ‘TCGv_i64’
make[1]: *** [translate.o] Error 1

Does this look like a reasonable fix?

---

target-sparc/translate.c +0 -0
index 7e9f0cf..b7d2a32 100644
@@ -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

#1 lore raw
Quoted 11 lines · Jay Foad

On Linux/x86, configuring with --enable-debug, I get:

CC sparc64-linux-user/translate.o
/home/foad/git/qemu/target-sparc/translate.c: In function ‘gen_load_trap_state_at_tl’:
/home/foad/git/qemu/target-sparc/translate.c:1684: error: incompatible type for argument 3 of ‘tcg_gen_add_i32’ /home/foad/git/qemu/tcg/tcg-op.h:422: note: expected ‘TCGv_i32’ but argument is of type ‘TCGv_i64’
make[1]: *** [translate.o] Error 1

Quoted 3 lines

Does this look like a reasonable fix?

Yes, except for the Signed-off-by: line.

author
#2 lore raw
Quoted 1 line

Yes, except for the Signed-off-by: line.

Do I need to resend it for that? And if so, does that make it PATCH v2 (even though the patch hasn't changed)?

Or can I just put the fixed Signed-off-by: line in a reply?

Thanks,
Jay.

#3 lore raw
Quoted 7 lines · Jay Foad
Quoted 1 line

Yes, except for the Signed-off-by: line.

Do I need to resend it for that? And if so, does that make it PATCH v2
(even though the patch hasn't changed)?

Or can I just put the fixed Signed-off-by: line in a reply?

I'd suppose you'd also want to trim the commit message to remove the question, so please send a new patch.