delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/08/10/11:47:13

Reply-To: <arfa AT clara DOT net>
From: "Arthur" <arfa AT clara DOT net>
To: "DJGPP Mailing List" <djgpp AT delorie DOT com>, <D DOT J DOT Eleveld AT anest DOT azg DOT nl>
Subject: RE: How safe is the -march=pentium flag?
Date: Mon, 10 Aug 1998 16:46:27 +0100
Message-ID: <000101bdc476$090d6620$244e08c3@arthur>
MIME-Version: 1.0
Importance: Normal
In-Reply-To: <6qmqma$mcp$1@nnrp1.dejanews.com>

> Hello Everyone,
>
> I've just been playing with the -march flags and found a huge speed increase
> when I used -march=pentuim.  If this works so good, why is there a push for a
> pentium optimized gcc?

There is a pentium optimised version - PGCC. Look for the other postings I've sent
(Subject: PGCC) for more details.

PGCC replaces -march=pentium and several other optimisation flags (and a few more
that it adds) with -O7 and a few new flags (such as -frisc). It just optimises the
instruction set, alignment etc used for one more suited for the Pentium.

> Doesn't -march=pentium make pentium optimized code?

AFAIK it only aligns the instructions for a Pentium.  Code using -march=pentium will
still work on older machines.

> It does seem to speed things up alot.  I had tried PGCC and was a little
> disappointed with the speed increases so I stayed with regular Djgpp.  Now it
> seems that I had a pentium optimizing compiler all along.  I'm confused...

PGCC produces pentium (& compatibles) specific code. -march=pentium just aligns the
code. You could try -mcpu=pentium to force GCC to make pentium specific code, but
choosing -O7 from the PGCC does that anyway. There are other flags for PGCC that
can't be used with GCC, but they're not very well documented. In the readme file that
comes with it, it says that you should fiddle around with the settings until you find
the right combination for the program.

Having said that, I've seen little difference over using -O7 than
using -mpentium, -march=pentium and -mcpu=pentium together. Anyone?


James Arthur
jaa AT arfa DOT clara DOT net
ICQ#15054819

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019