mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 15:53:54 -06:00
tcg/optimize: Use fold_masks_zs in fold_or
Avoid the use of the OptContext slots. Find TempOptInfo once. Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
parent
608e75fc0c
commit
83b1ba3696
1 changed files with 8 additions and 5 deletions
|
@ -2078,17 +2078,20 @@ static bool fold_not(OptContext *ctx, TCGOp *op)
|
|||
|
||||
static bool fold_or(OptContext *ctx, TCGOp *op)
|
||||
{
|
||||
uint64_t z_mask, s_mask;
|
||||
TempOptInfo *t1, *t2;
|
||||
|
||||
if (fold_const2_commutative(ctx, op) ||
|
||||
fold_xi_to_x(ctx, op, 0) ||
|
||||
fold_xx_to_x(ctx, op)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
ctx->z_mask = arg_info(op->args[1])->z_mask
|
||||
| arg_info(op->args[2])->z_mask;
|
||||
ctx->s_mask = arg_info(op->args[1])->s_mask
|
||||
& arg_info(op->args[2])->s_mask;
|
||||
return fold_masks(ctx, op);
|
||||
t1 = arg_info(op->args[1]);
|
||||
t2 = arg_info(op->args[2]);
|
||||
z_mask = t1->z_mask | t2->z_mask;
|
||||
s_mask = t1->s_mask & t2->s_mask;
|
||||
return fold_masks_zs(ctx, op, z_mask, s_mask);
|
||||
}
|
||||
|
||||
static bool fold_orc(OptContext *ctx, TCGOp *op)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue