Subject: Re: good old 604e and perfomance issues
To: Riccardo Mottola <rollei@tiscalinet.it>
From: Michael <macallan18@earthlink.net>
List: port-macppc
Date: 06/24/2005 12:58:20
--Signature_Fri__24_Jun_2005_12_58_20_-0400_7PK/vmHAKdOZomzB
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable

Hello,

> my 9500 go an upgrade bump. That is a G4 card... Of course the
> engineering curiosity was to benchmark "before and after". ANd I used
my
> typical matmul and fft benchmarks, I just made then a bit bigger so
they
> run longer.
> The result? the 604e 200Mhz is damn fast :)

Heh, we told you ;)

> NetBSD reports the g4 to run at 400Mhz, macos 8.6 reports an unkown
> processor at 450Mhz and I alm almost sure the card is a 450 or a
500mhz.
> (got it used, so no box, sorry). It should have a 1Mb cache but netbsd
> doesn't report it. Maybe it is correct for backside caches? (the 604ev
> card does the same in the 9600)

Download NewerTech's cache setup utility, it's pretty likely to work
with this card and lets you play with cache settings so you can figure
out what's going on ( MacOS required of course ). Then you'll probably
have to do the =20
options L2CR_CONFIG=3D"(L2SIZ_1M|L2CLK_20|L2RAM_PIPELINE_BURST)"=20
ritual ( of course with something matching your card - this one is for
my G3 ).

> cpu0 at mainbus0: 7400 (Revision 2.7), ID 0 (primary)
> cpu0: HID0 8294c0a4<EMCP,ECLK,DOZE,DPM,EIEC,ICE,DCE,SGE,BTIC,BHT>
> cpu0: 409.10 MHz

Yep, looks like NetBSD needs help to recognize the cache. And your bus
speed seems to be less than 50 MHz for some reason.

> here are my results.
> I compiled -O2, -O3 and -O2 with the cpu model (-mcpu=3D604 or 7400).
> then I did also -O2 -mcpu=3D7400 -m-no-altivec (and -maltivec) just to
> go on the safe side.
>=20
> benchmarks
>=20
> NetBSD 2, gcc 3.3.3
>=20
> ppc 604e, 200Mhz, 512K cache on board
>=20
> matmul-double
> -O2            2.38
> -O3            2.42
> -O2 -mcpu=3D604  2.33
>=20
> matmul-float
> -O2            2.01
> -O3            2.14
> -O2 -mcpu=3D604  1.59
>=20
> fft
> -O2            0.10.89
> -O3            0.10.69
> -O2 -mcpu=3D604  0.7.55
>=20
>=20
> ppc 7400, 410Mhz (?),=20
>=20
> matmul-double
> -O2            2.41
> -O3            2.50
> -O2 -mcpu=3D7400 2.35
> same (no-alti) 3.01
> (altivec)      2.38
>=20
> matmul-float
> -O2            0.29.89
> -O3            0.30.18
> -O2 -mcpu=3D7400 0.27.95
> same (no-alti) 0.28.99
> (altivec)      0.30.11
>=20
> fft
> -O2            0.5.99
> -O3            0.6.05
> -O2 -mcpu=3D7400 0.6.85
> same (no-alti) 0.6.23
> (altivec)      0.6.17
>=20
> not exacly exciting, right?

Well, the G4 will suffer from lack of L2 cache.=20

> FFT uses double registers.

That's exactly what the 604e does best ( and where it wipes the floor
with the G3 )

> I gather that the G4 sucks at double, being only marginally faster
> than the 604e which is clocked at half the cpu speed. float speed is
> indeed faster. Altivec doesn't seem to affect my tests.

-maltivec only enables some C extensions and assembler instructions to
use the AltiVec unit, gcc can't produce AltiVec-code on it's own ( and
it would be single-precision only anyway )

> Can there be netbsd problems? netbsd related settings that affect cpu
> performance? clockspeed? I have absolutely no experience wih cpu
> upgrades and this is my one and only G4 :)

Yes, yes, maybe. NetBSD doesn't report any L2 cache so there's likely
none in use which explains the G4's abysmal performance. The G4 will
probably be a little slower than the 604e at the same clockspeed in raw,
double precision floatpoint speed. ( the core is faster but the bus
isn't so it won't scale in a linear way. Anything that benefits form a
fast L2 cache will of course be faster than that )
Remember this?
http://mail-index.NetBSD.org/port-macppc/2005/03/14/0002.html

Not quite the same but it should give you an idea what kind of
floatpoint performance to expect.

have fun
Michael

--Signature_Fri__24_Jun_2005_12_58_20_-0400_7PK/vmHAKdOZomzB
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (NetBSD)

iQEVAwUBQrw7rMpnzkX8Yg2nAQKx0gf8D/YHG+eXwNwCuOHcGQpweIdUrrlDTCpO
tToInDmDrY+EJWgy0b2P7N9qa4D7QPF+vY2rb9P1IXX/hM0GcpiHWhK4wEakLqW2
pn0CybctAYydNMY2rATwAsQ+oUcPFx4qu0N0GQWBiQrK9yxFQiYxo7g1hkK6ZGfS
1ChKtEuC6VitAjdm6yWROaOKRJyGZPk89MEEGZ4cu06+AvAHGyn4S0TzBvIRvP10
QJc6VYL7E1vv+VEo/FRe/vfwXcfxSqKlhBiNlR9oakiTNdoK64ESNdKMb+pj1Vha
awNTh1/sDEpYOMldfv8J80ObJYvoy8ZnAmBAMevm5qZ5kYd/UKAtgA==
=1lRL
-----END PGP SIGNATURE-----

--Signature_Fri__24_Jun_2005_12_58_20_-0400_7PK/vmHAKdOZomzB--