Hi Katja,<br><br>I tried on my laptop (Intel dual-core 2 duo, 1,66GHz), and it works fine I guess. It takes a little to go from 0 to 1 and back, but there doesn&#39;t seem to be any particular issues with NAN and INF numbers.<br>

<br>Now on the Pi : sending a NAN to the lop~ makes it hang. Sending 1 works fine, but sending 0 after that results in a different behaviour compared to that of my laptop : the number of non-zero digits seems to grow much faster, and it never really actually goes to 0. It (apparently) hangs with still about 30 non-zero digits to the right of the very long number. <br>
<br>I guess you&#39;re not the only one, are you ?<br><br>Cheers,<br><br>Pierre.<br><br><div class="gmail_quote">2013/1/22 katja <span dir="ltr">&lt;<a href="mailto:katjavetter@gmail.com" target="_blank">katjavetter@gmail.com</a>&gt;</span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hey Pierre,<br>
<br>
I&#39;ve commented patch denorm-test.pd in such a way that it explains the<br>
topic a bit more (see attached). Now I&#39;d like to ask you, if you can<br>
run the patch on a &#39;normal&#39; computer and on your Raspberry Pi for<br>
comparison. If you have Pd gui on the Pi, you should be able to check<br>
if your Pd install has a denormals issue. It&#39;s hard to believe that I<br>
would be the only one experiencing this issue, but I need to be sure.<br>
<br>
In my previous mail I stated that it is easy to avoid subnormals by<br>
just feeding a very small number in objects that may decay into<br>
subnormal range (feedback delay lines and most filters). But in<br>
practice, this is not always so easy, as I am now experiencing while<br>
trying to make a big patch work well on the Pi. There are many more<br>
filters than I was aware of. For example, following a bit-mangling<br>
operation a [hip~] was added to remove DC. Now if the bit-mangler<br>
stops receiving signal input, [hip~] starts to chew subnormals until<br>
it will receive signal again. I found that each filter struggling with<br>
subnormals eats at least 6% CPU time (while they do some 0.25% in<br>
normal state). Pd objects should really take care of this in one way<br>
or another, it&#39;s too confusing for the user to sort it out. I&#39;m going<br>
to try recompile Pd with PD_BIGORSMALL checks enabled, and see what it<br>
means for the normal performance of the filter objects.<br>
<span><font color="#888888"><br>
Katja<br>
</font></span><div><div><br>
<br>
On Mon, Jan 21, 2013 at 4:24 PM, Pierre Massat &lt;<a href="mailto:pimassat@gmail.com" target="_blank">pimassat@gmail.com</a>&gt; wrote:<br>
&gt; Hi Katja, thank you for your reply! It is now (slightly) clearer. Every time<br>
&gt; you post something here I feel like some messages from a technical NASA<br>
&gt; mailing list are being accidentally sent to pd-list!<br>
&gt;<br>
&gt; Cheers,<br>
&gt;<br>
&gt; Pierre.<br>
&gt;<br>
&gt;<br>
&gt; 2013/1/21 katja &lt;<a href="mailto:katjavetter@gmail.com" target="_blank">katjavetter@gmail.com</a>&gt;<br>
&gt;&gt;<br>
&gt;&gt; Pierre, the way how denormals can impact performance on the Pi, is<br>
&gt;&gt; whenever a an object with feedback delay (IIR filter, reverb etc.)<br>
&gt;&gt; stops receiving input signal, it&#39;s values decay into the subnormal<br>
&gt;&gt; range, which causes substantial increase of CPU load. Such situations<br>
&gt;&gt; can be avoided by adding a tiny DC value to the object input, like [+~<br>
&gt;&gt; 1e-21] (note the minus sign in the number notation). When a normal<br>
&gt;&gt; audio signal is present, that number is too small to be added (because<br>
&gt;&gt; of limited precision), but when audio stops, it prevents subnormals.<br>
&gt;&gt;<br>
&gt;&gt; Another thing is, one should be careful not to accidentally send &#39;inf&#39;<br>
&gt;&gt; or &#39;nan&#39; into such objects, as they can not recover from it. This<br>
&gt;&gt; would be particularly annoying in a public performance, since you&#39;d<br>
&gt;&gt; need to reload the containing patch to recover.<br>
&gt;&gt;<br>
&gt;&gt; It is possible to prevent denormals via C code, as it is currently<br>
&gt;&gt; done for Pd on Intel processors, but this implements a lot of<br>
&gt;&gt; conditional checks and it means performance loss for many objects. For<br>
&gt;&gt; current Intel computers the extra load is not so much of a problem,<br>
&gt;&gt; but for poor Raspberry Pi one would rather like to save a few<br>
&gt;&gt; instructions, instead of adding more.<br>
&gt;&gt;<br>
&gt;&gt; Katja<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; On Sun, Jan 20, 2013 at 5:27 PM, Pierre Massat &lt;<a href="mailto:pimassat@gmail.com" target="_blank">pimassat@gmail.com</a>&gt; wrote:<br>
&gt;&gt; &gt; Hi,<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Could someone please explain how this impacts Pd&#39;s performance on the<br>
&gt;&gt; &gt; Raspberry Pi ?<br>
&gt;&gt; &gt; It doesn&#39;t make any sense to me right now, but i&#39;m very curious...<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Cheers,<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Pierre.<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; 2013/1/20 Hans-Christoph Steiner &lt;<a href="mailto:hans@at.or.at" target="_blank">hans@at.or.at</a>&gt;<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; I think this is what you want, from &#39;man gcc&#39;.  Its interesting to note<br>
&gt;&gt; &gt;&gt; that<br>
&gt;&gt; &gt;&gt; the NEON mode, which provides SIMD, also does not do denormals:<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; -mfpu=name<br>
&gt;&gt; &gt;&gt; -mfpe=number<br>
&gt;&gt; &gt;&gt; -mfp=number<br>
&gt;&gt; &gt;&gt;     This specifies what floating point hardware (or hardware emulation)<br>
&gt;&gt; &gt;&gt; is<br>
&gt;&gt; &gt;&gt;     available on the target.  Permissible names are: fpa, fpe2, fpe3,<br>
&gt;&gt; &gt;&gt; maverick,<br>
&gt;&gt; &gt;&gt;     vfp, vfpv3, vfpv3-fp16, vfpv3-d16, vfpv3-d16-fp16, vfpv3xd,<br>
&gt;&gt; &gt;&gt; vfpv3xd-fp16,<br>
&gt;&gt; &gt;&gt;     neon, neon-fp16, vfpv4, vfpv4-d16, fpv4-sp-d16 and neon-vfpv4.<br>
&gt;&gt; &gt;&gt; -mfp<br>
&gt;&gt; &gt;&gt; and<br>
&gt;&gt; &gt;&gt;     -mfpe are synonyms for -mfpu=fpenumber, for compatibility with<br>
&gt;&gt; &gt;&gt; older<br>
&gt;&gt; &gt;&gt;     versions of GCC.<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt;     If -msoft-float is specified this specifies the format of floating<br>
&gt;&gt; &gt;&gt; point<br>
&gt;&gt; &gt;&gt;     values.<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt;     If the selected floating-point hardware includes the NEON extension<br>
&gt;&gt; &gt;&gt; (e.g.<br>
&gt;&gt; &gt;&gt;     -mfpu=neon), note that floating-point operations will not be used<br>
&gt;&gt; &gt;&gt; by<br>
&gt;&gt; &gt;&gt; GCC&#39;s<br>
&gt;&gt; &gt;&gt;     auto-vectorization pass unless -funsafe-math-optimizations is also<br>
&gt;&gt; &gt;&gt;     specified.  This is because NEON hardware does not fully implement<br>
&gt;&gt; &gt;&gt; the<br>
&gt;&gt; &gt;&gt; IEEE<br>
&gt;&gt; &gt;&gt;     754 standard for floating-point arithmetic (in particular denormal<br>
&gt;&gt; &gt;&gt; values<br>
&gt;&gt; &gt;&gt;     are treated as zero), so the use of NEON instructions may lead to a<br>
&gt;&gt; &gt;&gt; loss of<br>
&gt;&gt; &gt;&gt;     precision.<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; .hc<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; On 01/20/2013 06:54 AM, katja wrote:<br>
&gt;&gt; &gt;&gt; &gt; I was assuming, or maybe just hoping? that Raspberry Pi (and ARM<br>
&gt;&gt; &gt;&gt; &gt; devices in general) would not suffer from Denormal&#39;s disease like<br>
&gt;&gt; &gt;&gt; &gt; Intel processors do. But guess what: Pi&#39;s float coprocessor is IEEE<br>
&gt;&gt; &gt;&gt; &gt; 754 compliant and does all denormals by default (can check with<br>
&gt;&gt; &gt;&gt; &gt; attached denorm-test.pd). Bummer! As if one would use an ARM device<br>
&gt;&gt; &gt;&gt; &gt; to<br>
&gt;&gt; &gt;&gt; &gt; calculate the size of a Majorana particle, rather than doing simple<br>
&gt;&gt; &gt;&gt; &gt; dsp. Do we really need to enable PD-BIGORSMALL() checks for this poor<br>
&gt;&gt; &gt;&gt; &gt; little processor? There seems to be something called &#39;RunFast mode&#39;<br>
&gt;&gt; &gt;&gt; &gt; for Pi&#39;s float processor vfpv2, but I see no way how to enable this<br>
&gt;&gt; &gt;&gt; &gt; via gcc. Option -ffast-math is allowed but doesn&#39;t do the trick.<br>
&gt;&gt; &gt;&gt; &gt; Can&#39;t<br>
&gt;&gt; &gt;&gt; &gt; find an option to set vfpv2 specifically, in gcc docs.<br>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt; Katja<br>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt; _______________________________________________<br>
&gt;&gt; &gt;&gt; &gt; <a href="mailto:Pd-list@iem.at" target="_blank">Pd-list@iem.at</a> mailing list<br>
&gt;&gt; &gt;&gt; &gt; UNSUBSCRIBE and account-management -&gt;<br>
&gt;&gt; &gt;&gt; &gt; <a href="http://lists.puredata.info/listinfo/pd-list" target="_blank">http://lists.puredata.info/listinfo/pd-list</a><br>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; _______________________________________________<br>
&gt;&gt; &gt;&gt; <a href="mailto:Pd-list@iem.at" target="_blank">Pd-list@iem.at</a> mailing list<br>
&gt;&gt; &gt;&gt; UNSUBSCRIBE and account-management -&gt;<br>
&gt;&gt; &gt;&gt; <a href="http://lists.puredata.info/listinfo/pd-list" target="_blank">http://lists.puredata.info/listinfo/pd-list</a><br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; _______________________________________________<br>
&gt;&gt; &gt; <a href="mailto:Pd-list@iem.at" target="_blank">Pd-list@iem.at</a> mailing list<br>
&gt;&gt; &gt; UNSUBSCRIBE and account-management -&gt;<br>
&gt;&gt; &gt; <a href="http://lists.puredata.info/listinfo/pd-list" target="_blank">http://lists.puredata.info/listinfo/pd-list</a><br>
&gt;&gt; &gt;<br>
&gt;<br>
&gt;<br>
</div></div></blockquote></div><br>