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 <[email protected]>
r~