|
From: Douglas V. <dou...@dy...> - 2006-03-22 16:36:37
|
>OK. Looking at assembler code, the difference is that > >(1)current version of mingw doesn't use -ffast-math (replacing library >calls by inline asm) by default. This is a safe default since library >calls have greater range/accuracy near extremes than naked asm. Also >libray calls may have side effect of setting fp errs. > > By this, are you saying that there shouldn't be much of a time difference between using or not using the -ffast-math flag under Mingw. My results show that it did. >(2) Not inlining sin -> fsin, cos -> fcos prevents other optimizations/ > > Others have made some comments concerning fsin, fcos, etc. How does one call these functions. If done by the compiler if you use -finline-functions or some other optimization flag, or is it something one has to do in the source code. Are fsin, fcos etc. calls that directly map to something the CPU does to internally calculate it? Looking at the assembly code for a source that just calculates a sin of a value, all I ever see is a " call _sin", I haven't ever seen a fsin function. >(3) GCC-3.4.5 is not smart enough even with --ffast-math to replace >fsin/fcos calls with fsincos calls when advantageous (it is in your >testcase). GCC-4.1 is. > > > What is the difference then between fsin/fcos and fsincos? |