X-POP3-Rcpt: mlehmann AT universe DOT sgh-net DOT de 14 Jan 1998 10:02:49 GMT Message-Id: <199801141002.KAA01669@odie.demon.co.uk> From: Andrew Pollard To: Hannes DOT Loeffler AT uibk DOT ac DOT at CC: beastium-list AT Desk DOT nl In-reply-to: (Hannes.Loeffler@uibk.ac.at) Subject: Re: Some questions Sender: Marc Lehmann Status: RO X-Status: A Content-Length: 2438 Lines: 57 Hannes DOT Loeffler AT uibk DOT ac DOT at wrote: >1) The Pentium Compiler FAQ states that loop unrolling is one of the lesser > tested parts of gcc/egcs/pgcc. What does this exactly mean? (I > observed some numerical deviations in a Fortran 77 production code). I'd say it means it is liable to have some bugs in it and generate code that doesn't necessarily work :-) >2) Does pgcc speed up code produced by g77 (which I'm mainly interested in)? Should do, because all the front ends (gcc,g77,g++,etc) use the same back end (which contains all the optimisation stuff). >3) Is there a difference between -mcpu=pentium and -mcpu=pentiumpro? Does pgcc > trigger any special Pentium Pro optimizations? (The above > mentioned Fortran code seems to be slightly faster with > -mcpu=pentium on a PPro). The difference between the two -mcpu= flags is that it changes the 'cost' of certain low level operations. This means that gcc will attempt to change the order of execution for the generated assembler code to make it run better on the chosen processor. >4) Besides the -mcpu=CPU TYPE flag there is a corresponding -march=CPU TYPE > flag. Should I compile with both flags to get maximum optimizations? -mcpu=* generates code that should run on any of the processors, but is optimised to run on the specified processor -march=* generates code to specifically run on the specified processor. A -march=pentiumpro binary is not guaranteed to run on a pentium. (the PPro has some extra opcodes that can be used if -march=pentiumpro is used). Saying all this, the PPro part of pgcc is one of the least tested bits, and there are frequently problems with using -march=pentiumpro. [ Basically, 'cos Marc hasn't got access to a PPro machine - I try it out, but I can't fix most of the problems... ] (for example, if you download the source to pgcc and compile it yourself, it is likely that the -march=pentiumpro option will generate code that the assembler cannot handle) - the (recent, ie > Dec 97) precompiled binaries should be fine. [ I've got the small patch if anyone requires it... ] You also *must* have binutils-2.8.1.0.15 or greater to have a chance of -march=pentiumpro working. Andrew. -- Andrew Pollard, Auto Simulations Ltd. UK. | home: andrew AT odie DOT demon DOT co DOT uk 2 Milbanke Court, Milbanke Way, Bracknell | work: andrewp AT autosim DOT com Tel:+44(0)1344 426486x103 Fax:+44(0)1344 426615 | http://www.odie.demon.co.uk