tcg/optimize: Build and use zero, one and affected bits in fold_orc
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
parent
84b399df9a
commit
cc4033ee47
1 changed files with 9 additions and 2 deletions
|
|
@ -2287,7 +2287,7 @@ static bool fold_or(OptContext *ctx, TCGOp *op)
|
||||||
|
|
||||||
static bool fold_orc(OptContext *ctx, TCGOp *op)
|
static bool fold_orc(OptContext *ctx, TCGOp *op)
|
||||||
{
|
{
|
||||||
uint64_t s_mask;
|
uint64_t z_mask, o_mask, s_mask, a_mask;
|
||||||
TempOptInfo *t1, *t2;
|
TempOptInfo *t1, *t2;
|
||||||
|
|
||||||
if (fold_const2(ctx, op) ||
|
if (fold_const2(ctx, op) ||
|
||||||
|
|
@ -2318,8 +2318,15 @@ static bool fold_orc(OptContext *ctx, TCGOp *op)
|
||||||
}
|
}
|
||||||
|
|
||||||
t1 = arg_info(op->args[1]);
|
t1 = arg_info(op->args[1]);
|
||||||
|
|
||||||
|
z_mask = t1->z_mask | ~t2->o_mask;
|
||||||
|
o_mask = t1->o_mask | ~t2->z_mask;
|
||||||
s_mask = t1->s_mask & t2->s_mask;
|
s_mask = t1->s_mask & t2->s_mask;
|
||||||
return fold_masks_s(ctx, op, s_mask);
|
|
||||||
|
/* Affected bits are those not known one, masked by those known one. */
|
||||||
|
a_mask = ~t1->o_mask & t2->o_mask;
|
||||||
|
|
||||||
|
return fold_masks_zosa(ctx, op, z_mask, o_mask, s_mask, a_mask);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool fold_qemu_ld_1reg(OptContext *ctx, TCGOp *op)
|
static bool fold_qemu_ld_1reg(OptContext *ctx, TCGOp *op)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue