mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 23:33:54 -06:00
tcg: Add add/sub with carry opcodes and infrastructure
Liveness needs to track carry-live state in order to determine if the (hidden) output of the opcode is used. Code generation needs to track carry-live state in order to avoid clobbering cpu flags when loading constants. So far, output routines and backends are unchanged. Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
parent
3e3689df4e
commit
76f4278029
5 changed files with 235 additions and 10 deletions
|
@ -1226,6 +1226,12 @@ static bool fold_add_vec(OptContext *ctx, TCGOp *op)
|
|||
return finish_folding(ctx, op);
|
||||
}
|
||||
|
||||
static bool fold_add_carry(OptContext *ctx, TCGOp *op)
|
||||
{
|
||||
fold_commutative(ctx, op);
|
||||
return finish_folding(ctx, op);
|
||||
}
|
||||
|
||||
static bool fold_addsub2(OptContext *ctx, TCGOp *op, bool add)
|
||||
{
|
||||
bool a_const = arg_is_const(op->args[2]) && arg_is_const(op->args[3]);
|
||||
|
@ -2829,6 +2835,11 @@ void tcg_optimize(TCGContext *s)
|
|||
case INDEX_op_add_vec:
|
||||
done = fold_add_vec(&ctx, op);
|
||||
break;
|
||||
case INDEX_op_addci:
|
||||
case INDEX_op_addco:
|
||||
case INDEX_op_addcio:
|
||||
done = fold_add_carry(&ctx, op);
|
||||
break;
|
||||
CASE_OP_32_64(add2):
|
||||
done = fold_add2(&ctx, op);
|
||||
break;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue