This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Vectorizing my loops. Some problems.
- From: Øystein Johansen <oystein at gnubg dot org>
- To: gcc at gcc dot gnu dot org
- Date: Fri, 15 Apr 2005 23:55:30 +0200
- Subject: Vectorizing my loops. Some problems.
Hi,
I just started to work on some loop vectorizing for my project. Some
weeks ago I got a snapshot of GCC-4.1-20050313. It compiled my code but
I was not able to get the auto-vectorization working. (Yes, I understand
why)
I decided to try sse intrinsics (X86 Built-in Functions as the manual
says) instead of auto-vectorization.
I wrote some lines:
typedef int v4sf __attribute__ ((mode(V4SF)));
typedef union _vec4f {
v4sf v;
float f[4];
} vec4f;
Blah bla
for( j = 32; j ; j--, prW += 4, pr += 4 ){
vec0 = __builtin_ia32_loadups(pr);
vec1 = __builtin_ia32_loadups(prW);
vec3 = __builtin_ia32_mulps(vec0, vec1);
sum.v = __builtin_ia32_addps(sum.v, vec3);
}
and this works fine when I compile with GCC 3.4.2
However... If I try to compile this with the GCC 4.1 snapshot I get
errors and warnings:
/msys/1.0/local/bin/gcc.exe -O3 -msse -Wall -DHAVE_CONFIG_H -I. -I..
-c -o neuralnet.o neuralnet.c
neuralnet.c:447: warning: specifying vector types with __attribute__
((mode)) is deprecated
neuralnet.c:447: warning: use __attribute__ ((vector_size)) instead
neuralnet.c:447: error: mode 'V4SF' applied to inappropriate type
neuralnet.c: In function 'Evaluate':
neuralnet.c:510: error: incompatible type for argument 1 of
'__builtin_ia32_xorps'
neuralnet.c:510: error: incompatible type for argument 2 of
'__builtin_ia32_xorps'
neuralnet.c:510: error: incompatible types in assignment
neuralnet.c:512: error: incompatible types in assignment
neuralnet.c:513: error: incompatible types in assignment
neuralnet.c:514: error: incompatible type for argument 1 of
'__builtin_ia32_mulps'
neuralnet.c:514: error: incompatible type for argument 2 of
'__builtin_ia32_mulps'
neuralnet.c:514: error: incompatible types in assignment
neuralnet.c:515: error: incompatible type for argument 1 of
'__builtin_ia32_addps'
neuralnet.c:515: error: incompatible type for argument 2 of
'__builtin_ia32_addps'
neuralnet.c:515: error: incompatible types in assignment
make: *** [neuralnet.o] Error 1
So... from when was __attribute__ ((mode)) deprecated? How do I declear
the v4sf vector type?
Will the right declaration of v4sf type fix the incompatible type in
assignment and argument problems?
Thanks for any help!
-Øystein