Re: [PATCH 9/9] target/mips: Explode gen_msa_branch() as gen_msa_BxZ_V/BxZ()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 12/2/20 12:44 PM, Philippe Mathieu-Daudé wrote:
> +static bool gen_msa_BxZ(DisasContext *ctx, int df, int wt, int s16, bool if_not)
> +{
> +    check_msa_access(ctx);
> +
> +    if (ctx->hflags & MIPS_HFLAG_BMASK) {
> +        generate_exception_end(ctx, EXCP_RI);
> +        return true;
> +    }
> +
> +    gen_check_zero_element(bcond, df, wt);
> +    if (if_not) {
> +        tcg_gen_setcondi_tl(TCG_COND_EQ, bcond, bcond, 0);
> +    }

Since gen_check_zero_element already produces a boolean, this is better as

  tcg_gen_xori_tl(bcond, bcond, if_not);

where tcg_gen_xori_tl already contains the if.

>      case OPC_BNZ_D:
> -        gen_check_zero_element(bcond, df, wt);
> -        tcg_gen_setcondi_tl(TCG_COND_EQ, bcond, bcond, 0);
> +        gen_msa_BxZ(ctx, df, wt, s16, true);

... oops, that'd be for a follow-up patch, to make this patch just code movement.

Reviewed-by: Richard Henderson <richard.henderson@xxxxxxxxxx>

r~



[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux