------- Comment #2 from changpeng dot fang at amd dot com  2010-02-26 00:28 
-------
Subject: RE:  gcc could not vectorize floating point
 reduction statements

Thanks for pointing this out. Actually I am working on a fortran program and
found the
the reduction statement.  The fortran code can not be vectorized even with
-ffast-math.
Do you think this is the problem of fortran frontend? Thanks, -- Changpeng

c%3.1
      subroutine s311 (ntimes,ld,n,ctime,dtime,a,b,c,d,e,aa,bb,cc)
c
c     reductions
c     sum reduction
c
      integer ntimes, ld, n, i, nl
      double precision a(n), b(n), c(n), d(n), e(n), aa(ld,n),
     +                 bb(ld,n), cc(ld,n)
      double precision chksum, sum
      real t1, t2, second, ctime, dtime

      call init(ld,n,a,b,c,d,e,aa,bb,cc,'s311 ')
      t1 = second()
      do 1 nl = 1,ntimes
      sum = 0.d0
      do 10 i = 1,n
         sum = sum + a(i)
  10  continue
      call dummy(ld,n,a,b,c,d,e,aa,bb,cc,sum)
  1   continue
      t2 = second() - t1 - ctime - ( dtime * float(ntimes) )
      chksum = sum
      call check (chksum,ntimes*n,n,t2,'s311 ')
      return
      end



________________________________________
From: pinskia at gcc dot gnu dot org [gcc-bugzi...@gcc.gnu.org]
Sent: Thursday, February 25, 2010 5:57 PM
To: Fang, Changpeng
Subject: [Bug middle-end/43184] gcc could not vectorize floating point
reduction statements

------- Comment #1 from pinskia at gcc dot gnu dot org  2010-02-25 23:57
-------
>gcc 4.5 could not vectorize floating point reductions.

Yes it can; add -ffast-math.  floating point reductions need -ffast-math as it
can change the results in some cases (negative zero and I think clamping cases
too).


--

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |INVALID


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43184

------- You are receiving this mail because: -------
You reported the bug, or are watching the reporter.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43184

Reply via email to