L.S.,
This code:
SUBROUTINE S(A, B, N)
DIMENSION A(N), B(N)
READ*,Z,B
DO I = 1, N
A(I) = Z * B(I)
ENDDO
PRINT*,A
END
when compiled thusly:
$ gfortran -g -S -O3 -ftree-vectorize -ftree-vectorizer-verbose=2 -msse2 vect2.f
draws the following "not vectorized" message:
vect2.f:4: note: not vectorized: unhandled data-ref
vect2.f:4: note: vectorized 0 loops in function.
Hmmm, how about broadcasting Z to a vector register and using that in a
vectorized version of this loop :-) ?
Kind regards,
--
Toon Moene - e-mail: [EMAIL PROTECTED] - phone: +31 346 214290
Saturnushof 14, 3738 XG Maartensdijk, The Netherlands
A maintainer of GNU Fortran 95: http://gcc.gnu.org/fortran/