On 06/20/2018 05:05 AM, Yongbok Kim wrote:
> +    case NM_SOV:
> +    {
> +        TCGv t0 = tcg_temp_local_new();
> +        TCGv t1 = tcg_temp_new();
> +        TCGv t2 = tcg_temp_new();
> +        TCGLabel *l1 = gen_new_label();
> +
> +        gen_load_gpr(t1, rs);
> +        gen_load_gpr(t2, rt);
> +        tcg_gen_add_tl(t0, t1, t2);
> +        tcg_gen_ext32s_tl(t0, t0);
> +        tcg_gen_xor_tl(t1, t1, t2);
> +        tcg_gen_xor_tl(t2, t0, t2);
> +        tcg_gen_andc_tl(t1, t2, t1);
> +
> +        tcg_gen_movi_tl(t0, 0);
> +        tcg_gen_brcondi_tl(TCG_COND_GE, t1, 0, l1);
> +        /* operands of same sign, result different sign */
> +
> +        tcg_gen_movi_tl(t0, 1);
> +        gen_set_label(l1);
> +        gen_store_gpr(t0, rd);

No need for branch.  This is just extracting the sign bit, so

  tcg_gen_shri_tl(t0, t1, TARGET_LONG_BITS - 1);


r~

Reply via email to