[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 3/3] tcg/arm: improve constant loading
From: |
andrzej zaborowski |
Subject: |
Re: [Qemu-devel] [PATCH 3/3] tcg/arm: improve constant loading |
Date: |
Fri, 7 Jan 2011 13:52:25 +0100 |
Hi,
On 6 January 2011 22:54, Aurelien Jarno <address@hidden> wrote:
> Improve constant loading in two ways:
> - On all ARM versions, it's possible to load 0xffffff00 = -0x100 using
> the mvn rd, #0. Fix the conditions.
> - On <= ARMv6 versions, where movw and movt are not available, load the
> constants using mov and orr with rotations depending on the constant
> to load. This is very useful for example to load constants where the
> low byte is 0. This reduce the generated code size by about 7%.
That's a nice improvement. For some instructions using MVN and AND
could yield even shorter code and I think with that the optimisation
options (except loading from a constant pool) would be exhausted :)
...
> }
> + } else {
> + int opc = ARITH_MOV;
> + int rn = 0;
> +
> + do {
> + int i, rot;
> +
> + i = ctz32(arg) & ~1;
> + rot = ((32 - i) << 7) & 0xf00;
> + tcg_out_dat_imm(s, cond, opc, rd, rn, ((arg >> i) & 0xff) | rot);
> + arg &= ~(0xff << i);
> +
> + opc = ARITH_ORR;
> + rn = rd;
I think you could get rid of rn and just use rd from the start of the
loop. Otherwise acked by me too.
Best regards
- [Qemu-devel] [PATCH 1/3] tcg/arm: fix branch target change during code retranslation, Aurelien Jarno, 2011/01/06
- [Qemu-devel] [PATCH 2/3] tcg/arm: fix qemu_st64 for big endian targets, Aurelien Jarno, 2011/01/06
- [Qemu-devel] [PATCH 3/3] tcg/arm: improve constant loading, Aurelien Jarno, 2011/01/06
- Re: [Qemu-devel] [PATCH 3/3] tcg/arm: improve constant loading,
andrzej zaborowski <=
- Re: [Qemu-devel] [PATCH 3/3] tcg/arm: improve constant loading, andrzej zaborowski, 2011/01/07
- Re: [Qemu-devel] [PATCH 3/3] tcg/arm: improve constant loading, Aurelien Jarno, 2011/01/07
- Re: [Qemu-devel] [PATCH 3/3] tcg/arm: improve constant loading, andrzej zaborowski, 2011/01/07
- Re: [Qemu-devel] [PATCH 3/3] tcg/arm: improve constant loading, Aurelien Jarno, 2011/01/09
- Re: [Qemu-devel] [PATCH 3/3] tcg/arm: improve constant loading, andrzej zaborowski, 2011/01/09
- Re: [Qemu-devel] [PATCH 3/3] tcg/arm: improve constant loading, Peter Maydell, 2011/01/09
Re: [Qemu-devel] [PATCH 1/3] tcg/arm: fix branch target change during code retranslation, Edgar E. Iglesias, 2011/01/07