mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 00:03:54 -06:00
tcg: Merge INDEX_op_extract2_{i32,i64}
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
parent
c8f9f70047
commit
61d6a8767a
6 changed files with 19 additions and 34 deletions
|
@ -1873,12 +1873,12 @@ static bool fold_extract2(OptContext *ctx, TCGOp *op)
|
|||
uint64_t v2 = arg_info(op->args[2])->val;
|
||||
int shr = op->args[3];
|
||||
|
||||
if (op->opc == INDEX_op_extract2_i64) {
|
||||
v1 >>= shr;
|
||||
v2 <<= 64 - shr;
|
||||
} else {
|
||||
if (ctx->type == TCG_TYPE_I32) {
|
||||
v1 = (uint32_t)v1 >> shr;
|
||||
v2 = (uint64_t)((int32_t)v2 << (32 - shr));
|
||||
} else {
|
||||
v1 >>= shr;
|
||||
v2 <<= 64 - shr;
|
||||
}
|
||||
return tcg_opt_gen_movi(ctx, op, op->args[0], v1 | v2);
|
||||
}
|
||||
|
@ -2878,7 +2878,7 @@ void tcg_optimize(TCGContext *s)
|
|||
case INDEX_op_extract:
|
||||
done = fold_extract(&ctx, op);
|
||||
break;
|
||||
CASE_OP_32_64(extract2):
|
||||
case INDEX_op_extract2:
|
||||
done = fold_extract2(&ctx, op);
|
||||
break;
|
||||
case INDEX_op_ext_i32_i64:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue