tcg/optimize: Build and use z_bits and o_bits in fold_nor
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
parent
16559c3ecb
commit
682d6d57ba
1 changed files with 10 additions and 4 deletions
|
|
@ -2231,16 +2231,22 @@ static bool fold_neg(OptContext *ctx, TCGOp *op)
|
|||
|
||||
static bool fold_nor(OptContext *ctx, TCGOp *op)
|
||||
{
|
||||
uint64_t s_mask;
|
||||
uint64_t z_mask, o_mask, s_mask;
|
||||
TempOptInfo *t1, *t2;
|
||||
|
||||
if (fold_const2_commutative(ctx, op) ||
|
||||
fold_xi_to_not(ctx, op, 0)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
s_mask = arg_info(op->args[1])->s_mask
|
||||
& arg_info(op->args[2])->s_mask;
|
||||
return fold_masks_s(ctx, op, s_mask);
|
||||
t1 = arg_info(op->args[1]);
|
||||
t2 = arg_info(op->args[2]);
|
||||
|
||||
z_mask = ~(t1->o_mask | t2->o_mask);
|
||||
o_mask = ~(t1->z_mask | t2->z_mask);
|
||||
s_mask = t1->s_mask & t2->s_mask;
|
||||
|
||||
return fold_masks_zos(ctx, op, z_mask, o_mask, s_mask);
|
||||
}
|
||||
|
||||
static bool fold_not(OptContext *ctx, TCGOp *op)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue