This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: patch, libfortran: Speedup for unpack intrinsic


Thomas Koenig wrote:
Hello world,

here is a speedup patch for the unpack intrinsic, with
a speedup that's quite OK:

$ cat unpack-speed.f90 program main
integer, parameter:: n = 100
integer :: i
real, dimension(n*n) :: vect
real, dimension(n,n) :: a,b
logical(kind=1), dimension(n,n) :: mask
call random_number(a)
mask = a > 0.5
call random_number(b)
call random_number(vect)
do i=1,10000
a = unpack(vect,mask,0.)
end do
end program main
$ gfortran -static -O3 unpack-speed.f90 $ time ./a.out


real 0m1.064s
user 0m1.048s
sys 0m0.000s
$ gfortran-4.3 -static -O3 unpack-speed.f90 $ time ./a.out


real	0m2.772s
user	0m2.760s
sys	0m0.000s

Regression-tested on i686-pc-linux-gnu.  I'll ask Dominique in a
separate E-Mail to cross-check this for me (although I did try
to be more careful this time :-)

OK once this has passed cross-check?


Yes OK after cross check,


Jerry


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]