TCG fixes for target-mips

This patch fixes TCG errors reported on the MIPS target when TCG_DEBUG
is enabled.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Acked-by: Thiemo Seufer <ths@networkno.de>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5164 c046a42c-6fe2-441c-8c8c-71466251a162
This commit is contained in:
aurel32 2008-09-05 14:19:17 +00:00
parent 9507fb52e2
commit 2fdbad255e
1 changed files with 27 additions and 26 deletions

View File

@ -427,7 +427,8 @@ static TCGv cpu_env, bcond, btarget, current_fpu;
#include "gen-icount.h"
static inline void tcg_gen_helper_0_i(void *func, TCGv arg)
static inline void tcg_gen_helper_0_i(void *func, uint32_t arg)
{
TCGv tmp = tcg_const_i32(arg);
@ -435,7 +436,7 @@ static inline void tcg_gen_helper_0_i(void *func, TCGv arg)
tcg_temp_free(tmp);
}
static inline void tcg_gen_helper_0_ii(void *func, TCGv arg1, TCGv arg2)
static inline void tcg_gen_helper_0_ii(void *func, uint32_t arg1, uint32_t arg2)
{
TCGv tmp1 = tcg_const_i32(arg1);
TCGv tmp2 = tcg_const_i32(arg2);
@ -445,7 +446,7 @@ static inline void tcg_gen_helper_0_ii(void *func, TCGv arg1, TCGv arg2)
tcg_temp_free(tmp2);
}
static inline void tcg_gen_helper_0_1i(void *func, TCGv arg1, TCGv arg2)
static inline void tcg_gen_helper_0_1i(void *func, TCGv arg1, uint32_t arg2)
{
TCGv tmp = tcg_const_i32(arg2);
@ -453,7 +454,7 @@ static inline void tcg_gen_helper_0_1i(void *func, TCGv arg1, TCGv arg2)
tcg_temp_free(tmp);
}
static inline void tcg_gen_helper_0_2i(void *func, TCGv arg1, TCGv arg2, TCGv arg3)
static inline void tcg_gen_helper_0_2i(void *func, TCGv arg1, TCGv arg2, uint32_t arg3)
{
TCGv tmp = tcg_const_i32(arg3);
@ -461,7 +462,7 @@ static inline void tcg_gen_helper_0_2i(void *func, TCGv arg1, TCGv arg2, TCGv ar
tcg_temp_free(tmp);
}
static inline void tcg_gen_helper_0_1ii(void *func, TCGv arg1, TCGv arg2, TCGv arg3)
static inline void tcg_gen_helper_0_1ii(void *func, TCGv arg1, uint32_t arg2, uint32_t arg3)
{
TCGv tmp1 = tcg_const_i32(arg2);
TCGv tmp2 = tcg_const_i32(arg3);
@ -471,7 +472,7 @@ static inline void tcg_gen_helper_0_1ii(void *func, TCGv arg1, TCGv arg2, TCGv a
tcg_temp_free(tmp2);
}
static inline void tcg_gen_helper_1_i(void *func, TCGv ret, TCGv arg)
static inline void tcg_gen_helper_1_i(void *func, TCGv ret, uint32_t arg)
{
TCGv tmp = tcg_const_i32(arg);
@ -479,7 +480,7 @@ static inline void tcg_gen_helper_1_i(void *func, TCGv ret, TCGv arg)
tcg_temp_free(tmp);
}
static inline void tcg_gen_helper_1_1i(void *func, TCGv ret, TCGv arg1, TCGv arg2)
static inline void tcg_gen_helper_1_1i(void *func, TCGv ret, TCGv arg1, uint32_t arg2)
{
TCGv tmp = tcg_const_i32(arg2);
@ -487,7 +488,7 @@ static inline void tcg_gen_helper_1_1i(void *func, TCGv ret, TCGv arg1, TCGv arg
tcg_temp_free(tmp);
}
static inline void tcg_gen_helper_1_1ii(void *func, TCGv ret, TCGv arg1, TCGv arg2, TCGv arg3)
static inline void tcg_gen_helper_1_1ii(void *func, TCGv ret, TCGv arg1, uint32_t arg2, uint32_t arg3)
{
TCGv tmp1 = tcg_const_i32(arg2);
TCGv tmp2 = tcg_const_i32(arg3);
@ -497,7 +498,7 @@ static inline void tcg_gen_helper_1_1ii(void *func, TCGv ret, TCGv arg1, TCGv ar
tcg_temp_free(tmp2);
}
static inline void tcg_gen_helper_1_2i(void *func, TCGv ret, TCGv arg1, TCGv arg2, TCGv arg3)
static inline void tcg_gen_helper_1_2i(void *func, TCGv ret, TCGv arg1, TCGv arg2, uint32_t arg3)
{
TCGv tmp = tcg_const_i32(arg3);
@ -505,7 +506,7 @@ static inline void tcg_gen_helper_1_2i(void *func, TCGv ret, TCGv arg1, TCGv arg
tcg_temp_free(tmp);
}
static inline void tcg_gen_helper_1_2ii(void *func, TCGv ret, TCGv arg1, TCGv arg2, TCGv arg3, TCGv arg4)
static inline void tcg_gen_helper_1_2ii(void *func, TCGv ret, TCGv arg1, TCGv arg2, uint32_t arg3, uint32_t arg4)
{
TCGv tmp1 = tcg_const_i32(arg3);
TCGv tmp2 = tcg_const_i32(arg4);
@ -722,7 +723,7 @@ static inline void get_fp_cond (TCGv t)
typedef void (fcmp_fun32)(uint32_t, uint32_t, int);
typedef void (fcmp_fun64)(uint64_t, uint64_t, int);
#define FOP_CONDS(fcmp_fun, type, arg0, arg1, fmt) \
#define FOP_CONDS(fcmp_fun, type, fmt) \
static fcmp_fun * fcmp ## type ## _ ## fmt ## _table[16] = { \
do_cmp ## type ## _ ## fmt ## _f, \
do_cmp ## type ## _ ## fmt ## _un, \
@ -741,17 +742,17 @@ static fcmp_fun * fcmp ## type ## _ ## fmt ## _table[16] = { \
do_cmp ## type ## _ ## fmt ## _le, \
do_cmp ## type ## _ ## fmt ## _ngt, \
}; \
static inline void gen_cmp ## type ## _ ## fmt(int n, arg0 a, arg1 b, int cc) \
static inline void gen_cmp ## type ## _ ## fmt(int n, TCGv a, TCGv b, int cc) \
{ \
tcg_gen_helper_0_2i(fcmp ## type ## _ ## fmt ## _table[n], a, b, cc); \
}
FOP_CONDS(fcmp_fun64, , uint64_t, uint64_t, d)
FOP_CONDS(fcmp_fun64, abs, uint64_t, uint64_t, d)
FOP_CONDS(fcmp_fun32, , uint32_t, uint32_t, s)
FOP_CONDS(fcmp_fun32, abs, uint32_t, uint32_t, s)
FOP_CONDS(fcmp_fun64, , uint64_t, uint64_t, ps)
FOP_CONDS(fcmp_fun64, abs, uint64_t, uint64_t, ps)
FOP_CONDS(fcmp_fun64, , d)
FOP_CONDS(fcmp_fun64, abs, d)
FOP_CONDS(fcmp_fun32, , s)
FOP_CONDS(fcmp_fun32, abs, s)
FOP_CONDS(fcmp_fun64, , ps)
FOP_CONDS(fcmp_fun64, abs, ps)
#undef FOP_CONDS
/* Tests */
@ -2498,7 +2499,7 @@ static void gen_compute_branch (DisasContext *ctx, uint32_t opc,
{
target_ulong btgt = -1;
int blink = 0;
int bcond = 0;
int bcond_compute = 0;
TCGv t0 = tcg_temp_local_new(TCG_TYPE_TL);
TCGv t1 = tcg_temp_local_new(TCG_TYPE_TL);
@ -2524,7 +2525,7 @@ static void gen_compute_branch (DisasContext *ctx, uint32_t opc,
if (rs != rt) {
gen_load_gpr(t0, rs);
gen_load_gpr(t1, rt);
bcond = 1;
bcond_compute = 1;
}
btgt = ctx->pc + 4 + offset;
break;
@ -2543,7 +2544,7 @@ static void gen_compute_branch (DisasContext *ctx, uint32_t opc,
/* Compare to zero */
if (rs != 0) {
gen_load_gpr(t0, rs);
bcond = 1;
bcond_compute = 1;
}
btgt = ctx->pc + 4 + offset;
break;
@ -2569,7 +2570,7 @@ static void gen_compute_branch (DisasContext *ctx, uint32_t opc,
generate_exception(ctx, EXCP_RI);
goto out;
}
if (bcond == 0) {
if (bcond_compute == 0) {
/* No condition to be computed */
switch (opc) {
case OPC_BEQ: /* rx == rx */
@ -6045,7 +6046,7 @@ static inline void gen_movcf_s (int fs, int fd, int cc, int tf)
tcg_gen_ld_i32(r_tmp1, current_fpu, offsetof(CPUMIPSFPUContext, fcr31));
tcg_gen_andi_i32(r_tmp1, r_tmp1, ccbit);
tcg_gen_brcondi_i32(cond, r_tmp1, 0, l1);
tcg_gen_movi_i32(fp1, fp0);
tcg_gen_mov_i32(fp1, fp0);
tcg_temp_free(fp0);
gen_set_label(l1);
tcg_temp_free(r_tmp1);
@ -6077,7 +6078,7 @@ static inline void gen_movcf_d (DisasContext *ctx, int fs, int fd, int cc, int t
tcg_gen_ld_i32(r_tmp1, current_fpu, offsetof(CPUMIPSFPUContext, fcr31));
tcg_gen_andi_i32(r_tmp1, r_tmp1, ccbit);
tcg_gen_brcondi_i32(cond, r_tmp1, 0, l1);
tcg_gen_movi_i64(fp1, fp0);
tcg_gen_mov_i64(fp1, fp0);
tcg_temp_free(fp0);
gen_set_label(l1);
tcg_temp_free(r_tmp1);
@ -6110,12 +6111,12 @@ static inline void gen_movcf_ps (int fs, int fd, int cc, int tf)
tcg_gen_shri_i32(r_tmp1, r_tmp1, cc);
tcg_gen_andi_i32(r_tmp2, r_tmp1, 0x1);
tcg_gen_brcondi_i32(cond, r_tmp2, 0, l1);
tcg_gen_movi_i32(fp1, fp0);
tcg_gen_mov_i32(fp1, fp0);
tcg_temp_free(fp0);
gen_set_label(l1);
tcg_gen_andi_i32(r_tmp2, r_tmp1, 0x2);
tcg_gen_brcondi_i32(cond, r_tmp2, 0, l2);
tcg_gen_movi_i32(fph1, fph0);
tcg_gen_mov_i32(fph1, fph0);
tcg_temp_free(fph0);
gen_set_label(l2);
tcg_temp_free(r_tmp1);