From d05594eafe75eb14d1380605141fd9a76cb3c149 Mon Sep 17 00:00:00 2001 From: jules Date: Tue, 26 Sep 2017 12:24:52 +0100 Subject: [PATCH 1/7] Fixed a problem in a static assert in Atomic. --- modules/juce_core/memory/juce_Atomic.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/juce_core/memory/juce_Atomic.h b/modules/juce_core/memory/juce_Atomic.h index 353ca2a0d5..585b135504 100644 --- a/modules/juce_core/memory/juce_Atomic.h +++ b/modules/juce_core/memory/juce_Atomic.h @@ -45,7 +45,7 @@ namespace juce Atomic() noexcept : value (0) {} /** Creates a new value, with a given initial value. */ - Atomic (const Type initialValue) noexcept : value (initialValue) {} + Atomic (Type initialValue) noexcept : value (initialValue) {} /** Copies another value (atomically). */ Atomic (const Atomic& other) noexcept : value (other.get()) {} @@ -54,7 +54,7 @@ namespace juce ~Atomic() noexcept { #if __cpp_lib_atomic_is_always_lock_free - static_assert (std::atomic::is_always_lock_free(), + static_assert (std::atomic::is_always_lock_free, "This class can only be used for lock-free types"); #endif } @@ -105,7 +105,7 @@ namespace juce } /** Copies another value into this one (atomically). */ - Atomic& operator= (const Type newValue) noexcept + Atomic& operator= (Type newValue) noexcept { value = newValue; return *this; @@ -128,7 +128,7 @@ namespace juce Internally this calls std::atomic_thread_fence with memory_order_seq_cst (the strictest std::memory_order). */ - void memoryBarrier() noexcept { atomic_thread_fence (std::memory_order_seq_cst); } + void memoryBarrier() noexcept { atomic_thread_fence (std::memory_order_seq_cst); } /** The std::atomic object that this class operates on. */ std::atomic value; From 2a15a9beab2ae7c012c7a7135109af3c030bb2a9 Mon Sep 17 00:00:00 2001 From: tpoole Date: Tue, 26 Sep 2017 12:29:17 +0100 Subject: [PATCH 2/7] Updated the GitHub issue reporting instructions --- .github/ISSUE_TEMPLATE.txt | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/ISSUE_TEMPLATE.txt b/.github/ISSUE_TEMPLATE.txt index 5b012c7640..2404c33113 100644 --- a/.github/ISSUE_TEMPLATE.txt +++ b/.github/ISSUE_TEMPLATE.txt @@ -9,7 +9,9 @@ Please include: 6) the plugin format (VST2, VST3, AU, AAX, RTAS) - if applicable 7) which DAW you observed the bug in - if applicable -Make sure you have pulled the latest commits from the JUCE repo and re-compiled -the Projucer before you submit your bug. If it's a major bug, which must be -hot-fixed immediately, then we will also accept bug reports for tagged release -versions. +Make sure you have pulled the latest commits from the `develop` branch of the +JUCE repo and have re-compiled the Projucer before you submit your bug. Often +we have already fixed the issue but it hasn't yet been released on the `master` +branch. If it's a major bug, which must be hot-fixed immediately, then we will +also accept bug reports for tagged release versions. + From b0866b6a5f7b2bf36d81b59e787aecaf1004b115 Mon Sep 17 00:00:00 2001 From: tpoole Date: Thu, 5 Oct 2017 17:20:37 +0100 Subject: [PATCH 3/7] Fixed a bug when selecting AudioParameterChoice values in native DAW parameter views --- .../utilities/juce_AudioParameterChoice.h | 1 + .../utilities/juce_AudioParameterInt.h | 2 +- .../utilities/juce_AudioProcessorParameters.cpp | 17 +++++++++-------- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/modules/juce_audio_processors/utilities/juce_AudioParameterChoice.h b/modules/juce_audio_processors/utilities/juce_AudioParameterChoice.h index dc711d5830..6f909ccde1 100644 --- a/modules/juce_audio_processors/utilities/juce_AudioParameterChoice.h +++ b/modules/juce_audio_processors/utilities/juce_AudioParameterChoice.h @@ -67,6 +67,7 @@ public: private: //============================================================================== float value, defaultValue; + const int maxIndex; float getValue() const override; void setValue (float newValue) override; diff --git a/modules/juce_audio_processors/utilities/juce_AudioParameterInt.h b/modules/juce_audio_processors/utilities/juce_AudioParameterInt.h index 4c2f02c33b..fbc6f7bbf3 100644 --- a/modules/juce_audio_processors/utilities/juce_AudioParameterInt.h +++ b/modules/juce_audio_processors/utilities/juce_AudioParameterInt.h @@ -64,7 +64,7 @@ public: private: //============================================================================== - int minValue, maxValue; + const int minValue, maxValue, rangeOfValues; float value, defaultValue; float getValue() const override; diff --git a/modules/juce_audio_processors/utilities/juce_AudioProcessorParameters.cpp b/modules/juce_audio_processors/utilities/juce_AudioProcessorParameters.cpp index 88da76bc00..6924d0218d 100644 --- a/modules/juce_audio_processors/utilities/juce_AudioProcessorParameters.cpp +++ b/modules/juce_audio_processors/utilities/juce_AudioProcessorParameters.cpp @@ -83,7 +83,7 @@ AudioParameterInt::AudioParameterInt (const String& idToUse, const String& nameT int mn, int mx, int def, const String& labelToUse) : AudioProcessorParameterWithID (idToUse, nameToUse, labelToUse), - minValue (mn), maxValue (mx), + minValue (mn), maxValue (mx), rangeOfValues (maxValue - minValue), value ((float) def), defaultValue (convertTo0to1 (def)) { @@ -93,13 +93,13 @@ AudioParameterInt::AudioParameterInt (const String& idToUse, const String& nameT AudioParameterInt::~AudioParameterInt() {} int AudioParameterInt::limitRange (int v) const noexcept { return jlimit (minValue, maxValue, v); } -float AudioParameterInt::convertTo0to1 (int v) const noexcept { return (limitRange (v) - minValue) / (float) (maxValue - minValue); } -int AudioParameterInt::convertFrom0to1 (float v) const noexcept { return limitRange (roundToInt ((v * (float) (maxValue - minValue)) + minValue)); } +float AudioParameterInt::convertTo0to1 (int v) const noexcept { return (limitRange (v) - minValue) / (float) rangeOfValues; } +int AudioParameterInt::convertFrom0to1 (float v) const noexcept { return limitRange (roundToInt ((v * (float) rangeOfValues) + minValue)); } float AudioParameterInt::getValue() const { return convertTo0to1 (roundToInt (value)); } void AudioParameterInt::setValue (float newValue) { value = (float) convertFrom0to1 (newValue); } float AudioParameterInt::getDefaultValue() const { return defaultValue; } -int AudioParameterInt::getNumSteps() const { return AudioProcessorParameterWithID::getNumSteps(); } +int AudioParameterInt::getNumSteps() const { return rangeOfValues + 1; } float AudioParameterInt::getValueForText (const String& text) const { return convertTo0to1 (text.getIntValue()); } String AudioParameterInt::getText (float v, int /*length*/) const { return String (convertFrom0to1 (v)); } @@ -145,16 +145,17 @@ AudioParameterChoice::AudioParameterChoice (const String& idToUse, const String& const StringArray& c, int def, const String& labelToUse) : AudioProcessorParameterWithID (idToUse, nameToUse, labelToUse), choices (c), value ((float) def), - defaultValue (convertTo0to1 (def)) + defaultValue (convertTo0to1 (def)), + maxIndex (choices.size() - 1) { jassert (choices.size() > 0); // you must supply an actual set of items to choose from! } AudioParameterChoice::~AudioParameterChoice() {} -int AudioParameterChoice::limitRange (int v) const noexcept { return jlimit (0, choices.size() - 1, v); } -float AudioParameterChoice::convertTo0to1 (int v) const noexcept { return jlimit (0.0f, 1.0f, (v + 0.5f) / (float) choices.size()); } -int AudioParameterChoice::convertFrom0to1 (float v) const noexcept { return limitRange ((int) (v * (float) choices.size())); } +int AudioParameterChoice::limitRange (int v) const noexcept { return jlimit (0, maxIndex, v); } +float AudioParameterChoice::convertTo0to1 (int v) const noexcept { return jlimit (0.0f, 1.0f, v / (float) maxIndex); } +int AudioParameterChoice::convertFrom0to1 (float v) const noexcept { return limitRange (roundToInt (v * (float) maxIndex)); } float AudioParameterChoice::getValue() const { return convertTo0to1 (roundToInt (value)); } void AudioParameterChoice::setValue (float newValue) { value = (float) convertFrom0to1 (newValue); } From aa338866fb2df3e074a14bc36934648c55aab0ce Mon Sep 17 00:00:00 2001 From: tpoole Date: Fri, 6 Oct 2017 12:33:31 +0100 Subject: [PATCH 4/7] Minor documentation fixes --- modules/juce_core/memory/juce_ReferenceCountedObject.h | 1 + modules/juce_core/xml/juce_XmlDocument.h | 1 + .../in_app_purchases/juce_InAppPurchases.h | 4 +++- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/modules/juce_core/memory/juce_ReferenceCountedObject.h b/modules/juce_core/memory/juce_ReferenceCountedObject.h index 052e136dc3..bc67a49d83 100644 --- a/modules/juce_core/memory/juce_ReferenceCountedObject.h +++ b/modules/juce_core/memory/juce_ReferenceCountedObject.h @@ -212,6 +212,7 @@ private: { typedef ReferenceCountedObjectPtr Ptr; ... + } @endcode @see ReferenceCountedObject, ReferenceCountedObjectArray diff --git a/modules/juce_core/xml/juce_XmlDocument.h b/modules/juce_core/xml/juce_XmlDocument.h index e09bd63584..53e62888e6 100644 --- a/modules/juce_core/xml/juce_XmlDocument.h +++ b/modules/juce_core/xml/juce_XmlDocument.h @@ -55,6 +55,7 @@ namespace juce if (xml != nullptr && xml->hasTagName ("foobar")) { ...etc + } @endcode @see XmlElement diff --git a/modules/juce_product_unlocking/in_app_purchases/juce_InAppPurchases.h b/modules/juce_product_unlocking/in_app_purchases/juce_InAppPurchases.h index 157d44c853..1ab11277bb 100644 --- a/modules/juce_product_unlocking/in_app_purchases/juce_InAppPurchases.h +++ b/modules/juce_product_unlocking/in_app_purchases/juce_InAppPurchases.h @@ -184,13 +184,15 @@ public: bool isInAppPurchasesSupported() const; /** Asynchronously requests information for products with given ids. Upon completion, for each enquired product - there is going to be a corresponding @class Product object. + there is going to be a corresponding Product object. If there is no information available for the given product identifier, it will be ignored. */ void getProductsInformation (const StringArray& productIdentifiers); /** Asynchronously requests to buy a product with given id. + @param productIdentifier The product identifier. + @param isSubscription (Android only) defines if a product a user wants to buy is a subscription or a one-time purchase. On iOS, type of the product is derived implicitly. From 777f498c56f8a9636e6b3ebcda7b94ce2f1a454c Mon Sep 17 00:00:00 2001 From: tpoole Date: Fri, 6 Oct 2017 14:54:03 +0100 Subject: [PATCH 5/7] Updated the Doxygen generating script to remove the juce namespace --- doxygen/Doxyfile | 2 +- doxygen/process_source_files.py | 71 ++++++++++++++------------------- 2 files changed, 30 insertions(+), 43 deletions(-) diff --git a/doxygen/Doxyfile b/doxygen/Doxyfile index a8fa280df6..84a0fb85d5 100644 --- a/doxygen/Doxyfile +++ b/doxygen/Doxyfile @@ -1247,7 +1247,7 @@ HTML_DYNAMIC_SECTIONS = NO # Minimum value: 0, maximum value: 9999, default value: 100. # This tag requires that the tag GENERATE_HTML is set to YES. -HTML_INDEX_NUM_ENTRIES = 0 +HTML_INDEX_NUM_ENTRIES = 32 # If the GENERATE_DOCSET tag is set to YES, additional index files will be # generated that can be used as input for Apple's Xcode 3 integrated development diff --git a/doxygen/process_source_files.py b/doxygen/process_source_files.py index fb40b53876..4ada4eb6d4 100644 --- a/doxygen/process_source_files.py +++ b/doxygen/process_source_files.py @@ -7,14 +7,12 @@ import argparse def get_curly_brace_scope_end(string, start_pos): - """Given a string and the position of an opening curly brace, find the + """Given a string and a starting position of an opening brace, find the position of the closing brace. """ - if string[start_pos] != "{": - raise ValueError("string must have \"{\" at start pos") + start_pos += 1 string_end = len(string) bracket_counter = 1 - start_pos += 1 while start_pos < string_end: if string[start_pos] == "{": bracket_counter += 1 @@ -26,49 +24,41 @@ def get_curly_brace_scope_end(string, start_pos): return -1 +def remove_juce_namespaces(source): + """Return a string of source code with any juce namespaces removed. + """ + namespace_regex = re.compile(r"\s+namespace\s+juce\s*{") + + match = namespace_regex.search(source) + while (match is not None): + source = source[:match.start()] + source[match.end():] + end = get_curly_brace_scope_end(source, match.start() - 1) + if end != -1: + source = source[:end] + source[end + 1:] + match = namespace_regex.search(source) + continue + else: + raise ValueError("failed to find the end of the " + + match.group(1) + " namespace") + return source + + def add_doxygen_group(path, group_name): """Add a Doxygen group to the file at 'path'. - Namespaces cause all kinds of problems, and we need to ensure that if - the classes in a source file are contained within a namespace then we - also put the @weakgroup inside the namespace. + The addition of juce namespacing code to all of the source files breaks + backwards compatibility by changing the doc URLs, so we need to remove + the namespaces. """ filename = os.path.basename(path) if re.match(r"^juce_.*\.(h|dox)", filename): - group_definition_start = ("\r\n/** @weakgroup " - + group_name - + "\r\n * @{\r\n */\r\n") - group_definition_end = "\r\n/** @}*/\r\n" - with open(path, "r") as f: content = f.read() - - # Put the group definitions inside all namespaces. - namespace_regex = re.compile(r"\s+namespace\s+\S+\s+{") - match = namespace_regex.search(content) - while (match is not None): - namespace_end = get_curly_brace_scope_end(content, match.end() - 1) - if namespace_end == -1: - raise ValueError("error finding end of namespace " - + match.group() - + " in " - + path) - content = (content[:match.end()] - + group_definition_start - + content[match.end():namespace_end] - + group_definition_end - + content[namespace_end:]) - search_start = (namespace_end - + len(group_definition_start) - + len(group_definition_end)) - - match = namespace_regex.search(content, search_start) - with open(path, "w") as f: - f.write(group_definition_start) - f.write(content) - f.write(group_definition_end) + f.write("\r\n/** @weakgroup " + group_name + "\r\n * @{\r\n */\r\n") + f.write(remove_juce_namespaces(content)) + f.write("\r\n/** @}*/\r\n") ############################################################################### @@ -170,11 +160,8 @@ if __name__ == "__main__": for group_name in module_groups: for dirpath, dirnames, filenames in os.walk(module_groups[group_name]): for filename in filenames: - try: - add_doxygen_group(os.path.join(dirpath, filename), group_name) - except: - print("Error preprocessing " + filename) - continue + filepath = os.path.join(dirpath, filename) + add_doxygen_group(filepath, group_name) # Create an extra header file containing the module hierarchy. with open(os.path.join(args.dest_dir, "juce_modules.dox"), "w") as f: From 3cbf0791cc0a8beb390ab4c4050fdb6a8fe28c80 Mon Sep 17 00:00:00 2001 From: hogliux Date: Mon, 2 Oct 2017 18:23:51 +0100 Subject: [PATCH 6/7] Fixed an issue where ScopedNoDenormals would do nothing on all platforms and added arm implementation --- .../buffers/juce_FloatVectorOperations.cpp | 84 ++++++++++++++++++- .../buffers/juce_FloatVectorOperations.h | 30 +++---- .../juce_audio_basics/juce_audio_basics.cpp | 23 ----- modules/juce_audio_basics/juce_audio_basics.h | 25 ++++++ .../juce_core/system/juce_TargetPlatform.h | 2 +- 5 files changed, 119 insertions(+), 45 deletions(-) diff --git a/modules/juce_audio_basics/buffers/juce_FloatVectorOperations.cpp b/modules/juce_audio_basics/buffers/juce_FloatVectorOperations.cpp index 5523a4a2f7..9c3316c3d5 100644 --- a/modules/juce_audio_basics/buffers/juce_FloatVectorOperations.cpp +++ b/modules/juce_audio_basics/buffers/juce_FloatVectorOperations.cpp @@ -1028,20 +1028,98 @@ double JUCE_CALLTYPE FloatVectorOperations::findMaximum (const double* src, int #endif } +intptr_t JUCE_CALLTYPE FloatVectorOperations::getFpStatusRegister() noexcept +{ + intptr_t fpsr = 0; + #if JUCE_INTEL && JUCE_USE_SSE_INTRINSICS + fpsr = static_cast (_mm_getcsr()); + #elif defined (__arm64__) || defined (__aarch64__) || JUCE_USE_ARM_NEON + #if defined (__arm64__) || defined (__aarch64__) + asm volatile("mrs %0, fpcr" : "=r" (fpsr)); + #elif JUCE_USE_ARM_NEON + asm volatile("vmrs %0, fpscr" : "=r" (fpsr)); + #endif + #else + #if ! (defined (JUCE_INTEL) || defined (JUCE_ARM)) + jassertfalse; // No support for getting the floating point status register for your platform + #endif + #endif + + return fpsr; +} + +void JUCE_CALLTYPE FloatVectorOperations::setFpStatusRegister (intptr_t fpsr) noexcept +{ + #if JUCE_INTEL && JUCE_USE_SSE_INTRINSICS + auto fpsr_w = static_cast (fpsr); + _mm_setcsr (fpsr_w); + #elif defined (__arm64__) || defined (__aarch64__) || JUCE_USE_ARM_NEON + #if defined (__arm64__) || defined (__aarch64__) + asm volatile("msr fpcr, %0" : : "ri" (fpsr)); + #elif JUCE_USE_ARM_NEON + asm volatile("vmsr fpscr, %0" : : "ri" (fpsr)); + #endif + #else + #if ! (defined (JUCE_INTEL) || defined (JUCE_ARM)) + jassertfalse; // No support for getting the floating point status register for your platform + #endif + ignoreUnused (fpsr); + #endif +} + void JUCE_CALLTYPE FloatVectorOperations::enableFlushToZeroMode (bool shouldEnable) noexcept { + #if JUCE_USE_SSE_INTRINSICS || (JUCE_USE_ARM_NEON || defined (__arm64__) || defined (__aarch64__)) #if JUCE_USE_SSE_INTRINSICS - _MM_SET_FLUSH_ZERO_MODE (shouldEnable ? _MM_FLUSH_ZERO_ON : _MM_FLUSH_ZERO_OFF); + intptr_t mask = _MM_FLUSH_ZERO_MASK; + #else /*JUCE_USE_ARM_NEON*/ + intptr_t mask = (1 << 24 /* FZ */); + #endif + setFpStatusRegister ((getFpStatusRegister() & (~mask)) | (shouldEnable ? mask : 0)); + #else + #if ! (defined (JUCE_INTEL) || defined (JUCE_ARM)) + jassertfalse; // No support for flush to zero mode on your platform #endif ignoreUnused (shouldEnable); + #endif } void JUCE_CALLTYPE FloatVectorOperations::disableDenormalisedNumberSupport() noexcept { + #if JUCE_USE_SSE_INTRINSICS || (JUCE_USE_ARM_NEON || defined (__arm64__) || defined (__aarch64__)) #if JUCE_USE_SSE_INTRINSICS - const unsigned int mxcsr = _mm_getcsr(); - _mm_setcsr (mxcsr | 0x8040); // add the DAZ and FZ bits + intptr_t mask = 0x8040; + #else /*JUCE_USE_ARM_NEON*/ + intptr_t mask = (1 << 24 /* FZ */) | (1 << 23 /* RMODE_1 */) | (1 << 22 /* RMODE_0 */); #endif + + setFpStatusRegister (getFpStatusRegister() | mask); + #else + #if ! (defined (JUCE_INTEL) || defined (JUCE_ARM)) + jassertfalse; // No support for disable denormals mode on your platform + #endif + #endif +} + +ScopedNoDenormals::ScopedNoDenormals() noexcept +{ + #if JUCE_USE_SSE_INTRINSICS || (JUCE_USE_ARM_NEON || defined (__arm64__) || defined (__aarch64__)) + #if JUCE_USE_SSE_INTRINSICS + intptr_t mask = 0x8040; + #else /*JUCE_USE_ARM_NEON*/ + intptr_t mask = (1 << 24 /* FZ */) | (1 << 23 /* RMODE_1 */) | (1 << 22 /* RMODE_0 */); + #endif + + fpsr = FloatVectorOperations::getFpStatusRegister(); + FloatVectorOperations::setFpStatusRegister (fpsr | mask); + #endif +} + +ScopedNoDenormals::~ScopedNoDenormals() noexcept +{ + #if JUCE_USE_SSE_INTRINSICS || (JUCE_USE_ARM_NEON || defined (__arm64__) || defined (__aarch64__)) + FloatVectorOperations::setFpStatusRegister (fpsr); + #endif } //============================================================================== diff --git a/modules/juce_audio_basics/buffers/juce_FloatVectorOperations.h b/modules/juce_audio_basics/buffers/juce_FloatVectorOperations.h index c44bbd800f..ca5d734691 100644 --- a/modules/juce_audio_basics/buffers/juce_FloatVectorOperations.h +++ b/modules/juce_audio_basics/buffers/juce_FloatVectorOperations.h @@ -28,6 +28,7 @@ namespace juce #else #define JUCE_SNAP_TO_ZERO(n) ignoreUnused (n) #endif +class ScopedNoDenormals; //============================================================================== /** @@ -219,6 +220,12 @@ public: call before audio processing code where you really want to avoid denormalisation performance hits. */ static void JUCE_CALLTYPE disableDenormalisedNumberSupport() noexcept; + +private: + friend ScopedNoDenormals; + + static intptr_t JUCE_CALLTYPE getFpStatusRegister() noexcept; + static void JUCE_CALLTYPE setFpStatusRegister (intptr_t) noexcept; }; //============================================================================== @@ -229,26 +236,13 @@ public: class ScopedNoDenormals { public: - inline ScopedNoDenormals() noexcept - { - #if JUCE_USE_SSE_INTRINSICS - mxcsr = _mm_getcsr(); - _mm_setcsr (mxcsr | 0x8040); // add the DAZ and FZ bits - #endif - } - - - inline ~ScopedNoDenormals() noexcept - { - #if JUCE_USE_SSE_INTRINSICS - _mm_setcsr (mxcsr); - #endif - } + ScopedNoDenormals() noexcept; + ~ScopedNoDenormals() noexcept; private: - #if JUCE_USE_SSE_INTRINSICS - unsigned int mxcsr; - #endif + #if JUCE_USE_SSE_INTRINSICS || (JUCE_USE_ARM_NEON || defined (__arm64__) || defined (__aarch64__)) + intptr_t fpsr; + #endif }; } // namespace juce diff --git a/modules/juce_audio_basics/juce_audio_basics.cpp b/modules/juce_audio_basics/juce_audio_basics.cpp index 09e13e49c8..60b83c502a 100644 --- a/modules/juce_audio_basics/juce_audio_basics.cpp +++ b/modules/juce_audio_basics/juce_audio_basics.cpp @@ -31,22 +31,10 @@ #include "juce_audio_basics.h" -#if JUCE_MINGW && ! defined (__SSE2__) - #define JUCE_USE_SSE_INTRINSICS 0 -#endif - #if JUCE_MINGW && ! defined (alloca) #define alloca __builtin_alloca #endif -#ifndef JUCE_USE_SSE_INTRINSICS - #define JUCE_USE_SSE_INTRINSICS 1 -#endif - -#if ! JUCE_INTEL - #undef JUCE_USE_SSE_INTRINSICS -#endif - #if JUCE_USE_SSE_INTRINSICS #include #endif @@ -61,17 +49,6 @@ #undef JUCE_USE_VDSP_FRAMEWORK #endif -#if __ARM_NEON__ && ! (JUCE_USE_VDSP_FRAMEWORK || defined (JUCE_USE_ARM_NEON)) - #define JUCE_USE_ARM_NEON 1 -#endif - -#if TARGET_IPHONE_SIMULATOR - #ifdef JUCE_USE_ARM_NEON - #undef JUCE_USE_ARM_NEON - #endif - #define JUCE_USE_ARM_NEON 0 -#endif - #if JUCE_USE_ARM_NEON #include #endif diff --git a/modules/juce_audio_basics/juce_audio_basics.h b/modules/juce_audio_basics/juce_audio_basics.h index 03c99363f6..8c71dc07ea 100644 --- a/modules/juce_audio_basics/juce_audio_basics.h +++ b/modules/juce_audio_basics/juce_audio_basics.h @@ -55,6 +55,31 @@ #undef Complex // apparently some C libraries actually define these symbols (!) #undef Factor +//============================================================================== +#if JUCE_MINGW && ! defined (__SSE2__) + #define JUCE_USE_SSE_INTRINSICS 0 +#endif + +#ifndef JUCE_USE_SSE_INTRINSICS + #define JUCE_USE_SSE_INTRINSICS 1 +#endif + +#if ! JUCE_INTEL + #undef JUCE_USE_SSE_INTRINSICS +#endif + +#if __ARM_NEON__ && ! (JUCE_USE_VDSP_FRAMEWORK || defined (JUCE_USE_ARM_NEON)) + #define JUCE_USE_ARM_NEON 1 +#endif + +#if TARGET_IPHONE_SIMULATOR + #ifdef JUCE_USE_ARM_NEON + #undef JUCE_USE_ARM_NEON + #endif + #define JUCE_USE_ARM_NEON 0 +#endif + +//============================================================================== #include "buffers/juce_AudioDataConverters.h" #include "buffers/juce_FloatVectorOperations.h" #include "buffers/juce_AudioSampleBuffer.h" diff --git a/modules/juce_core/system/juce_TargetPlatform.h b/modules/juce_core/system/juce_TargetPlatform.h index ae9d7e1947..5eb1de8102 100644 --- a/modules/juce_core/system/juce_TargetPlatform.h +++ b/modules/juce_core/system/juce_TargetPlatform.h @@ -172,7 +172,7 @@ #define JUCE_32BIT 1 #endif - #if defined (__arm__) || defined (__arm64__) + #if defined (__arm__) || defined (__arm64__) || defined (__aarch64__) #define JUCE_ARM 1 #elif __MMX__ || __SSE__ || __amd64__ #define JUCE_INTEL 1 From 0149ed4014453fe652bb6b59510e735a1586cba1 Mon Sep 17 00:00:00 2001 From: hogliux Date: Fri, 13 Oct 2017 11:03:27 +0100 Subject: [PATCH 7/7] ARM: Don't change rounding mode when disabling denormals --- .../juce_audio_basics/buffers/juce_FloatVectorOperations.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/juce_audio_basics/buffers/juce_FloatVectorOperations.cpp b/modules/juce_audio_basics/buffers/juce_FloatVectorOperations.cpp index 9c3316c3d5..7faffabd07 100644 --- a/modules/juce_audio_basics/buffers/juce_FloatVectorOperations.cpp +++ b/modules/juce_audio_basics/buffers/juce_FloatVectorOperations.cpp @@ -1090,7 +1090,7 @@ void JUCE_CALLTYPE FloatVectorOperations::disableDenormalisedNumberSupport() noe #if JUCE_USE_SSE_INTRINSICS intptr_t mask = 0x8040; #else /*JUCE_USE_ARM_NEON*/ - intptr_t mask = (1 << 24 /* FZ */) | (1 << 23 /* RMODE_1 */) | (1 << 22 /* RMODE_0 */); + intptr_t mask = (1 << 24 /* FZ */); #endif setFpStatusRegister (getFpStatusRegister() | mask); @@ -1107,7 +1107,7 @@ ScopedNoDenormals::ScopedNoDenormals() noexcept #if JUCE_USE_SSE_INTRINSICS intptr_t mask = 0x8040; #else /*JUCE_USE_ARM_NEON*/ - intptr_t mask = (1 << 24 /* FZ */) | (1 << 23 /* RMODE_1 */) | (1 << 22 /* RMODE_0 */); + intptr_t mask = (1 << 24 /* FZ */); #endif fpsr = FloatVectorOperations::getFpStatusRegister();