Mail Archives: pgcc/2000/02/29/17:30:38
--GvXjxJ+pjyke8COw
Content-Type: text/plain; charset=us-ascii
On Thu, Feb 24, 2000 at 08:51:43PM -0800, Linda Walsh wrote:
> I dump the assembly code and get these results on SuSE:
> Reading specs from /usr/lib/gcc-lib/i486-linux/egcs-2.91.66/specs
> gcc version egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)
There is no need specify the distributions. Relevant information is gcc
(pgcc,egcs) version and sometimes versions of external utils which gcc use
(binutils etc.).
> gcc version 2.95.2 19991024 (release)
> For pentium, I get the .4 alignment and the movw.
> 386: .align 4, and the movzwl (?!)
> 486: .align 16, and back to the 'movw'
> pentiumpro: same as 386, .4 and movzwl
> ---
> My timing tests were all on a P-III. When optimizing for
> the pentpro, it *slowed* down by 25%. So it appears the "movzwl"
> instruction is slower on a PIII and maybe a PII. It's hard to imagine
> a movw, which does less actually being slower. in any circumstance.
> So if you notice, no xor's are needed, so zeroing the high
> portion would seem to be just a waste of time unless the movzwl is actually
> faster than a movw (?).
As Wolfgang pointed out, some x86 CPUs are pretty sensitive to
change operand size / change adress size prefixes. This is probably
the reason why the movws aren't effective on such CPUs. On Pentium Pro /
II / III movxx takes only one one micro-op and decodes in the the
simple decoders, so it isn't slower than single movew.
> I'm just upset that the aim9 benchmark wasn't faster across the board
> with pentiumpro optimization on a PIII or a PII -- I checked both and
> the "-mpentium" optimization slowed down short integer addition
> significantly over the -m486, so I'm just trying to track down the
> source of the problem.
The problem isn't AFAIK in types of insns gcc uses, but mostly in
absence of good low-level insns reordering pass (in (p)gcc 2.95.x).
(Fluent decoding seems to be _very_ important to the latest CPUs.)
In comparison, there are special reordering in passes for both Pentium
and Pentium Pro / II / III in actual development snapshots of gcc 2.96.
These greatly improve performance. (For example: I noticed roughly 15%
performance improvement on Pentium II with -mcpu=i686 when compared to
-mcpu=i586)
Regards
--
Martin Ockajak a.k.a. Mandos <mandos AT hq DOT alert DOT sk> http://hq.alert.sk/~mandos
"The goal of Computer Science is to build something that will last at
least until we've finished building it."
--GvXjxJ+pjyke8COw
Content-Type: application/pgp-signature
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.0 (GNU/Linux)
Comment: For info see http://www.gnupg.org
iEYEARECAAYFAji8IGAACgkQ04YFujOC4BPOIACghGTXIENnh4TruU9yvbCta7bU
C10AnjANSfBTg8udkUNU3AbTlVXORDOh
=dGKZ
-----END PGP SIGNATURE-----
--GvXjxJ+pjyke8COw--
- Raw text -