Re: Counter Intuitive Results: Optimising an FFT routine for Speed

From: Steven G. Johnson (stevenj_at_alum.mit.edu)
Date: 10/07/03


Date: Tue, 07 Oct 2003 13:58:00 -0400

Paul Brown wrote:
> This is strange but credible, I understood that all internal
> arithmetic was carried out with doubles, and casts to and from float
> performed as necessary to match the variables data types. This does
> not appear to be the case with Turbo-C

The x86 registers are extended precision (or at least double, depending
upon the mode), so your compiler doesn't have much choice in the matter.
  Nor does this affect the speed.

Single precision is almost always faster than double precision, though,
at least for significant transform sizes, simply because of cache usage.

(Double precision variables also need to be 8-byte aligned on x86 or the
speed dies horribly and unpredictably; not all compilers do this.)

> BTW - I could not get CYCLE.h to work, Turbo-C does not support
> __INLINE__ or __ASM__. Good thing I spent the time to get my
> ****PORTABLE**** timer to work.

You asked for something with more resolution than clock(), so I told you
the best resolution you can get; if you're happy with clock(), why did
you ask? Unfortunately, accessing the cycle counter is necessarily
compiler/CPU-specific. (You also inexplicably grabbed the code from
cycle.h labeled as gcc-specific.)

BTW, clock() may be portable, but any assumptions about its resolution
are not.

...

Not that any of this is relevant to the DSP chip you eventually plan to
run on.



Relevant Pages

  • Re: frequency resolution issue
    ... resolution is in 0.01Hz? ... Precision is about the variation in the measured or calculated quantities ... measurement of the same thing from measurement to measurement. ... If you applied the same 4 measures to another data set and the resulting ...
    (comp.dsp)
  • Re: hwclock problem with leapseconds - posix?
    ... and deal with the hardware clock. ... that can be adjusted, and the skill and tools to adjust it. ... nobody needed that precision. ...
    (comp.os.linux.setup)
  • Re: Question about telescope design.
    ... that of a 3 m strip up and down the block. ... support structures to that level of precision, ... resolution and brightness benefits of large-aperture mirrors. ... surfaces whose radius of curvature varies all over the place. ...
    (sci.astro.amateur)
  • Re: Conformance
    ... They give a precision of approx 30 decimal digits ... This only increases the precision, not the range, and there are tricky ... Does your compiler pad qfloats to 512 bits or do your refer to ... qfloat s = 3.1415965358979323846264338327950288419Q; ...
    (comp.std.c)
  • Re: Numerical accuracy of C++ and Fortran programs on 32 bit machines
    ... ....snip prior discussion and example where average error of extension of ... > double precision constants 1.2D0 etc. (and at the moment this seems to ... > compiler should issue a warning, but in my opinion it should not be so ... The /fpconstant option requests that a single-precision constant ...
    (comp.programming)