[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL v2 34/60] tcg/optimize: Split out fold_mov
From: |
Richard Henderson |
Subject: |
[PULL v2 34/60] tcg/optimize: Split out fold_mov |
Date: |
Thu, 28 Oct 2021 21:33:03 -0700 |
This is the final entry in the main switch that was in a
different form. After this, we have the option to convert
the switch into a function dispatch table.
Reviewed-by: Luis Pires <luis.pires@eldorado.org.br>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
tcg/optimize.c | 27 ++++++++++++++-------------
1 file changed, 14 insertions(+), 13 deletions(-)
diff --git a/tcg/optimize.c b/tcg/optimize.c
index 8524fe1f8a..5f1bd7cd78 100644
--- a/tcg/optimize.c
+++ b/tcg/optimize.c
@@ -1015,6 +1015,11 @@ static bool fold_mb(OptContext *ctx, TCGOp *op)
return true;
}
+static bool fold_mov(OptContext *ctx, TCGOp *op)
+{
+ return tcg_opt_gen_mov(ctx, op, op->args[0], op->args[1]);
+}
+
static bool fold_movcond(OptContext *ctx, TCGOp *op)
{
TCGOpcode opc = op->opc;
@@ -1748,20 +1753,11 @@ void tcg_optimize(TCGContext *s)
break;
}
- /* Propagate constants through copy operations and do constant
- folding. Constants will be substituted to arguments by register
- allocator where needed and possible. Also detect copies. */
+ /*
+ * Process each opcode.
+ * Sorted alphabetically by opcode as much as possible.
+ */
switch (opc) {
- CASE_OP_32_64_VEC(mov):
- done = tcg_opt_gen_mov(&ctx, op, op->args[0], op->args[1]);
- break;
-
- default:
- break;
-
- /* ---------------------------------------------------------- */
- /* Sorted alphabetically by opcode as much as possible. */
-
CASE_OP_32_64_VEC(add):
done = fold_add(&ctx, op);
break;
@@ -1831,6 +1827,9 @@ void tcg_optimize(TCGContext *s)
case INDEX_op_mb:
done = fold_mb(&ctx, op);
break;
+ CASE_OP_32_64_VEC(mov):
+ done = fold_mov(&ctx, op);
+ break;
CASE_OP_32_64(movcond):
done = fold_movcond(&ctx, op);
break;
@@ -1900,6 +1899,8 @@ void tcg_optimize(TCGContext *s)
CASE_OP_32_64_VEC(xor):
done = fold_xor(&ctx, op);
break;
+ default:
+ break;
}
if (!done) {
--
2.25.1
- [PULL v2 20/60] tcg/optimize: Split out fold_const{1,2}, (continued)
- [PULL v2 20/60] tcg/optimize: Split out fold_const{1,2}, Richard Henderson, 2021/10/29
- [PULL v2 25/60] tcg/optimize: Split out fold_mulu2_i32, Richard Henderson, 2021/10/29
- [PULL v2 21/60] tcg/optimize: Split out fold_setcond2, Richard Henderson, 2021/10/29
- [PULL v2 24/60] tcg/optimize: Split out fold_setcond, Richard Henderson, 2021/10/29
- [PULL v2 26/60] tcg/optimize: Split out fold_addsub2_i32, Richard Henderson, 2021/10/29
- [PULL v2 27/60] tcg/optimize: Split out fold_movcond, Richard Henderson, 2021/10/29
- [PULL v2 28/60] tcg/optimize: Split out fold_extract2, Richard Henderson, 2021/10/29
- [PULL v2 30/60] tcg/optimize: Split out fold_deposit, Richard Henderson, 2021/10/29
- [PULL v2 32/60] tcg/optimize: Split out fold_bswap, Richard Henderson, 2021/10/29
- [PULL v2 33/60] tcg/optimize: Split out fold_dup, fold_dup2, Richard Henderson, 2021/10/29
- [PULL v2 34/60] tcg/optimize: Split out fold_mov,
Richard Henderson <=
- [PULL v2 23/60] tcg/optimize: Split out fold_brcond, Richard Henderson, 2021/10/29
- [PULL v2 37/60] tcg/optimize: Split out fold_xi_to_i, Richard Henderson, 2021/10/29
- [PULL v2 31/60] tcg/optimize: Split out fold_count_zeros, Richard Henderson, 2021/10/29
- [PULL v2 36/60] tcg/optimize: Split out fold_xx_to_x, Richard Henderson, 2021/10/29
- [PULL v2 35/60] tcg/optimize: Split out fold_xx_to_i, Richard Henderson, 2021/10/29
- [PULL v2 29/60] tcg/optimize: Split out fold_extract, fold_sextract, Richard Henderson, 2021/10/29
- [PULL v2 39/60] tcg/optimize: Split out fold_to_not, Richard Henderson, 2021/10/29
- [PULL v2 38/60] tcg/optimize: Add type to OptContext, Richard Henderson, 2021/10/29
- [PULL v2 40/60] tcg/optimize: Split out fold_sub_to_neg, Richard Henderson, 2021/10/29
- [PULL v2 41/60] tcg/optimize: Split out fold_xi_to_x, Richard Henderson, 2021/10/29