Start updating to rack2.4 simd usage, and official darkMode API

Signed-off-by: falkTX <falktx@falktx.com>
This commit is contained in:
falkTX 2023-12-17 13:15:52 +01:00
parent 438a446c04
commit 1895052e17
No known key found for this signature in database
GPG key ID: CDBAA37ABC74FBA0
23 changed files with 283 additions and 264 deletions

View file

@ -36,12 +36,6 @@
namespace rack {
#ifndef HEADLESS
namespace asset {
void updateForcingBlackSilverScrewMode(std::string slug);
}
#endif
struct CardinalPluginModelHelper : plugin::Model {
virtual app::ModuleWidget* createModuleWidgetFromEngineLoad(engine::Module* m) = 0;
virtual void removeCachedModuleWidget(engine::Module* m) = 0;
@ -78,9 +72,6 @@ struct CardinalPluginModel : CardinalPluginModelHelper
}
tm = dynamic_cast<TModule*>(m);
}
#ifndef HEADLESS
asset::updateForcingBlackSilverScrewMode(slug);
#endif
app::ModuleWidget* const tmw = new TModuleWidget(tm);
DISTRHO_CUSTOM_SAFE_ASSERT_RETURN(m != nullptr ? m->model->name.c_str() : "null", tmw->module == m, nullptr);
tmw->setModel(this);
@ -95,9 +86,6 @@ struct CardinalPluginModel : CardinalPluginModelHelper
TModule* const tm = dynamic_cast<TModule*>(m);
DISTRHO_SAFE_ASSERT_RETURN(tm != nullptr, nullptr);
#ifndef HEADLESS
asset::updateForcingBlackSilverScrewMode(slug);
#endif
TModuleWidget* const tmw = new TModuleWidget(tm);
DISTRHO_SAFE_ASSERT_RETURN(tmw->module == m, nullptr);
tmw->setModel(this);

View file

@ -1,6 +1,6 @@
/*
* DISTRHO Cardinal Plugin
* Copyright (C) 2021-2022 Filipe Coelho <falktx@falktx.com>
* Copyright (C) 2021-2023 Filipe Coelho <falktx@falktx.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@ -22,7 +22,6 @@
namespace rack {
namespace settings {
extern bool darkMode;
extern int rateLimit;
} // namespace settings

View file

@ -17,41 +17,21 @@
#pragma once
#if (defined(__i386__) || defined(__x86_64__)) && !defined(CARDINAL_NOSIMD)
#if (defined(__i386__) || defined(__x86_64__) || defined(__EMSCRIPTEN__)) && !defined(CARDINAL_NOSIMD)
# include_next <pmmintrin.h>
// bring in extra SSE3 support via simde
# define SIMDE_X86_SSE2_NATIVE
# define SIMDE_X86_SSE3_ENABLE_NATIVE_ALIASES
// make sure to not include windows.h here
# ifdef _WIN32
# define _WIN32_WAS_DEFINED
# undef _WIN32
# endif
// assume SSE3 only on macOS
# ifndef ARCH_MAC
# include "simde/x86/sse3.h"
# endif
# ifdef _WIN32_WAS_DEFINED
# define _WIN32
# undef _WIN32_WAS_DEFINED
# endif
# undef SIMDE_X86_SSE2_NATIVE
# undef SIMDE_X86_SSE3_ENABLE_NATIVE_ALIASES
#elif defined(__EMSCRIPTEN__) && !defined(CARDINAL_NOSIMD)
# include_next <pmmintrin.h>
# if defined(__EMSCRIPTEN__) && !defined(CARDINAL_NOSIMD)
static __inline__ __m64 __attribute__((__always_inline__, __nodebug__))
_mm_set1_pi16(short w)
{
return __extension__ (__m64){ static_cast<float>(w), static_cast<float>(w) };
}
# endif
#else
# define SIMDE_ENABLE_NATIVE_ALIASES
# include "simde/x86/sse.h"
# include "simde/x86/sse2.h"
# include "simde/x86/sse3.h"
# undef SIMDE_ENABLE_NATIVE_ALIASES
/*
#elif defined(__ARM_NEON)
# include "../sse2neon/sse2neon.h"
@ -68,11 +48,4 @@ __m64 _mm_set1_pi16(short w)
return vreinterpret_s64_s16(vdup_n_s16(w));
}
*/
#else
# define SIMDE_ENABLE_NATIVE_ALIASES
# include "simde/x86/sse.h"
# include "simde/x86/sse2.h"
# include "simde/x86/sse3.h"
# undef SIMDE_ENABLE_NATIVE_ALIASES
#endif

View file

@ -1,6 +1,6 @@
/*
* DISTRHO Cardinal Plugin
* Copyright (C) 2021-2022 Filipe Coelho <falktx@falktx.com>
* Copyright (C) 2021-2023 Filipe Coelho <falktx@falktx.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@ -17,7 +17,7 @@
/**
* This file is an edited version of VCVRack's simd/Vector.hpp
* Copyright (C) 2016-2021 VCV.
* Copyright (C) 2016-2023 VCV.
*
* This program is free software: you can redistribute it and/or
* modify it under the terms of the GNU General Public License as

8
include/simd/common.hpp Normal file
View file

@ -0,0 +1,8 @@
#pragma once
#ifdef __SSE4_2__
#include <nmmintrin.h>
#else
#define SIMDE_ENABLE_NATIVE_ALIASES
#include <simde/x86/sse4.2.h>
#endif