target-alpha: Convert opcode 0x17 to source/sink

Signed-off-by: Richard Henderson <rth@twiddle.net>
This commit is contained in:
Richard Henderson 2014-03-18 23:59:59 -07:00
parent 075b8ddb9b
commit 6b88b37c0e
1 changed files with 20 additions and 21 deletions

View File

@ -197,7 +197,7 @@ static TCGv dest_gpr(DisasContext *ctx, unsigned reg)
} }
} }
static TCGv __attribute__((unused)) load_fpr(DisasContext *ctx, unsigned reg) static TCGv load_fpr(DisasContext *ctx, unsigned reg)
{ {
if (likely(reg < 31)) { if (likely(reg < 31)) {
return cpu_fir[reg]; return cpu_fir[reg];
@ -2429,6 +2429,7 @@ static ExitStatus translate_one(DisasContext *ctx, uint32_t insn)
goto invalid_opc; goto invalid_opc;
} }
break; break;
case 0x15: case 0x15:
/* VAX floating point */ /* VAX floating point */
/* XXX: rounding mode and trap are ignored (!) */ /* XXX: rounding mode and trap are ignored (!) */
@ -2509,6 +2510,7 @@ static ExitStatus translate_one(DisasContext *ctx, uint32_t insn)
goto invalid_opc; goto invalid_opc;
} }
break; break;
case 0x16: case 0x16:
/* IEEE floating-point */ /* IEEE floating-point */
switch (fpfn) { /* fn11 & 0x3F */ switch (fpfn) { /* fn11 & 0x3F */
@ -2589,6 +2591,7 @@ static ExitStatus translate_one(DisasContext *ctx, uint32_t insn)
goto invalid_opc; goto invalid_opc;
} }
break; break;
case 0x17: case 0x17:
switch (fn11) { switch (fn11) {
case 0x010: case 0x010:
@ -2597,18 +2600,20 @@ static ExitStatus translate_one(DisasContext *ctx, uint32_t insn)
gen_fcvtlq(rb, rc); gen_fcvtlq(rb, rc);
break; break;
case 0x020: case 0x020:
if (likely(rc != 31)) { /* CPYS */
if (ra == rb) { if (rc == 31) {
/* FMOV */ /* Special case CPYS as FNOP. */
if (ra == 31) { } else if (ra == rb) {
tcg_gen_movi_i64(cpu_fir[rc], 0); vc = dest_fpr(ctx, rc);
} else { /* Special case CPYS as FMOV. */
tcg_gen_mov_i64(cpu_fir[rc], cpu_fir[ra]); if (ra == 31) {
} tcg_gen_movi_i64(vc, 0);
} else { } else {
/* CPYS */ va = load_fpr(ctx, ra);
gen_fcpys(ra, rb, rc); tcg_gen_mov_i64(vc, va);
} }
} else {
gen_fcpys(ra, rb, rc);
} }
break; break;
case 0x021: case 0x021:
@ -2621,19 +2626,13 @@ static ExitStatus translate_one(DisasContext *ctx, uint32_t insn)
break; break;
case 0x024: case 0x024:
/* MT_FPCR */ /* MT_FPCR */
if (likely(ra != 31)) { va = load_fpr(ctx, ra);
gen_helper_store_fpcr(cpu_env, cpu_fir[ra]); gen_helper_store_fpcr(cpu_env, va);
} else {
TCGv tmp = tcg_const_i64(0);
gen_helper_store_fpcr(cpu_env, tmp);
tcg_temp_free(tmp);
}
break; break;
case 0x025: case 0x025:
/* MF_FPCR */ /* MF_FPCR */
if (likely(ra != 31)) { va = dest_fpr(ctx, ra);
gen_helper_load_fpcr(cpu_fir[ra], cpu_env); gen_helper_load_fpcr(va, cpu_env);
}
break; break;
case 0x02A: case 0x02A:
/* FCMOVEQ */ /* FCMOVEQ */