From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by listman.redhat.com (Postfix) with ESMTP id 39F783F0FD for ; Wed, 11 Sep 2002 01:33:57 -0400 (EDT) Received: (from mail@localhost) by int-mx1.corp.redhat.com (8.11.6/8.11.6) id g8B5XqV25174 for axp-list@listman.redhat.com; Wed, 11 Sep 2002 01:33:52 -0400 Received: from mx1.redhat.com (mx1.redhat.com [172.16.48.31]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with SMTP id g8B5Xpk25169 for ; Wed, 11 Sep 2002 01:33:51 -0400 Received: from mailer.zib.de (mailer.zib.de [130.73.108.11]) by mx1.redhat.com (8.11.6/8.11.6) with SMTP id g8B5HQw05444 for ; Wed, 11 Sep 2002 01:17:27 -0400 Received: from mailsrv2.zib.de (mailsrv2 [130.73.121.11]) by mailer.zib.de (8.10.2+Sun/8.10.2) with ESMTP id g8B5XnL25198 for ; Wed, 11 Sep 2002 07:33:49 +0200 (MET DST) Received: from opts1.zib.de (opts1.zib.de [130.73.74.1]) by mailsrv2.zib.de (8.10.2+Sun/8.9.1) with ESMTP id g8B5Xn806260 for ; Wed, 11 Sep 2002 07:33:49 +0200 (MET DST) Received: from opt47.zib.de (opt47.zib.de [130.73.75.47]) by opts1.zib.de (8.10.2+Sun/8.9.1) with ESMTP id g8B5XmB09496 for ; Wed, 11 Sep 2002 07:33:48 +0200 (MET DST) Received: from opt47.zib.de (LOCALHOST [127.0.0.1]) by opt47.zib.de (8.12.3/8.12.3/SuSE Linux 0.6) with ESMTP id g8B5XmKd023768 for ; Wed, 11 Sep 2002 07:33:48 +0200 Received: (from bzfkocht@localhost) by opt47.zib.de (8.12.3/8.12.3/Submit) id g8B5XmOw023767 for axp-list@redhat.com; Wed, 11 Sep 2002 07:33:48 +0200 Date: Wed, 11 Sep 2002 07:33:48 +0200 From: Thorsten Koch To: axp-list@redhat.com Subject: Re: Alpha Optimization Message-ID: <20020911053348.GA23706@zib.de> Mail-Followup-To: axp-list@redhat.com References: Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.3.27i X-MIME-Autoconverted: from 8bit to quoted-printable by mailer.zib.de id g8B5XnL25198 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by int-mx1.corp.redhat.com id g8B5Xpk25169 X-Loop: axp-list@redhat.com Sender: axp-list-admin@redhat.com Errors-To: axp-list-admin@redhat.com X-BeenThere: axp-list@redhat.com X-Mailman-Version: 2.0.1 Precedence: bulk Reply-To: axp-list@redhat.com X-Reply-To: koch@zib.de List-Help: List-Post: List-Subscribe: , List-Id: Linux and Red Hat on Alpha processors List-Unsubscribe: , List-Archive: Hello, first this look like something that could use SSE Instruction on a P4, so with the intel compiler or asm this may get much faster on the P4. Then it's all integer, something where the P4 is quite good at, especially as you don't need to hold a lot of values in regsters here. And you work on bytes, something that disables the biggest advantage of the alpha, namely the possibility to manipulate 64 bits at a time. So it's kind of a one-legged race, and since the P4 is build from the start one-legged, it excells. For the alpha, you should enlarge everything to ints. As far as I have tested, with current compilers, it is not a goog idea to convert all accesses to pointers, Just do pN[c] or something like that. The compilers have more change to do anything with this kind of expression. To really speed things up, you have to stuff 4 entries in a long and do this at ones. But this needes some serious bit fiddling. Regards, Thorsten On Tue, Sep 10, 2002 at 04:55:49PM -0700, Rui-Tao Dong wrote: > > I haven't seen much traffic on the list for while. Here is a question > for you guys. > > I am trying to divide two 8 bit images (A*256/B) as fast as possible. > I built a lookup table of all possible combinations of A & B (64KB) > and do the lookup on the images. On a 2.0GHz P4, it takes about > 28msec on a 1280x1024x24 images. On the 1.0GHz ev68 (at Compaq > testdrive), it takes about 57msec, which is very disappointing. I was > expecting the Alpha to be much faster due to its larger L1 cache and > faster memory IO. The relevant code is below. I tried both gcc -O6 > and ccc -O3. > > pTab is the pre-constructed 256x256 lookup table, with numerator as > the row index and denominator as the column index. > > typedef unsigned char pixel8; > > for (l=0; l<100; ++l) > { > pixel8* pOut = output_buf; > const pixel8* pN = input_buf; > const pixel8* pD = white_buf; > int r; > > for (r=0; r< HEIGHT; ++r) > { > int c; > for (c=0; c< WIDTH*3; ++c) > { > int i = ((*pN)<<8) + (*pD); > *pOut = pTab[i]; > ++pN; > ++pD; > ++pOut; > } > } > } > > Any idea? > > Regards, > > -- > > Dr. Rui-Tao Dong Aria Systems, Inc. > (949)291-XXXX(Cell) P. O. Box 52123 > rdong@cox.net Irvine, CA 92619 > > > > _______________________________________________ > Axp-list mailing list > Axp-list@redhat.com > https://listman.redhat.com/mailman/listinfo/axp-list -- "They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." -- Benjamin Franklin, 1759 ___________________________________________________ Thorsten Koch / Konrad-Zuse-Zentrum für Informationstechnik Berlin koch@zib.de / Takustraße 7, 14195 Berlin-Dahlem, Germany ______________/ Phone +49-30-84185-213, Fax -269