Date: Wed, 16 Sep 1998 12:16:57 +0300 (IDT) From: Eli Zaretskii To: Arthur cc: DJGPP Mailing List Subject: RE: djgpp and optimizations In-Reply-To: <000601bde0bf$801e80e0$844e08c3@arthur> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Precedence: bulk On Tue, 15 Sep 1998, Arthur wrote: > > > Also when is djgpp going to officially support optimizations > > for the pentium? > > > > When the GCC maintainers include them in the official GCC release. > > How about gcc 2.8.1 (-mpentium, -march=pentium, -mcpu=pentium etc)? These mainly change the compiler's decisions about which instructions are more/less expensive in certain contexts. Pentium-specific optimizations in PGCC are much more than just that. > What does -fstrength-reduce do, exactly, and why do some people report such > a huge speed increase when using it? -fstrength-reduce replaces expensive instruction by less expensive ones. For example, multiplication is replaced with additions or bit shifts, etc. The problem is that this usually needs extra registers, and x86 has a few of them to spare. If a function doesn't use too many registers, then -fstrength-reduce can be a big win; but if they are all used, -fstrength-reduce in a loop can mean a significant slowdown, since GCC will have to constantly reload some of the regsiters.