From: Paul Shirley Newsgroups: comp.os.msdos.djgpp Subject: Re: Fixed vs floating point? Date: Fri, 19 Jun 1998 18:40:11 +0100 Organization: wot? me? Message-ID: <2VQrmCA7Jqi1Ew76@foobar.co.uk> References: NNTP-Posting-Host: chocolat.foobar.co.uk Mime-Version: 1.0 Lines: 20 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk In article , Rob Kramer writes >Can anyone make a guess if multiplications/devisions in fixed point math >are still faster on a machine that has a FPU? I was wondering if it would >do any good to #define my code to use conventional floats if the machine >supports it. (I'm using Allegro's fixed math stuff b.t.w) For Pentium and better processors: In principle multiple and divide are significantly faster with floats, add/sub a lot slower. Overall, hand optimised assembler can run maths algorithms noticeably faster. Back in the real world, you will probably see no overall difference in good (but untuned) C code, little improvement in tuned C code. Once you stray away from simple arithmetic (eg conditionals) floats become a serious liability. Most x86 compilers (djgpp included) don't do a good enough job with fpu code for you to simply switch variable types and get an improvement. --- Paul Shirley: my email address is 'obvious'ly anti-spammed