frac32buffer in
frac32buffer aRange
frac32 kRange
frac32buffer out
frac32.s.map range
int32_t diff;
int32_t prev;
int32_t pdiff;
int32_t ndiff;
int32_t positive;
int32_t negative;
int32_t mix;
int32_t norm;
int32_t val;
val = val + ((inlet_in - val) >> 1);
int32_t range = __SSAT(param_range + inlet_kRange + inlet_aRange, 28);
diff = ___SMMUL(__SSAT((val - prev), 24) << 7, range << 4);
pdiff = diff > 0 ? diff : 0;
ndiff = diff < 0 ? -diff : 0;
pdiff = pdiff > (1 << 27) ? (1 << 27) : pdiff;
ndiff = ndiff > (1 << 27) ? (1 << 27) : ndiff;
positive = (inlet_in >> 1) + (1 << 26);
negative = (inlet_in >> 1) - (1 << 26);
positive = ___SMMUL(positive << 3, positive << 2);
positive = ___SMMUL(positive << 3, positive << 2);
positive = ___SMMUL(positive << 3, positive << 2) - (1 << 26);
negative = ___SMMUL(negative << 3, negative << 2);
negative = ___SMMUL(negative << 3, negative << 2);
negative = (1 << 27) - ___SMMUL(negative << 3, negative << 2) - (1 << 26);
norm = (1 << 27) - pdiff - ndiff;
mix = ___SMMUL(norm << 2, inlet_in << 2) + ___SMMUL(pdiff << 3, negative << 2) +
___SMMUL(ndiff << 3, positive << 2);
outlet_out = mix;
// outlet_out=negative;
prev = val;