delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/10/20/22:30:17

From: "Marp" <marp AT 0 DOT 0 DOT 0 DOT 0>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Runtime Speed Optimization
Date: Fri, 20 Oct 2000 22:21:44 -0400
Organization: MindSpring Enterprises
Lines: 44
Message-ID: <8squfu$cso$1@slb6.atl.mindspring.net>
References: <39F0EBB3 DOT 375FEFCE AT email DOT com>
NNTP-Posting-Host: 04.30.99.a4
X-Server-Date: 21 Oct 2000 02:19:42 GMT
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.50.4133.2400
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

"Derek Chew" <sdchew AT email DOT com> wrote in message
news:39F0EBB3 DOT 375FEFCE AT email DOT com...

<snip>

>   later... Currently some of the problems faced are:
>
>   1) System's response time is way way too slow. Tried to speed things
>   up by updating the display only every 1000 or even 10000 cycles but
>   it is not helping
>
>   2) I'm not very sure how to provide options to optimize the
>   compiling of the software for my target platform. Going to try -O3
>   but dunno what else can I do. Basically what I want to do is to
>   optimize the program to run as fast as possible. Compiling time and
>   program size is not an issue.

Turning on the optimizer with the -O3 switch is exactly what you want to do.
I also suggest these:

-march=i486 -ffast-math -fomit-frame-pointer

and when you link, use the -s switch.

>
>   3) Sometimes the compiling of the source is done on an old 486SX
>   Laptop which if I am not mistaken does not have an FPU. Does this
>   mean the code generated will always use an FPU emulator even if I
>   run the code later on a 486DX4-100? and is there a way to force the
>   compiler to generate code which will always use an FPU?

The FPU emulator code is in a file called emu387.dxe. It is normally loaded
only on machines without a FPU. The only time the emulator will be loaded on
a machine with a real FPU is by delibrately setting an environment variable.
Moving the program between machines will change the behavior appropriately
and you should not need to use any special switches. In order for your
program to work on machines without a FPU, be sure it has emu387.dxe in it's
working directory or in one searched by the PATH environment variable.

Hope this helps.

Marp


- Raw text -


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