[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 19/65] tcg/optimize: Fold movcond 0/1 into setcond
From: |
Richard Henderson |
Subject: |
[Qemu-devel] [PULL 19/65] tcg/optimize: Fold movcond 0/1 into setcond |
Date: |
Tue, 10 Jan 2017 18:17:34 -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] [PULL 07/65] tcg/i386: Implement field extraction opcodes, (continued)
- [Qemu-devel] [PULL 07/65] tcg/i386: Implement field extraction opcodes, Richard Henderson, 2017/01/10
- [Qemu-devel] [PULL 08/65] tcg/mips: Implement field extraction opcodes, Richard Henderson, 2017/01/10
- [Qemu-devel] [PULL 01/65] tcg: Add field extraction primitives, Richard Henderson, 2017/01/10
- [Qemu-devel] [PULL 09/65] tcg/ppc: Implement field extraction opcodes, Richard Henderson, 2017/01/10
- [Qemu-devel] [PULL 12/65] tcg/s390: Support deposit into zero, Richard Henderson, 2017/01/10
- [Qemu-devel] [PULL 11/65] tcg/s390: Implement field extraction opcodes, Richard Henderson, 2017/01/10
- [Qemu-devel] [PULL 10/65] tcg/s390: Expose host facilities to tcg-target.h, Richard Henderson, 2017/01/10
- [Qemu-devel] [PULL 13/65] target-alpha: Use deposit and extract ops, Richard Henderson, 2017/01/10
- [Qemu-devel] [PULL 19/65] tcg/optimize: Fold movcond 0/1 into setcond,
Richard Henderson <=
- [Qemu-devel] [PULL 14/65] target-arm: Use new deposit and extract ops, Richard Henderson, 2017/01/10
- [Qemu-devel] [PULL 15/65] target-i386: Use new deposit and extract ops, Richard Henderson, 2017/01/10
- [Qemu-devel] [PULL 16/65] target-mips: Use the new extract op, Richard Henderson, 2017/01/10
- [Qemu-devel] [PULL 17/65] target-ppc: Use the new deposit and extract ops, Richard Henderson, 2017/01/10
- [Qemu-devel] [PULL 18/65] target-s390x: Use the new deposit and extract ops, Richard Henderson, 2017/01/10
- [Qemu-devel] [PULL 20/65] tcg: Add markup for output requires new register, Richard Henderson, 2017/01/10
- [Qemu-devel] [PULL 21/65] tcg: Transition flat op_defs array to a target callback, Richard Henderson, 2017/01/10