delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/03/01/12:24:58

From: Bob Kematick <rjkematick AT postoffice DOT worldnet DOT att DOT net>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Netlib code [was Re: flops...]
Date: Sat, 01 Mar 1997 08:19:59 -0500
Organization: My House
Lines: 52
Message-ID: <33182CFF.40CB@postoffice.worldnet.att.net>
References: <Pine DOT LNX DOT 3 DOT 91 DOT 970226105830 DOT 29585A-100000 AT lenny DOT dseg DOT ti DOT com> <rzqvi7d6j83 DOT fsf AT djlvig DOT dl DOT ac DOT uk>
NNTP-Posting-Host: 207.116.44.178
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Dave Love wrote:
> 

Dave> I can't show DJGPP G77 o/p at present, but assume the generated code
Dave> would be the same as this.  (On 586 and especially on ppro, the speed
Dave> will actually be determined by how your double words happen to get
Dave> aligned, sigh.)
> 
> $ cat a.f
>       subroutine gemm(m, n, k, a, b, c)
>       integer i,m,n,k,l,j
>       double precision a(n,m),  b(n,m),  c(n,m)
>       do i=1,m     ! poor for illustration only
>         do l=1,k
>           do j=1,n
>             c(j,i) = c(j,i) + a(l,i)*b(j,l)
>           end do
>         end do
>       end do
>       end


I ran Dave's example through g77 for DJGPP , the assembler code produced is
indeed the same  ...


> $ g77 -S -O2 -v a.f
> g77 version 0.5.19.1
>  gcc -S -O2 -v -xf77 a.f
> Reading specs from /usr/lib/gcc-lib/i486-unknown-linux/2.7.2.1.f.1/specs
> gcc version 2.7.2.1.f.1
>  /usr/lib/gcc-lib/i486-unknown-linux/2.7.2.1.f.1/f771 a.f -fset-g77-defaults -qu
> iet -dumpbase a.f -O2 -version -fversion -o a.s
> GNU F77 version 2.7.2.1.f.1 (i386 Linux/ELF) compiled by GNU C version 2.7.2.1.f
> .1.
> GNU Fortran Front End version 0.5.19.1 compiled: Feb  1 1997 19:51:03
> $ more +/L13 a.s
> 
> ...skipping
>         addl 24(%ebp),%eax
>         .align 4
> .L13:
>         movl -24(%ebp),%edi
>         fldl (%edi)
>         fmull (%eax)
>         faddl (%edx)
>         fstpl (%edx)
>         addl $8,%eax
>         addl $8,%edx
>         decl %ecx
>         jns .L13
> .L8:

- Raw text -


  webmaster     delorie software   privacy  
  Copyright 2019   by DJ Delorie     Updated Jul 2019