# How does JUCE\_UNDENORMALISE macro works?

**URL:** <https://forum.juce.com/t/how-does-juce-undenormalise-macro-works/23243>\
**Category:** Development\
**Created:** [July 8, 2017, 1:05pm UTC](https://forum.juce.com/t/how-does-juce-undenormalise-macro-works/23243 "2017-07-08T13:05:18Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![ttg](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/ttg/32/14456_2.png) [@ttg](https://forum.juce.com/u/ttg)\
**Post date:** [July 8, 2017, 5:26pm UTC](https://forum.juce.com/t/how-does-juce-undenormalise-macro-works/23243/2 "2017-07-08T17:26:01Z")

</div>

Checkout this:

> [@State of the Art Denormal Prevention](https://forum.juce.com/t/state-of-the-art-denormal-prevention/16802):
>
> Something like this should be part of the JUCE Library, it makes all other denormal workarounds needless. It activates the Flush To Zero(FTZ) and Denormals Are Zero (DAZ) mode for x86 & x64&nbsp; At least the code should generated with SSE2 instructions for floating point operations (which is standard in VS2012 & XCODE) Not sure if there is something similar for&nbsp;ARM. I did performance-tests&nbsp;with 32/64 bit Xcode & VS2012 and it works! (at least on my intel-processors) Just add "ScopedNoDenormals​…

this is what we’ve used lately and looks good on our test with Intel based machine (I admit I didn’t test AMDs).  
Keep in mind some formats (AU and AAX) should turn the flags already in their code. but from my tests. that didn’t hurt anything.

**TL;DR**

> [@State of the Art Denormal Prevention](https://forum.juce.com/t/state-of-the-art-denormal-prevention/16802/2):
>
> Does anybody has reliable information how de-normals and these flags affecting AMD processors? I couldn't find any information... Here is some testcode, if somebody has an AMD processor, would be great to check this out &nbsp; #ifndef MAINCOMPONENT\_H\_INCLUDED #define MAINCOMPONENT\_H\_INCLUDED #include "../JuceLibraryCode/JuceHeader.h" #include "xmmintrin.h" class ScopedNoDenormals { public: ScopedNoDenormals() { oldMXCSR = \_mm\_getcsr(); int newMXCSR = oldMXCSR | 0x8040; …

---

_[View the full topic](https://forum.juce.com/t/how-does-juce-undenormalise-macro-works/23243)._
