[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH RFC 4/9] tcg/optimize: add optimizations for ext_i32
From: |
Aurelien Jarno |
Subject: |
[Qemu-devel] [PATCH RFC 4/9] tcg/optimize: add optimizations for ext_i32_i64 and extu_i32_i64 ops |
Date: |
Wed, 15 Jul 2015 13:03:14 +0200 |
They behave the same as ext32s_i64 and ext32u_i64 from the constant
folding and zero propagation point of view, except that they can't
be replaced by a mov, so we don't compute the affected value.
Cc: Paolo Bonzini <address@hidden>
Cc: Richard Henderson <address@hidden>
Signed-off-by: Aurelien Jarno <address@hidden>
---
tcg/optimize.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/tcg/optimize.c b/tcg/optimize.c
index d66373d..18b7bc3 100644
--- a/tcg/optimize.c
+++ b/tcg/optimize.c
@@ -347,9 +347,11 @@ static TCGArg do_constant_folding_2(TCGOpcode op, TCGArg
x, TCGArg y)
CASE_OP_32_64(ext16u):
return (uint16_t)x;
+ case INDEX_op_ext_i32_i64:
case INDEX_op_ext32s_i64:
return (int32_t)x;
+ case INDEX_op_extu_i32_i64:
case INDEX_op_ext32u_i64:
return (uint32_t)x;
@@ -839,6 +841,14 @@ void tcg_optimize(TCGContext *s)
mask = temps[args[1]].mask & mask;
break;
+ case INDEX_op_ext_i32_i64:
+ if ((temps[args[1]].mask & 0x80000000) != 0) {
+ break;
+ }
+ case INDEX_op_extu_i32_i64:
+ mask = (uint32_t)temps[args[1]].mask;
+ break;
+
CASE_OP_32_64(andc):
/* Known-zeros does not imply known-ones. Therefore unless
args[2] is constant, we can't infer anything from it. */
--
2.1.4
- Re: [Qemu-devel] [PATCH RFC 1/9] tcg: rename trunc_shr_i32 into trunc_shr_i64_i32, (continued)
- [Qemu-devel] [PATCH RFC 3/9] tcg: implement real ext_i32_i64 and extu_i32_i64 ops, Aurelien Jarno, 2015/07/15
- [Qemu-devel] [PATCH RFC 5/9] tcg/i386: implement ext_i32_i64 and extu_i32_i64 ops, Aurelien Jarno, 2015/07/15
- [Qemu-devel] [PATCH RFC 8/9] tcg/optimize: do not simplify size changing moves, Aurelien Jarno, 2015/07/15
- [Qemu-devel] [PATCH RFC 7/9] tcg: replace ext/u_i32_i64 by a mov when not implemented, Aurelien Jarno, 2015/07/15
- [Qemu-devel] [PATCH RFC 9/9] tcg: update README about size changing ops, Aurelien Jarno, 2015/07/15
- [Qemu-devel] [PATCH RFC 4/9] tcg/optimize: add optimizations for ext_i32_i64 and extu_i32_i64 ops,
Aurelien Jarno <=
- [Qemu-devel] [PATCH RFC 6/9] tcg/i386: document the way 32/64-bit conversions are handled, Aurelien Jarno, 2015/07/15