[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] target/mips: Fix loongson multimedia condition instructions
From: |
Richard Henderson |
Subject: |
Re: [PATCH] target/mips: Fix loongson multimedia condition instructions |
Date: |
Mon, 23 Mar 2020 10:36:05 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 |
On 3/20/20 9:56 PM, Jiaxun Yang wrote:
> case OPC_SLE_CP2:
> - /*
> - * ??? Document is unclear: Set FCC[CC]. Does that mean the
> - * FD field is the CC field?
> - */
> + cond = TCG_COND_LE;
> + do_cc_cond:
> + {
> + int cc = (ctx->opcode >> 8) & 0x7;
> + lab = gen_new_label();
> + tcg_gen_ori_i32(fpu_fcr31, fpu_fcr31, 1 << get_fp_bit(cc));
> + tcg_gen_brcond_i64(cond, t0, t1, lab);
> + tcg_gen_xori_i32(fpu_fcr31, fpu_fcr31, 1 << get_fp_bit(cc));
> + gen_set_label(lab);
> + }
> + goto no_rd;
> + break;
There is no need for a branch here. This is a deposit operation.
TCGv_i64 t64 = tcg_temp_new_i64();
TCGv_i32 t32 = tcg_temp_new_i32();
tcg_gen_setcond_i64(cond, t64, t0, t1);
tcg_gen_extrl_i64_i32(t32, t64);
tcg_gen_deposit_i32(cpu_fcr31, cpu_fcr31, t32,
get_fp_bit(cc), 1);
tcg_temp_free_i32(t32);
tcg_temp_free_i64(t64);
r~