A bit of vector extension documentation

Toon Moene toon@moene.indiv.nluug.nl
Fri Sep 28 12:11:00 GMT 2001


Diego Novillo wrote:

> On Fri, 28 Sep 2001, David Edelsohn wrote:

> >       I thought the point of the paper is that it is a generalization
> > that does not require loops.  For SIMD, as opposed to vector,
> > architectures, it might be better because it can take advantage of such
> > instructions without the loop setup overhead.
> >
> Yes, the paper does not attempt to design a vectorizing compiler.
> It merely points out that in several cases you can get away with
> converting sequence of expressions into SIMD instructions.  They
> do have the limitation of working on single basic blocks, though.

Hmmm, wouldn't that already help on most of the interesting Fortran
loops, when unrolled (i.e., when "converting sequences of expressions
into SIMD instructions" is performed after loop unrolling) ?

Consider

      DO I = 1, N
         A(I) = B(I) + C(I)
      ENDDO

and its unrolled cousin

      DO I = 1, N, 4
         A(I+0) = B(I+0) + C(I+0)
         A(I+1) = B(I+1) + C(I+1)
         A(I+2) = B(I+2) + C(I+2)
         A(I+3) = B(I+3) + C(I+3)
      ENDDO

Certainly the loop body in both examples is a single basic block.

-- 
Toon Moene - mailto:toon@moene.indiv.nluug.nl - phoneto: +31 346 214290
Saturnushof 14, 3738 XG  Maartensdijk, The Netherlands
Maintainer, GNU Fortran 77: http://gcc.gnu.org/onlinedocs/g77_news.html
Join GNU Fortran 95: http://g95.sourceforge.net/ (under construction)



More information about the Gcc-patches mailing list