提交 24f9cd95 编写于 作者: R Richard Henderson 提交者: David Gibson

target-ppc: Use movcond in isel

Signed-off-by: NRichard Henderson <rth@twiddle.net>
Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
上级 319de6fe
...@@ -756,27 +756,20 @@ static void gen_cmpli(DisasContext *ctx) ...@@ -756,27 +756,20 @@ static void gen_cmpli(DisasContext *ctx)
/* isel (PowerPC 2.03 specification) */ /* isel (PowerPC 2.03 specification) */
static void gen_isel(DisasContext *ctx) static void gen_isel(DisasContext *ctx)
{ {
TCGLabel *l1, *l2;
uint32_t bi = rC(ctx->opcode); uint32_t bi = rC(ctx->opcode);
uint32_t mask; uint32_t mask = 0x08 >> (bi & 0x03);
TCGv_i32 t0; TCGv t0 = tcg_temp_new();
TCGv zr;
l1 = gen_new_label(); tcg_gen_extu_i32_tl(t0, cpu_crf[bi >> 2]);
l2 = gen_new_label(); tcg_gen_andi_tl(t0, t0, mask);
mask = 0x08 >> (bi & 0x03); zr = tcg_const_tl(0);
t0 = tcg_temp_new_i32(); tcg_gen_movcond_tl(TCG_COND_NE, cpu_gpr[rD(ctx->opcode)], t0, zr,
tcg_gen_andi_i32(t0, cpu_crf[bi >> 2], mask); rA(ctx->opcode) ? cpu_gpr[rA(ctx->opcode)] : zr,
tcg_gen_brcondi_i32(TCG_COND_EQ, t0, 0, l1); cpu_gpr[rB(ctx->opcode)]);
if (rA(ctx->opcode) == 0) tcg_temp_free(zr);
tcg_gen_movi_tl(cpu_gpr[rD(ctx->opcode)], 0); tcg_temp_free(t0);
else
tcg_gen_mov_tl(cpu_gpr[rD(ctx->opcode)], cpu_gpr[rA(ctx->opcode)]);
tcg_gen_br(l2);
gen_set_label(l1);
tcg_gen_mov_tl(cpu_gpr[rD(ctx->opcode)], cpu_gpr[rB(ctx->opcode)]);
gen_set_label(l2);
tcg_temp_free_i32(t0);
} }
/* cmpb: PowerPC 2.05 specification */ /* cmpb: PowerPC 2.05 specification */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册