[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Sc-devel] float->int casts in OscUGens.cpp (and elsewhere?)
I notice that OscUGens.cpp contains a number of direct downcasts from double
to int32, such as line 1840:
phase += (int32)(cpstoinc * ZXP(freqin));
I assume it's been discussed here before, but this is a particularly
inefficient thing to do on IA32 processors. Luckily this assignment isn't
too sensitive to which way the rounding goes, so there are some simple
assembly solutions (such as using fistp to store the intermediate value into
an integer location). I think there are even some standard C99 functions...
Is anyone in a position to take care of this?