31 #include "siddefs-fp.h"
56 static inline float reduce(uint32_t val)
61 const uint32_t mantissa = val & 0x807F0000;
62 const uint32_t flt_rnd = mantissa | 0x1E000000;
64 memcpy(&temp, &flt_rnd,
sizeof(
float));
75 rand_state = rand_state * 1664525 + 1013904223;
77 return reduce(rand_state);
120 int clock(
int voice1,
int voice2,
int voice3);
136 void input(
int input) { ve = input << 4; }
150 #if RESID_INLINING || defined(FILTER8580_CPP)
167 (
filt1 ? Vi : Vo) += voice1;
169 (filt2 ? Vi : Vo) += voice2;
173 if (filt3) Vi += voice3;
176 (filtE ? Vi : Vo) += ve;
180 Vhp = (Vbp * _1_div_Q) - Vlp - Vi + noise.get();
182 assert(std::fpclassify(Vlp) != FP_SUBNORMAL);
183 assert(std::fpclassify(Vbp) != FP_SUBNORMAL);
184 assert(std::fpclassify(Vhp) != FP_SUBNORMAL);
186 float Vof =
static_cast<float>(Vo);
203 return static_cast<int>(Vof) *
vol >> 4;