tcg: Improve tcg_out_label and fix its usage for w64

tcg_out_label is always called with a third argument of pointer type
which was casted to tcg_target_long.

These casts can be avoided by changing the prototype of tcg_out_label.

There was also a cast to long. For most hosts with
sizeof(long) == sizeof(tcg_target_long) == sizeof(void *) this did not
matter, but for w64 it was wrong. This is fixed now.

Cc: Blue Swirl <blauwirbel@gmail.com>
Cc: Richard Henderson <rth@twiddle.net>
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
This commit is contained in:
Stefan Weil 2012-03-10 19:59:04 +01:00 committed by Blue Swirl
parent f7cf5d5b71
commit 9d6fca70c7
4 changed files with 14 additions and 14 deletions

View file

@ -582,7 +582,7 @@ static void tcg_out_brcond2_i32(TCGContext *s, TCGCond cond,
}
tcg_out_nop(s);
tcg_out_label(s, label_next, (tcg_target_long)s->code_ptr);
tcg_out_label(s, label_next, s->code_ptr);
}
#endif
@ -628,7 +628,7 @@ static void tcg_out_setcond_i32(TCGContext *s, TCGCond cond, TCGArg ret,
tcg_out_branch_i32(s, INSN_COND(tcg_cond_to_bcond[cond], 1), t);
tcg_out_movi_imm13(s, ret, 1);
tcg_out_movi_imm13(s, ret, 0);
tcg_out_label(s, t, (tcg_target_long)s->code_ptr);
tcg_out_label(s, t, s->code_ptr);
#endif
return;
}
@ -683,7 +683,7 @@ static void tcg_out_setcond2_i32(TCGContext *s, TCGCond cond, TCGArg ret,
tcg_out_setcond_i32(s, tcg_unsigned_cond(cond), ret, al, bl, blconst);
tcg_out_label(s, lab, (tcg_target_long)s->code_ptr);
tcg_out_label(s, lab, s->code_ptr);
break;
}
}