faust icon indicating copy to clipboard operation
faust copied to clipboard

feature request — allow to configure meaning of "int" at compile-time

Open LFSaw opened this issue 4 years ago • 2 comments

in difference to the faust datatype float, the faust datatype int is currently fixed to be represented as int (in cpp-language output).

Since faust is perfectly capable to be used for integer DSP routines, it would be good to be able to specify, which integer representation (i.e. granularity) will be used in the generated code (similar to the -quad / -single and -double flags).

For the sake of clarity, I would vote to implement C++ standard types (int32_t, etc.). This would also imply to be able to switch between different constants (INT_MIN / INT_MAX, as proposed in #455).

LFSaw avatar Jun 28 '20 16:06 LFSaw

What kind for size would you need ?

sletz avatar Jul 01 '20 07:07 sletz

for my purpose, I'd like to (a) know the bitlength of integers at compile-time and (b) be able to change to different length as it is currently possible with floats. I am trying to implement bit-based dsp in faust, for which I rely on integers to store delta-sigma dsp information. the size of the integer determines the number of bits being stored in one int...

LFSaw avatar Jul 07 '20 16:07 LFSaw