To: djgpp AT delorie DOT com Subject: Re: DJGPP Optimizing Message-ID: <19961231.163855.4983.3.chambersb@juno.com> From: chambersb AT juno DOT com (Benjamin D Chambers) Date: Mon, 30 Dec 1996 19:35:29 EST >Hi! Hi :) >I have some troubles using the optimizing features in the >compiler >1) When the compiler optimizes a tight inner loop, that >uses only integer math >it inserts a bunch of floating point instructions (fxch) >that doesn't seem to do Check to make sure _everything_ is integer math, and that you aren't accidentally typecasting to a float/double (ie using trig functions, etc) >anything at all (I can remove them and my code works fine >without). As these >instructions are inside the tight loop they eat up about >50% of the time spent here.. If it's really unnecessary floating math, I'm surprised it doesn't eat up more... >2) When using the trigonomic functions cos/sin in 3D >graphics it seems that whenever >I use the -O# compiler option the functions are treated >differently than without >the -O# option. Result is that the 3D space is skew'ed. >Am I assuming something >about the trigonomic function (ie. angles can be outside >[0 : 2*PI]) that does not >hold when optimizing? I believe the 387 (and 487 and 587) require trig functions to be within 2pi. However, I can't test this for sure, since I'm FPUless. >Kind regards, Henning Semler Good luck, ...Chambers