mirror of
https://github.com/mikeoliphant/neural-amp-modeler-lv2.git
synced 2026-05-10 04:30:14 +02:00
remove denorm code
This commit is contained in:
@@ -1,100 +0,0 @@
|
|||||||
#ifndef ARCHITECTURE_HPP
|
|
||||||
#define ARCHITECTURE_HPP
|
|
||||||
|
|
||||||
// check cpu architecture
|
|
||||||
|
|
||||||
#if /* x86_64 */ \
|
|
||||||
/* clang & gcc */ defined(__x86_64__) || \
|
|
||||||
/* msvc */ defined(_M_AMD64) \
|
|
||||||
|
|
||||||
#define ARCH_X86
|
|
||||||
#define ARCH_X86_64
|
|
||||||
|
|
||||||
#elif /* i386 */ \
|
|
||||||
/* clang & gcc */ defined(__i386__) || \
|
|
||||||
/* msvc */ defined(_M_IX86) \
|
|
||||||
|
|
||||||
#define ARCH_X86
|
|
||||||
#define ARCH_I386
|
|
||||||
|
|
||||||
#elif /* Arm64 */ \
|
|
||||||
/* clang & gcc */ defined(__aarch64__) || \
|
|
||||||
/* msvc */ defined(_M_ARM64) \
|
|
||||||
|
|
||||||
#define ARCH_ARM
|
|
||||||
#define ARCH_ARM64
|
|
||||||
|
|
||||||
#elif /* Arm */ \
|
|
||||||
/* clang & gcc */ defined(__arm__) || \
|
|
||||||
/* msvc */ defined(_M_ARM) \
|
|
||||||
|
|
||||||
#define ARCH_ARM
|
|
||||||
#define ARCH_ARM32
|
|
||||||
|
|
||||||
#else
|
|
||||||
#define ARCH_UNKNOWN
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
// check cpu extensions
|
|
||||||
|
|
||||||
/* clang & gcc */
|
|
||||||
#ifdef __SSE__
|
|
||||||
#define ARCH_EXT_SSE
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef __SSE2__
|
|
||||||
#define ARCH_EXT_SSE2
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef __SSE3__
|
|
||||||
#define ARCH_EXT_SSE3
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* msvc */
|
|
||||||
#if defined(ARCH_X86_64)
|
|
||||||
#define ARCH_EXT_SSE
|
|
||||||
#define ARCH_EXT_SSE2
|
|
||||||
|
|
||||||
// msvc doesn't seem to have anything for sse3 so I am just assuming
|
|
||||||
// it is supported
|
|
||||||
#define ARCH_EXT_SSE3
|
|
||||||
#elif defined(ARCH_I386)
|
|
||||||
#if _M_IX86_FP > 0
|
|
||||||
#define ARCH_EXT_SSE
|
|
||||||
#elif _M_IX86_FP > 1
|
|
||||||
#define ARCH_EXT_SSE3
|
|
||||||
#define ARCH_EXT_SSE2
|
|
||||||
#define ARCH_EXT_SSE
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
// misc functions
|
|
||||||
|
|
||||||
#ifdef ARCH_EXT_SSE
|
|
||||||
|
|
||||||
#include <cfenv>
|
|
||||||
#ifndef FE_DFL_DISABLE_SSE_DENORMS_ENV
|
|
||||||
#include <immintrin.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
inline void disable_denormals() noexcept {
|
|
||||||
|
|
||||||
#if defined(ARCH_EXT_SSE)
|
|
||||||
#ifdef FE_DFL_DISABLE_SSE_DENORMS_ENV
|
|
||||||
std::fesetenv(FE_DFL_DISABLE_SSE_DENORMS_ENV);
|
|
||||||
#else
|
|
||||||
_mm_setcsr(_mm_getcsr() | 0x8040);
|
|
||||||
#endif
|
|
||||||
#elif defined(ARCH_ARM)
|
|
||||||
#if __has_builtin(__builtin_arm_set_fpscr) && __has_builtin(__builtin_arm_get_fpscr)
|
|
||||||
__builtin_arm_set_fpscr(__builtin_arm_get_fpscr() | (1 << 24));
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
@@ -12,10 +12,6 @@
|
|||||||
|
|
||||||
#include "nam_plugin.hpp"
|
#include "nam_plugin.hpp"
|
||||||
|
|
||||||
#ifdef FORCE_DISABLE_DENORMALS
|
|
||||||
#include "architecture.hpp"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// LV2 Functions
|
// LV2 Functions
|
||||||
static LV2_Handle instantiate(
|
static LV2_Handle instantiate(
|
||||||
const LV2_Descriptor*,
|
const LV2_Descriptor*,
|
||||||
@@ -64,19 +60,7 @@ static void activate(LV2_Handle) {}
|
|||||||
|
|
||||||
static void run(LV2_Handle instance, uint32_t n_samples) {
|
static void run(LV2_Handle instance, uint32_t n_samples) {
|
||||||
|
|
||||||
#ifdef FORCE_DISABLE_DENORMALS
|
|
||||||
std::fenv_t fe_state;
|
|
||||||
std::feholdexcept(&fe_state);
|
|
||||||
|
|
||||||
disable_denormals();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static_cast<NAM::Plugin*>(instance)->process(n_samples);
|
static_cast<NAM::Plugin*>(instance)->process(n_samples);
|
||||||
|
|
||||||
#ifdef FORCE_DISABLE_DENORMALS
|
|
||||||
// restore previous floating point state
|
|
||||||
std::feupdateenv(&fe_state);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void deactivate(LV2_Handle) {}
|
static void deactivate(LV2_Handle) {}
|
||||||
|
|||||||
+1
-1
@@ -10,7 +10,7 @@
|
|||||||
namespace NAM {
|
namespace NAM {
|
||||||
Plugin::Plugin(float rate)
|
Plugin::Plugin(float rate)
|
||||||
{
|
{
|
||||||
namModel = get_dsp("C:\\Users\\oliph\\AppData\\Roaming\\GuitarSim\\NAM\\JCM2000Crunch.nam");
|
namModel = get_dsp("C:\\Users\\oliph\\AppData\\Roaming\\GuitarSim\\NAM\\AC15Brkup.nam");
|
||||||
}
|
}
|
||||||
|
|
||||||
void Plugin::map_uris(LV2_URID_Map* map) noexcept {
|
void Plugin::map_uris(LV2_URID_Map* map) noexcept {
|
||||||
|
|||||||
Reference in New Issue
Block a user