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 9E6733F477 for ; Wed, 11 Sep 2002 15:08:42 -0400 (EDT) Received: (from mail@localhost) by int-mx1.corp.redhat.com (8.11.6/8.11.6) id g8BJ8bD14913 for axp-list@listman.redhat.com; Wed, 11 Sep 2002 15:08:37 -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 g8BJ8bk14909 for ; Wed, 11 Sep 2002 15:08:37 -0400 Received: from snowball.ucd.ie (snowball.ucd.ie [193.1.132.97]) by mx1.redhat.com (8.11.6/8.11.6) with SMTP id g8BIq8w22127 for ; Wed, 11 Sep 2002 14:52:09 -0400 Received: from genie.ucd.ie ([193.1.132.80]:50446 "EHLO genie.ucd.ie") by snowball.ucd.ie with ESMTP id ; Wed, 11 Sep 2002 20:08:07 +0100 Received: by genie.ucd.ie with local (Exim 3.12 #1 (Debian)) id 17pCqM-0002uZ-00 for ; Wed, 11 Sep 2002 20:08:06 +0100 Date: Wed, 11 Sep 2002 20:05:26 +0100 From: Nikita Schmidt To: axp-list@redhat.com Subject: Re: Alpha Optimization Message-ID: <20020911200526.B10564@cnds.ucd.ie> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20020911053348.GA23706@zib.de> User-Agent: Mutt/1.3.18i Resent-From: cetus@cnds.ucd.ie Resent-Date: Wed, 11 Sep 2002 20:08:06 +0100 Resent-To: axp-list@redhat.com Resent-Message-Id: 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 List-Help: List-Post: List-Subscribe: , List-Id: Linux and Red Hat on Alpha processors List-Unsubscribe: , List-Archive: On Tuesday, 10 Sep, Rui-Tao Dong wrote: > 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. 64K is a lot for a lookup table and will definitely cause on-chip cache thrashing. It is often faster to compute than to look up. I don't know how fast multiplication is on EV68, but there is a slim chance that performance can be improved by replacing the division table with a table of inverted values of B (scaled to be integer - say, 2^24/B) and multiplying A by pTab[B] in the loop. The table will shrink to 1 KB, hopefully letting enough space in the cache for the other buffers. > I tried both gcc -O6 and ccc -O3. Try ccc -fast and gcc -mcpu=ev67 (or -mcpu=ev6 if using gcc 2) -O6. This will utilise more efficient byte loads available in EV6. On Tuesday, 10 Sep, Chris Eleveld wrote: > To avoid unaligned accesses flatten the array out to 64 bit longs. > Either using bit shifting or as a larger array. I believe single byte > accesses are the worst on alpha but I could be wrong. Single byte reads were not too bad even in the original Alpha architecture - hardly worse than bit shifting or byte extraction written in a high level language. They were indeed slower than 32 and 64 bit loads. Byte writes were pretty expensive though. EV6 has instructions for single byte load/store. > Also there should > be some architecture switches to take advantage oft EV68 instructions > for dealing with bytes. I think. Yes, you are right. Nikita