[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 19/65] tcg/optimize: Fold movcond 0/1 into setcond
From: |
Richard Henderson |
Subject: |
[Qemu-devel] [PATCH 19/65] tcg/optimize: Fold movcond 0/1 into setcond |
Date: |
Fri, 23 Dec 2016 19:59:56 -0800 |
Signed-off-by: Richard Henderson <address@hidden>
---
tcg/optimize.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/tcg/optimize.c b/tcg/optimize.c
index f41ed2c..9e26bb7 100644
--- a/tcg/optimize.c
+++ b/tcg/optimize.c
@@ -1105,6 +1105,21 @@ void tcg_optimize(TCGContext *s)
tcg_opt_gen_mov(s, op, args, args[0], args[4-tmp]);
break;
}
+ if (temp_is_const(args[3]) && temp_is_const(args[4])) {
+ tcg_target_ulong tv = temps[args[3]].val;
+ tcg_target_ulong fv = temps[args[4]].val;
+ TCGCond cond = args[5];
+ if (fv == 1 && tv == 0) {
+ cond = tcg_invert_cond(cond);
+ } else if (!(tv == 1 && fv == 0)) {
+ goto do_default;
+ }
+ args[3] = cond;
+ op->opc = opc = (opc == INDEX_op_movcond_i32
+ ? INDEX_op_setcond_i32
+ : INDEX_op_setcond_i64);
+ nb_iargs = 2;
+ }
goto do_default;
case INDEX_op_add2_i32:
--
2.9.3
- [Qemu-devel] [PATCH 09/65] tcg/ppc: Implement field extraction opcodes, (continued)
- [Qemu-devel] [PATCH 09/65] tcg/ppc: Implement field extraction opcodes, Richard Henderson, 2016/12/23
- [Qemu-devel] [PATCH 11/65] tcg/s390: Implement field extraction opcodes, Richard Henderson, 2016/12/23
- [Qemu-devel] [PATCH 12/65] tcg/s390: Support deposit into zero, Richard Henderson, 2016/12/23
- [Qemu-devel] [PATCH 06/65] tcg/arm: Implement field extraction opcodes, Richard Henderson, 2016/12/23
- [Qemu-devel] [PATCH 10/65] tcg/s390: Expose host facilities to tcg-target.h, Richard Henderson, 2016/12/23
- [Qemu-devel] [PATCH 13/65] target-alpha: Use deposit and extract ops, Richard Henderson, 2016/12/23
- [Qemu-devel] [PATCH 15/65] target-i386: Use new deposit and extract ops, Richard Henderson, 2016/12/23
- [Qemu-devel] [PATCH 14/65] target-arm: Use new deposit and extract ops, Richard Henderson, 2016/12/23
- [Qemu-devel] [PATCH 17/65] target-ppc: Use the new deposit and extract ops, Richard Henderson, 2016/12/23
- [Qemu-devel] [PATCH 18/65] target-s390x: Use the new deposit and extract ops, Richard Henderson, 2016/12/23
- [Qemu-devel] [PATCH 19/65] tcg/optimize: Fold movcond 0/1 into setcond,
Richard Henderson <=
- [Qemu-devel] [PATCH 21/65] tcg: Transition flat op_defs array to a target callback, Richard Henderson, 2016/12/23
- [Qemu-devel] [PATCH 20/65] tcg: Add markup for output requires new register, Richard Henderson, 2016/12/23
- [Qemu-devel] [PATCH 23/65] tcg: Allow an operand to be matching or a constant, Richard Henderson, 2016/12/23
- [Qemu-devel] [PATCH 16/65] target-mips: Use the new extract op, Richard Henderson, 2016/12/23
- [Qemu-devel] [PATCH 25/65] disas/i386.c: Handle tzcnt, Richard Henderson, 2016/12/23
- [Qemu-devel] [PATCH 26/65] disas/ppc: Handle popcnt and cnttz, Richard Henderson, 2016/12/23
- [Qemu-devel] [PATCH 22/65] tcg: Pass the opcode width to target_parse_constraint, Richard Henderson, 2016/12/23
- [Qemu-devel] [PATCH 27/65] target-alpha: Use the ctz and clz opcodes, Richard Henderson, 2016/12/23
- [Qemu-devel] [PATCH 29/65] target-microblaze: Use clz opcode, Richard Henderson, 2016/12/23
- [Qemu-devel] [PATCH 30/65] target-mips: Use clz opcode, Richard Henderson, 2016/12/23