[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 01/24] tcg: Introduce negsetcond opcodes
From: |
Peter Maydell |
Subject: |
Re: [PATCH 01/24] tcg: Introduce negsetcond opcodes |
Date: |
Thu, 10 Aug 2023 17:12:49 +0100 |
On Tue, 8 Aug 2023 at 04:12, Richard Henderson
<richard.henderson@linaro.org> wrote:
>
> Introduce a new opcode for negative setcond.
>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> +static bool fold_negsetcond(OptContext *ctx, TCGOp *op)
> +{
> + TCGCond cond = op->args[3];
> + int i;
> +
> + if (swap_commutative(op->args[0], &op->args[1], &op->args[2])) {
> + op->args[3] = cond = tcg_swap_cond(cond);
> + }
> +
> + i = do_constant_folding_cond(ctx->type, op->args[1], op->args[2], cond);
> + if (i >= 0) {
> + return tcg_opt_gen_movi(ctx, op, op->args[0], -i);
> + }
> +
> + /* Value is {0,-1} so all bits are repititions of the sign. */
"repetitions"
> + ctx->s_mask = -1;
Do we not also need to set z_mask to something here (presumably -1)?
(I'm not very familiar with the optimizer internals.)
> + return false;
> +}
Otherwise
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
thanks
-- PMM
- [PATCH for-8.2 00/24] tcg: Introduce negsetcond opcodes, Richard Henderson, 2023/08/07
- [PATCH 01/24] tcg: Introduce negsetcond opcodes, Richard Henderson, 2023/08/07
- Re: [PATCH 01/24] tcg: Introduce negsetcond opcodes,
Peter Maydell <=
- [PATCH 02/24] tcg: Use tcg_gen_negsetcond_*, Richard Henderson, 2023/08/07
- [PATCH 03/24] target/alpha: Use tcg_gen_movcond_i64 in gen_fold_mzero, Richard Henderson, 2023/08/07
- [PATCH 04/24] target/arm: Use tcg_gen_negsetcond_*, Richard Henderson, 2023/08/07
- [PATCH 05/24] target/m68k: Use tcg_gen_negsetcond_*, Richard Henderson, 2023/08/07