提交 bbe1dab4 编写于 作者: R Richard Henderson 提交者: Aurelien Jarno

target-alpha: Use non-inverted arguments to gen_{f}cmov.

The inverted conditions as argument to the function looks wrong
at a glance inside translate_one.  Since we have an easy function
to produce the inversion now, use it.
Signed-off-by: NRichard Henderson <rth@twiddle.net>
Signed-off-by: NAurelien Jarno <aurelien@aurel32.net>
上级 9e05960f
...@@ -394,9 +394,10 @@ static void gen_fbcond(DisasContext *ctx, TCGCond cond, int ra, int32_t disp) ...@@ -394,9 +394,10 @@ static void gen_fbcond(DisasContext *ctx, TCGCond cond, int ra, int32_t disp)
gen_bcond_pcload(ctx, disp, lab_true); gen_bcond_pcload(ctx, disp, lab_true);
} }
static inline void gen_cmov(TCGCond inv_cond, int ra, int rb, int rc, static void gen_cmov(TCGCond cond, int ra, int rb, int rc,
int islit, uint8_t lit, int mask) int islit, uint8_t lit, int mask)
{ {
TCGCond inv_cond = tcg_invert_cond(cond);
int l1; int l1;
if (unlikely(rc == 31)) if (unlikely(rc == 31))
...@@ -426,7 +427,7 @@ static inline void gen_cmov(TCGCond inv_cond, int ra, int rb, int rc, ...@@ -426,7 +427,7 @@ static inline void gen_cmov(TCGCond inv_cond, int ra, int rb, int rc,
gen_set_label(l1); gen_set_label(l1);
} }
static void gen_fcmov(TCGCond inv_cond, int ra, int rb, int rc) static void gen_fcmov(TCGCond cond, int ra, int rb, int rc)
{ {
TCGv va = cpu_fir[ra]; TCGv va = cpu_fir[ra];
int l1; int l1;
...@@ -439,7 +440,7 @@ static void gen_fcmov(TCGCond inv_cond, int ra, int rb, int rc) ...@@ -439,7 +440,7 @@ static void gen_fcmov(TCGCond inv_cond, int ra, int rb, int rc)
} }
l1 = gen_new_label(); l1 = gen_new_label();
gen_fbcond_internal(inv_cond, va, l1); gen_fbcond_internal(tcg_invert_cond(cond), va, l1);
if (rb != 31) if (rb != 31)
tcg_gen_mov_i64(cpu_fir[rc], cpu_fir[rb]); tcg_gen_mov_i64(cpu_fir[rc], cpu_fir[rb]);
...@@ -1663,11 +1664,11 @@ static inline int translate_one(DisasContext *ctx, uint32_t insn) ...@@ -1663,11 +1664,11 @@ static inline int translate_one(DisasContext *ctx, uint32_t insn)
break; break;
case 0x14: case 0x14:
/* CMOVLBS */ /* CMOVLBS */
gen_cmov(TCG_COND_EQ, ra, rb, rc, islit, lit, 1); gen_cmov(TCG_COND_NE, ra, rb, rc, islit, lit, 1);
break; break;
case 0x16: case 0x16:
/* CMOVLBC */ /* CMOVLBC */
gen_cmov(TCG_COND_NE, ra, rb, rc, islit, lit, 1); gen_cmov(TCG_COND_EQ, ra, rb, rc, islit, lit, 1);
break; break;
case 0x20: case 0x20:
/* BIS */ /* BIS */
...@@ -1687,11 +1688,11 @@ static inline int translate_one(DisasContext *ctx, uint32_t insn) ...@@ -1687,11 +1688,11 @@ static inline int translate_one(DisasContext *ctx, uint32_t insn)
break; break;
case 0x24: case 0x24:
/* CMOVEQ */ /* CMOVEQ */
gen_cmov(TCG_COND_NE, ra, rb, rc, islit, lit, 0); gen_cmov(TCG_COND_EQ, ra, rb, rc, islit, lit, 0);
break; break;
case 0x26: case 0x26:
/* CMOVNE */ /* CMOVNE */
gen_cmov(TCG_COND_EQ, ra, rb, rc, islit, lit, 0); gen_cmov(TCG_COND_NE, ra, rb, rc, islit, lit, 0);
break; break;
case 0x28: case 0x28:
/* ORNOT */ /* ORNOT */
...@@ -1727,11 +1728,11 @@ static inline int translate_one(DisasContext *ctx, uint32_t insn) ...@@ -1727,11 +1728,11 @@ static inline int translate_one(DisasContext *ctx, uint32_t insn)
break; break;
case 0x44: case 0x44:
/* CMOVLT */ /* CMOVLT */
gen_cmov(TCG_COND_GE, ra, rb, rc, islit, lit, 0); gen_cmov(TCG_COND_LT, ra, rb, rc, islit, lit, 0);
break; break;
case 0x46: case 0x46:
/* CMOVGE */ /* CMOVGE */
gen_cmov(TCG_COND_LT, ra, rb, rc, islit, lit, 0); gen_cmov(TCG_COND_GE, ra, rb, rc, islit, lit, 0);
break; break;
case 0x48: case 0x48:
/* EQV */ /* EQV */
...@@ -1771,11 +1772,11 @@ static inline int translate_one(DisasContext *ctx, uint32_t insn) ...@@ -1771,11 +1772,11 @@ static inline int translate_one(DisasContext *ctx, uint32_t insn)
break; break;
case 0x64: case 0x64:
/* CMOVLE */ /* CMOVLE */
gen_cmov(TCG_COND_GT, ra, rb, rc, islit, lit, 0); gen_cmov(TCG_COND_LE, ra, rb, rc, islit, lit, 0);
break; break;
case 0x66: case 0x66:
/* CMOVGT */ /* CMOVGT */
gen_cmov(TCG_COND_LE, ra, rb, rc, islit, lit, 0); gen_cmov(TCG_COND_GT, ra, rb, rc, islit, lit, 0);
break; break;
case 0x6C: case 0x6C:
/* IMPLVER */ /* IMPLVER */
...@@ -2249,27 +2250,27 @@ static inline int translate_one(DisasContext *ctx, uint32_t insn) ...@@ -2249,27 +2250,27 @@ static inline int translate_one(DisasContext *ctx, uint32_t insn)
break; break;
case 0x02A: case 0x02A:
/* FCMOVEQ */ /* FCMOVEQ */
gen_fcmov(TCG_COND_NE, ra, rb, rc); gen_fcmov(TCG_COND_EQ, ra, rb, rc);
break; break;
case 0x02B: case 0x02B:
/* FCMOVNE */ /* FCMOVNE */
gen_fcmov(TCG_COND_EQ, ra, rb, rc); gen_fcmov(TCG_COND_NE, ra, rb, rc);
break; break;
case 0x02C: case 0x02C:
/* FCMOVLT */ /* FCMOVLT */
gen_fcmov(TCG_COND_GE, ra, rb, rc); gen_fcmov(TCG_COND_LT, ra, rb, rc);
break; break;
case 0x02D: case 0x02D:
/* FCMOVGE */ /* FCMOVGE */
gen_fcmov(TCG_COND_LT, ra, rb, rc); gen_fcmov(TCG_COND_GE, ra, rb, rc);
break; break;
case 0x02E: case 0x02E:
/* FCMOVLE */ /* FCMOVLE */
gen_fcmov(TCG_COND_GT, ra, rb, rc); gen_fcmov(TCG_COND_LE, ra, rb, rc);
break; break;
case 0x02F: case 0x02F:
/* FCMOVGT */ /* FCMOVGT */
gen_fcmov(TCG_COND_LE, ra, rb, rc); gen_fcmov(TCG_COND_GT, ra, rb, rc);
break; break;
case 0x030: case 0x030:
/* CVTQL */ /* CVTQL */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册