Re: Counter Intuitive Results: Optimising an FFT routine for Speed
From: Steven G. Johnson (stevenj_at_alum.mit.edu)
Date: 10/07/03
- Next message: Mike Wahler: "Re: Why Use anything BUT C?"
- Previous message: Mike Wahler: "Re: Casting a pointer to an enum"
- In reply to: Paul Brown: "Counter Intuitive Results: Optimising an FFT routine for Speed"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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.
- Next message: Mike Wahler: "Re: Why Use anything BUT C?"
- Previous message: Mike Wahler: "Re: Casting a pointer to an enum"
- In reply to: Paul Brown: "Counter Intuitive Results: Optimising an FFT routine for Speed"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|