A
Andrew Holme
I'm prototyping a fixed-point FFT algorithm for an FPGA.
I wrote a class 'complex' based on type 'double' for real and imaginary
parts. With some difficulty, I eventually got to the point where most
operations compiled to inline co-processor instructions. I then wrote a
class 'fixed' using type 'int' to represent fixed-point numbers with 16 bits
either side of the binary point. A simple test program using class 'fixed'
was well optimised; but when I changed class 'complex' to use 'fixed'
instead of 'double', the results were dissappointing.
Is this because the optimiser can only see so many levels down through a
class hierarchy?
Speed of execution on the PC is not important, since I am targetting a
totally different platform; b ut it would be nice to see it produce good
code.
I wrote a class 'complex' based on type 'double' for real and imaginary
parts. With some difficulty, I eventually got to the point where most
operations compiled to inline co-processor instructions. I then wrote a
class 'fixed' using type 'int' to represent fixed-point numbers with 16 bits
either side of the binary point. A simple test program using class 'fixed'
was well optimised; but when I changed class 'complex' to use 'fixed'
instead of 'double', the results were dissappointing.
Is this because the optimiser can only see so many levels down through a
class hierarchy?
Speed of execution on the PC is not important, since I am targetting a
totally different platform; b ut it would be nice to see it produce good
code.