From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111c93,37ab7eb89916c06 X-Google-Attributes: gid111c93,public From: Murx Subject: Re: Compaq is sitting on a goldmine now that Linux is taking of Date: 1998/11/26 Message-ID: <365DA16B.DDDF2688@theo1.physik.uni-stuttgart.de>#1/1 X-Deja-AN: 415968990 Content-Transfer-Encoding: 7bit References: <73k5gf$imn$1@infosun2.rus.uni-stuttgart.de> Content-Type: text/plain; charset=us-ascii Organization: InterNetNews at News.BelWue.DE (Stuttgart, Germany) Mime-Version: 1.0 Reply-To: chrisi@theo1.physik.uni-stuttgart.de Newsgroups: comp.os.linux.alpha c.simmendinger@dlr.de wrote: > The major bummer in this matrix multiply is memory access > kap dealt with this quite reasonably. Kap came up with this loop_unroll: subroutine MATMUL ( A, B, C, N ) real A(N,N), B(N,N), C(N,N) integer N integer KII3, KII2, KII1 do I=1,N do J=1,N A(I,J) = 0. KII2 = N - 7 KII3 = (KII2 + 7) / 8 KII1 = KII3 * 8 + 1 do K=1,KII2,8 A(I,J) = A(I,J) + B(I,K) * C(K,J) A(I,J) = A(I,J) + B(I,K+1) * C(K+1,J) A(I,J) = A(I,J) + B(I,K+2) * C(K+2,J) A(I,J) = A(I,J) + B(I,K+3) * C(K+3,J) A(I,J) = A(I,J) + B(I,K+4) * C(K+4,J) A(I,J) = A(I,J) + B(I,K+5) * C(K+5,J) A(I,J) = A(I,J) + B(I,K+6) * C(K+6,J) A(I,J) = A(I,J) + B(I,K+7) * C(K+7,J) end do do K=KII1,N,1 A(I,J) = A(I,J) + B(I,K) * C(K,J) end do end do end do return end Have to admit i never considered using the KAP of this RS 6000 (wasn't even aware we actually have this) so i'd think KAP can even do better, since this was just a first clumsy test. Maybe it's actually capable of blocking ? Dunno ? Murx