> On Apr 26, 2023, at 12:45 AM, Ethan Duni <[email protected]> wrote: > > Judicious scaling helps, as does throwing more bits at the problem. But > neither of those can totally eliminate the concern about overflow, in > principle. The best you can do is to reduce the probability of overflow to > some extremely small value. Which is what we do with floating point > implementations, which have hundreds of dB of headroom.
Another issue is that while DSP hardware generally implements saturating signed fixed-point math in the ALUs, the general purpose ALUs in GP CPUS generally do not implement saturating match (at least not without jumping through a lot of hoops - if the ALU actually even supports saturation modes). While clipping due to saturation will obviously distort the signal processing if it happens internally to the alogrithm (e.g. in state variables) and that distortion can be objectionable, it absolutely benign as compared to the sort of distortion that happens when a non-saturating ALU wraps around (e.g. Full-Scale +1 -> -Full-Scale). This doesn’t happen with floating point. So while it is possible (although often difficult) to efficiently implement fixed point processing with DSP’s and ALU’s that support saturating math, it is far more difficult to *efficiently* implement fixed point on GP processors without saturating math that do not suffer from the potential for significant and catastrophic distortion, as all computations must be saturated if there is any possibility of overload. ARM supports it (at least in some micro architectures) but may require using asm, intrinsics or libraries. Intel seems to support it in the MMX/SSE/AVX unit, but not in the main cpu ALU, so again requires asm, intrinsics or libraries. This is significantly more involved that simply implementing an algorithm in FP. Best regards, B.J. Buchalter Metric Halo https://urldefense.proofpoint.com/v2/url?u=http-3A__www.mhlabs.com&d=DwIFaQ&c=009klHSCxuh5AI1vNQzSO0KGjl4nbi2Q0M1QLJX9BeE&r=TRvFbpof3kTa2q5hdjI2hccynPix7hNL2n0I6DmlDy0&m=yqEWQ4m7gxL3VaGEFESFviyzdIJ0S1iCD9GhJQTFuxplxlBl0IH9VVLwN3srYTh4&s=njd_54bCbiOgAX6Uxf3O6j2ArP9JdFm5OZ-t0bm7ejg&e=
