Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
From: Nikita Schmidt <cetus@snowball.ucd.ie>
To: axp-list@redhat.com
Subject: Re: Alpha Optimization
Date: Wed, 11 Sep 2002 20:05:26 +0100	[thread overview]
Message-ID: <20020911200526.B10564@cnds.ucd.ie> (raw)
In-Reply-To: <20020911053348.GA23706@zib.de> <!~!UENERkVCMDkAAQACAAAAAAAAAAAAAAAAABgAAAAAAAAARfEe0Y0eQUKjlPmEPZTXU8KAAAAQAAAAIq1TLKvYOk67BdW/dlHvkwEAAAAA@sector7.com> <v53cshs8l6.fsf@Playmate.dfc>

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




  parent reply	other threads:[~2002-09-11 19:08 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-09-10 23:55 Alpha Optimization Rui-Tao Dong
2002-09-11  2:16 ` Chris Eleveld
2002-09-11  5:33 ` Thorsten Koch
2002-09-11 19:05 ` Nikita Schmidt [this message]
  -- strict thread matches above, loose matches on Subject: below --
2002-09-11 14:41 Donsbach, Jeff
2002-09-11 14:53 Block, Kenneth
2002-09-11 15:54 ` Rui-Tao Dong
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox