This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [lno] [patch] vectorizer update - support constants.
- From: Falk Hueffner <falk dot hueffner at student dot uni-tuebingen dot de>
- To: Dorit Naishlos <DORIT at il dot ibm dot com>
- Cc: gcc-patches at gcc dot gnu dot org, pop at gauvain dot u-strasbg dot fr,Richard Henderson <rth at redhat dot com>
- Date: 21 Jan 2004 19:56:20 +0100
- Subject: Re: [lno] [patch] vectorizer update - support constants.
- References: <OF1D63EAD1.0C39EF96-ONC2256E22.004210E9-C2256E22.0045EBF3@il.ibm.com>
Dorit Naishlos <DORIT@il.ibm.com> writes:
> * Support for vectorization of constants (e.g, computations of the form
> a[i]=5).
I've tried this on Alpha, with setting NITS_PER_SIMD_WORD to 8. First,
it looks like iteration count recognition is off by one:
short a[128];
void f() {
int i;
for (i = 0; i < 128; i++)
a[i] = 0;
}
vectorization_factor = 4, niters = 127
loop bound unknown or doesn't divide by 4
I cheated and used 129. Then vectorization worked, but the code was
not quite optimal. In the unvectorized version, I get:
8: 03 04 ff 47 clr t2
c: 00 00 5d a4 ldq t1,0(gp)
c: ELF_LITERAL a
10: 03 30 60 40 addl t2,0x1,t2
14: 00 00 e2 37 stw zero,0(t1)
18: 02 00 42 20 lda t1,2(t1)
1c: a1 fd 6f 40 cmple t2,0x7f,t0
20: fb ff 3f f4 bne t0,10 <f+0x10>
i.e. the IV is not being used for address calculation, however in the
vectorized version
8: 04 04 ff 47 clr t3
c: 03 04 ff 47 clr t2
10: 00 00 bd a4 ldq t4,0(gp)
10: ELF_LITERAL a
14: 00 00 fe 2f unop
18: 1f 04 ff 47 nop
1c: 00 00 fe 2f unop
20: 46 16 80 40 s8addq t3,0,t5
24: a2 f7 63 40 cmpule t2,0x1f,t1
28: 04 30 80 40 addl t3,0x1,t3
2c: 03 30 60 40 addl t2,0x1,t2
30: 20 f6 c1 48 zapnot t5,0xf,v0
34: 01 04 05 40 addq v0,t4,t0
38: 00 00 e1 b7 stq zero,0(t0)
3c: f8 ff 5f f4 bne t1,20 <f+0x20>
it is (even duplicated), which is less efficient. Is this a know
problem?
--
Falk