|
From: Greg C. <chi...@co...> - 2006-03-17 20:31:48
|
On 2006-3-17 14:38 UTC, Douglas Vechinski wrote: > > Can a subroutine call add that much overhead. Yes I understand that > there is some overhead, but certainly it seems to me that the > calculation of a trig function is alot more time consuming than such > overhead. Educated guesses may lead us astray, and measurements may prove things that seem surprising. > This example with the trig functions was just a small one I put together > so other people could test. If I were to use a Gaussian elimination > code to solve a large matrix i would get comparable results that Cases > C and D are much slower than any of the others. This would not involve > any complex trig function just straight forward adding and > multiplaction. In that case, significant speed differences could still arise from different settings in the floating-point control word, or perhaps from some compilers using SSE instructions. > As I said, I don't know the implications of using -ffast-math and don't > necessarly want to use it as "the solution". With '-ffast-math', gcc uses one particular set of options, which are given in the manual. Without '-ffast-math', gcc behaves in a different way. And msvc with no explicit options behaves in a third way, which might be comparable to gcc with '-ffast-math' and '-mfpmath=sse'. If msvc uses the '387' instructions at all, it first reduces precision to 64 bits by default IIRC; MinGW's default is 80 bits. |