[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH RFC 8/9] tcg/optimize: do not simplify size chan
From: |
Aurelien Jarno |
Subject: |
Re: [Qemu-devel] [PATCH RFC 8/9] tcg/optimize: do not simplify size changing moves |
Date: |
Sat, 18 Jul 2015 23:19:17 +0200 |
User-agent: |
Mutt/1.5.23 (2014-03-12) |
On 2015-07-18 08:24, Richard Henderson wrote:
> On 07/17/2015 11:33 AM, Aurelien Jarno wrote:
> >For now I do wonder if we shouldn't get the size changing extu/exts
> >mandatory instead of reusing the 64-bit only version. This doesn't
> >change the generated code, at least on x86.
>
> I'd be surprised if it did anywhere. I don't mind starting with them being
> required, and then figuring out a way to optimize.
I have a patch series ready for that if you want I can post it as RFC.
That said looking more deeply into the problem you found I guess we can
solve that easily by using the same convention than the real CPU for
storing 32-bit constants in the TCG optimizer.
This roughly means the following code for the 32-bit ops:
/* 32-bit ops generate 32-bit results. */
if (!(def->flags & TCG_OPF_64BIT)) {
if (!TCG_TARGET_HAS_ext_i32_i64) {
/* registers are maintained sign-extended */
mask = (int32_t)mask;
affected = (int32_t)mask;
} else if (!TCG_TARGET_HAS_extu_i32_i64) {
/* registers are maintained zero-extended */
mask = (uint32_t)mask;
affected = (uint32_t)mask;
} else {
/* high bits will be computed by ext/extu_i32_i64 */
mask = (uint32_t)mask;
affected = (uint32_t)mask;
}
}
And that would be fine for my patch series in preparation, as long as I
can predict the high part instead of considering it as garbage.
--
Aurelien Jarno GPG: 4096R/1DDD8C9B
address@hidden http://www.aurel32.net
- Re: [Qemu-devel] [PATCH RFC 2/9] tcg: don't abuse TCG type in tcg_gen_trunc_shr_i64_i32, (continued)
[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, 2015/07/15
[Qemu-devel] [PATCH RFC 6/9] tcg/i386: document the way 32/64-bit conversions are handled, Aurelien Jarno, 2015/07/15