how do you "turn off denormals"
-
@rygorous what situations would i prefer to don't
-
how do you "turn off denormals"
EDIT: answered by wikipedia, and possibly also ryg
holy shit.
ok so mollytime had this perf problem that's been driving me lowkey crazy since i implemented polyphony where sometimes a patch's load % would shoot up super high depending on which midi I was feeding it, and like, it shouldn't *do* that.
switching on DAZ and FTZ just now brought a case that was hitting 45% load down to 16% holy smokes
-
@rygorous what situations would i prefer to don't
@rygorous so like if I leave DAZ and FTZ on what situation will I be like shocked pikachu face
-
holy shit.
ok so mollytime had this perf problem that's been driving me lowkey crazy since i implemented polyphony where sometimes a patch's load % would shoot up super high depending on which midi I was feeding it, and like, it shouldn't *do* that.
switching on DAZ and FTZ just now brought a case that was hitting 45% load down to 16% holy smokes
@aeva whoaaaaaa
-
@rygorous what situations would i prefer to don't
@aeva For audio?
Mostly you just won't need it if your IIR filters and delay lines (these are the two main culprits) just do this magic supah sekrit fixup on their input:
input += 1e-30f;
(or, in some cases, put it on the output for the feedback signals)
-
@rygorous so like if I leave DAZ and FTZ on what situation will I be like shocked pikachu face
@aeva It's fine for audio code but when you turn it on, you generally want to put it in a scope guard thingy that saves the original MXCSR and restores it after (way out in the outer loop, not per function or anything, toggling that isn't super cheap) because it changes the results of some float calcs and breaks a few rules that while not _super_ important might trip you up
-
holy shit.
ok so mollytime had this perf problem that's been driving me lowkey crazy since i implemented polyphony where sometimes a patch's load % would shoot up super high depending on which midi I was feeding it, and like, it shouldn't *do* that.
switching on DAZ and FTZ just now brought a case that was hitting 45% load down to 16% holy smokes
@aeva me and the DSP classic: "why does it get very slow after the envelope fades out"
I solved this when I was doing a synth in Flash by adding noise
-
@aeva It's fine for audio code but when you turn it on, you generally want to put it in a scope guard thingy that saves the original MXCSR and restores it after (way out in the outer loop, not per function or anything, toggling that isn't super cheap) because it changes the results of some float calcs and breaks a few rules that while not _super_ important might trip you up
@aeva the main thing that breaks without denormals on is that some numeric code might start slightly misbehaving in rare corner cases you're unlikely to notice, and certain assumptions like "if (a != b) then a-b != 0" don't hold with denormals off
-
@aeva the main thing that breaks without denormals on is that some numeric code might start slightly misbehaving in rare corner cases you're unlikely to notice, and certain assumptions like "if (a != b) then a-b != 0" don't hold with denormals off
@rygorous ah, so for example, a not quite zero value and zero compare differently depending on whether DAZ is on, stuff like that?
-
@rygorous ah, so for example, a not quite zero value and zero compare differently depending on whether DAZ is on, stuff like that?
@aeva You can have values that are different but their difference is a subnormal value and suddenly with FTZ you have div-by-0s, yeah.
(This is super rare but still.)
-
how do you "turn off denormals"
EDIT: answered by wikipedia, and possibly also ryg
@aeva I thought that's what we did by coming here.