From: Brad Spencer Newsgroups: comp.os.msdos.djgpp Subject: Optimization flags [was Re: I don't understand djgpp's optimizations] Date: 6 Apr 1997 02:41:11 GMT Organization: iSTAR Internet Incorporated Lines: 37 Message-ID: <5i72g7$7ib@news.istar.ca> References: <33440E51 DOT 6AE AT imaginet DOT fr> <5i2fm8$b34_001 AT tuwien DOT ac DOT at> NNTP-Posting-Host: ts20-03.hfx.istar.ca Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp godzilla wrote: > i'm using '-O3 -ffast-math -funroll-loops -fomit-frame-pointer' and the > runtime-difference to watcom-generated code is usually between 10 and 20 % > (my loops are huge and no so simple) > nonetheless i prefer djgpp :-) > greetings Speaking of optimization flags, I was playing around with my 3D engine work-in-progress :) and I found the following combination to be 'the best'. Mind you, I didn't compare -O2 and -O3 since -O3 and I tend to get in a lot of arguments. Anyway, the flags: The standard stuff -O2 -ffast-math -fomit-frame-pointer plus a little seasoning -malign-double -malign-loops=0 -malign-jumps=0 Now, I'm not sure if aligning to 0 is the same as aligning to 1, but it does what I want and totally throws out any jump alignment. I'm only interested in Pentium machines, and AFAIK alignment just slows things down (NOPs to process), or at least it did for me. I'm not convinced that -m486 actually does _anything_ (looking briefly at assembly output, which is what I seem to be spending a lot of time doing :), so I forget all about it. Just thought I'd mention this, as I've never seen mention of the jump alignment switches before... ------------------------------------------------------------------ Brad Spencer - spencer AT ug DOT cs DOT dal DOT ca - in CS @ Dalhousie University "S.M.A.K.I.B.B.F.B." - A.J. Rimmer | http://ug.cs.dal.ca/~spencer/