On 12/4/20 6:04 PM, Richard Henderson wrote:
> 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.
Ah, got it.
>
>> 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.
Yes, will follow. I'm tempted to inline gen_check_zero_element (actually
move gen_msa_BxZ as gen_check_zero_element prologue/epilogue). Not sure
gen_check_zero_element() can be reused later though.
>
> Reviewed-by: Richard Henderson <[email protected]>
Thanks!
>
> r~
>