aboutsummaryrefslogtreecommitdiff
path: root/externals/grill/flext
diff options
context:
space:
mode:
authorThomas Grill <xovo@users.sourceforge.net>2003-05-17 02:32:51 +0000
committerThomas Grill <xovo@users.sourceforge.net>2003-05-17 02:32:51 +0000
commitb84b298888b12a3c00ffd6cabd5b39a5937e1347 (patch)
tree5c6c26a16cff9f83619b8d3d1be6b2fd91b21d4d /externals/grill/flext
parent8b042a66a4fd811589412747e38e8c7ee784db3c (diff)
""
svn path=/trunk/; revision=625
Diffstat (limited to 'externals/grill/flext')
-rw-r--r--externals/grill/flext/flext.dsp12
-rw-r--r--externals/grill/flext/flext_sh.dsp8
-rwxr-xr-xexternals/grill/flext/source/flprefix.h7
-rwxr-xr-xexternals/grill/flext/source/flsimd.cpp209
-rwxr-xr-xexternals/grill/flext/tutorial/timer1/main.cpp4
-rwxr-xr-xexternals/grill/flext/tutorial/timer1/timer1.dsp26
-rw-r--r--externals/grill/flext/tutorial/tutorial.dsw16
7 files changed, 231 insertions, 51 deletions
diff --git a/externals/grill/flext/flext.dsp b/externals/grill/flext/flext.dsp
index d000aacf..1af59948 100644
--- a/externals/grill/flext/flext.dsp
+++ b/externals/grill/flext/flext.dsp
@@ -45,7 +45,7 @@ RSC=rc.exe
# PROP Intermediate_Dir "pd-msvc\s"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
-# ADD CPP /nologo /W3 /GR /GX /O2 /I "c:\programme\audio\pd\src" /I "f:\prog\audio\sndobj\include" /I "f:\prog\audio\stk\include" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /D FLEXT_SYS=2 /YX"flext.h" /FD /c
+# ADD CPP /nologo /W3 /GR /GX /O2 /I "c:\programme\audio\pd\src" /I "f:\prog\audio\sndobj\include" /I "f:\prog\audio\stk\include" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /D FLEXT_SYS=2 /D "FLEXT_USE_SIMD" /YX"flext.h" /FD /c
# ADD BASE RSC /l 0xc07 /d "NDEBUG"
# ADD RSC /l 0xc07 /d "NDEBUG"
BSC32=bscmake.exe
@@ -68,7 +68,7 @@ LIB32=link.exe -lib
# PROP Intermediate_Dir "pd-msvc\sd"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
-# ADD CPP /nologo /W3 /Gm /GR /GX /ZI /Od /I "c:\programme\audio\pd\src" /I "f:\prog\audio\sndobj\include" /I "f:\prog\audio\stk\include" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /D FLEXT_SYS=2 /FR /YX"flext.h" /FD /GZ /c
+# ADD CPP /nologo /W3 /Gm /GR /GX /ZI /Od /I "c:\programme\audio\pd\src" /I "f:\prog\audio\sndobj\include" /I "f:\prog\audio\stk\include" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /D FLEXT_SYS=2 /D "FLEXT_USE_SIMD" /FR /YX"flext.h" /FD /GZ /c
# ADD BASE RSC /l 0xc07 /d "_DEBUG"
# ADD RSC /l 0xc07 /d "_DEBUG"
BSC32=bscmake.exe
@@ -91,7 +91,7 @@ LIB32=link.exe -lib
# PROP Intermediate_Dir "pd-msvc\td"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MTd /W3 /Gm /GR /ZI /Od /I "c:\programme\audio\pd\src" /I "." /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /D "PD" /D "NT" /D "FLEXT_THREADS" /FR /YX /FD /GZ /c
-# ADD CPP /nologo /MTd /W3 /Gm /GR /GX /ZI /Od /I "c:\programme\audio\pd\src" /I "f:\prog\audio\sndobj\include" /I "f:\prog\audio\stk\include" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /D "FLEXT_SYS_PD" /D "FLEXT_THREADS" /FR /YX"flext.h" /FD /GZ /c
+# ADD CPP /nologo /MTd /W3 /Gm /GR /GX /ZI /Od /I "c:\programme\audio\pd\src" /I "f:\prog\audio\sndobj\include" /I "f:\prog\audio\stk\include" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /D "FLEXT_SYS_PD" /D "FLEXT_THREADS" /D "FLEXT_USE_SIMD" /FR /YX"flext.h" /FD /GZ /c
# ADD BASE RSC /l 0xc07 /d "_DEBUG"
# ADD RSC /l 0xc07 /d "_DEBUG"
BSC32=bscmake.exe
@@ -114,7 +114,7 @@ LIB32=link.exe -lib
# PROP Intermediate_Dir "pd-msvc\t"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MT /W3 /GR /O2 /I "c:\programme\audio\pd\src" /I "." /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /D "PD" /D "NT" /D "FLEXT_THREADS" /YX /FD /c
-# ADD CPP /nologo /MT /W3 /GR /GX /O2 /I "c:\programme\audio\pd\src" /I "f:\prog\audio\sndobj\include" /I "f:\prog\audio\stk\include" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /D FLEXT_SYS=2 /D "FLEXT_THREADS" /YX"flext.h" /FD /c
+# ADD CPP /nologo /MT /W3 /GR /GX /O2 /I "c:\programme\audio\pd\src" /I "f:\prog\audio\sndobj\include" /I "f:\prog\audio\stk\include" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /D FLEXT_SYS=2 /D "FLEXT_THREADS" /D "FLEXT_USE_SIMD" /YX"flext.h" /FD /c
# ADD BASE RSC /l 0xc07 /d "NDEBUG"
# ADD RSC /l 0xc07 /d "NDEBUG"
BSC32=bscmake.exe
@@ -137,7 +137,7 @@ LIB32=link.exe -lib
# PROP Intermediate_Dir "pd-msvc\tdl"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MTd /W3 /Gm /ZI /Od /I "c:\programme\audio\pd\src" /I "f:\prog\audio\sndobj\include" /I "f:\prog\audio\stk\include" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /D "FLEXT_SYS_PD" /D "FLEXT_THREADS" /FR /YX"flext.h" /FD /GZ /c
-# ADD CPP /nologo /MDd /W3 /Gm /GR /GX /ZI /Od /I "c:\programme\audio\pd\src" /I "f:\prog\audio\sndobj\include" /I "f:\prog\audio\stk\include" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /D "FLEXT_SYS_PD" /D "FLEXT_THREADS" /FR /YX"flext.h" /FD /GZ /c
+# ADD CPP /nologo /MDd /W3 /Gm /GR /GX /ZI /Od /I "c:\programme\audio\pd\src" /I "f:\prog\audio\sndobj\include" /I "f:\prog\audio\stk\include" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /D "FLEXT_SYS_PD" /D "FLEXT_THREADS" /D "FLEXT_USE_SIMD" /FR /YX"flext.h" /FD /GZ /c
# ADD BASE RSC /l 0xc07 /d "_DEBUG"
# ADD RSC /l 0xc07 /d "_DEBUG"
BSC32=bscmake.exe
@@ -160,7 +160,7 @@ LIB32=link.exe -lib
# PROP Intermediate_Dir "pd-msvc\trl"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MT /W3 /O2 /I "c:\programme\audio\pd\src" /I "f:\prog\audio\sndobj\include" /I "f:\prog\audio\stk\include" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /D FLEXT_SYS=2 /D "FLEXT_THREADS" /YX"flext.h" /FD /c
-# ADD CPP /nologo /MD /W3 /GR /GX /O2 /I "c:\programme\audio\pd\src" /I "f:\prog\audio\sndobj\include" /I "f:\prog\audio\stk\include" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /D FLEXT_SYS=2 /D "FLEXT_THREADS" /YX"flext.h" /FD /c
+# ADD CPP /nologo /MD /W3 /GR /GX /O2 /I "c:\programme\audio\pd\src" /I "f:\prog\audio\sndobj\include" /I "f:\prog\audio\stk\include" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /D FLEXT_SYS=2 /D "FLEXT_THREADS" /D "FLEXT_USE_SIMD" /YX"flext.h" /FD /c
# ADD BASE RSC /l 0xc07 /d "NDEBUG"
# ADD RSC /l 0xc07 /d "NDEBUG"
BSC32=bscmake.exe
diff --git a/externals/grill/flext/flext_sh.dsp b/externals/grill/flext/flext_sh.dsp
index 73db4e31..35c604b6 100644
--- a/externals/grill/flext/flext_sh.dsp
+++ b/externals/grill/flext/flext_sh.dsp
@@ -45,7 +45,7 @@ RSC=rc.exe
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "FLEXT_SH_EXPORTS" /YX /FD /c
-# ADD CPP /nologo /G6 /MT /W3 /GR /GX /O2 /I "c:\programme\audio\pd\src" /I "f:\prog\audio\sndobj\include" /I "f:\prog\audio\stk\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "FLEXT_DLL" /D FLEXT_SYS=2 /D "FLEXT_SHARED" /D "FLEXT_THREADS" /YX /FD /c
+# ADD CPP /nologo /G6 /MT /W3 /GR /GX /O2 /I "c:\programme\audio\pd\src" /I "f:\prog\audio\sndobj\include" /I "f:\prog\audio\stk\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "FLEXT_DLL" /D FLEXT_SYS=2 /D "FLEXT_SHARED" /D "FLEXT_THREADS" /D "FLEXT_USE_SIMD" /YX /FD /c
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0xc07 /d "NDEBUG"
@@ -72,7 +72,7 @@ LINK32=link.exe
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "FLEXT_SH_EXPORTS" /YX /FD /GZ /c
-# ADD CPP /nologo /G6 /MTd /W3 /Gm /GR /GX /ZI /Od /I "c:\programme\audio\pd\src" /I "f:\prog\audio\sndobj\include" /I "f:\prog\audio\stk\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "FLEXT_DLL" /D "FLEXT_SHARED" /D FLEXT_SYS=2 /D "FLEXT_THREADS" /YX /FD /GZ /c
+# ADD CPP /nologo /G6 /MTd /W3 /Gm /GR /GX /ZI /Od /I "c:\programme\audio\pd\src" /I "f:\prog\audio\sndobj\include" /I "f:\prog\audio\stk\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "FLEXT_DLL" /D "FLEXT_SHARED" /D FLEXT_SYS=2 /D "FLEXT_THREADS" /D "FLEXT_USE_SIMD" /FR /YX /FD /GZ /c
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0xc07 /d "_DEBUG"
@@ -99,7 +99,7 @@ LINK32=link.exe
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /G6 /MDd /W3 /Gm /GR /GX /ZI /Od /I "c:\programme\audio\pd\src" /I "f:\prog\audio\sndobj\include" /I "f:\prog\audio\stk\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "FLEXT_DLL" /D "FLEXT_SHARED" /D FLEXT_SYS=2 /D "FLEXT_THREADS" /YX /FD /GZ /c
-# ADD CPP /nologo /G6 /MDd /W3 /Gm /GR /GX /ZI /Od /I "c:\programme\audio\pd\src" /I "f:\prog\audio\sndobj\include" /I "f:\prog\audio\stk\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "FLEXT_DLL" /D "FLEXT_SHARED" /D FLEXT_SYS=2 /D "FLEXT_THREADS" /YX /FD /GZ /c
+# ADD CPP /nologo /G6 /MDd /W3 /Gm /GR /GX /ZI /Od /I "c:\programme\audio\pd\src" /I "f:\prog\audio\sndobj\include" /I "f:\prog\audio\stk\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "FLEXT_DLL" /D "FLEXT_SHARED" /D FLEXT_SYS=2 /D "FLEXT_THREADS" /D "FLEXT_USE_SIMD" /FR /YX /FD /GZ /c
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0xc07 /d "_DEBUG"
@@ -126,7 +126,7 @@ LINK32=link.exe
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /G6 /MD /W3 /GR /GX /O2 /I "c:\programme\audio\pd\src" /I "f:\prog\audio\sndobj\include" /I "f:\prog\audio\stk\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "FLEXT_DLL" /D FLEXT_SYS=2 /D "FLEXT_SHARED" /D "FLEXT_THREADS" /YX /FD /c
-# ADD CPP /nologo /G6 /MD /W3 /GR /GX /O2 /I "c:\programme\audio\pd\src" /I "f:\prog\audio\sndobj\include" /I "f:\prog\audio\stk\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "FLEXT_DLL" /D FLEXT_SYS=2 /D "FLEXT_SHARED" /D "FLEXT_THREADS" /YX /FD /c
+# ADD CPP /nologo /G6 /MD /W3 /GR /GX /O2 /I "c:\programme\audio\pd\src" /I "f:\prog\audio\sndobj\include" /I "f:\prog\audio\stk\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "FLEXT_DLL" /D FLEXT_SYS=2 /D "FLEXT_SHARED" /D "FLEXT_THREADS" /D "FLEXT_USE_SIMD" /YX /FD /c
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0xc07 /d "NDEBUG"
diff --git a/externals/grill/flext/source/flprefix.h b/externals/grill/flext/source/flprefix.h
index 67046319..dae6822c 100755
--- a/externals/grill/flext/source/flprefix.h
+++ b/externals/grill/flext/source/flprefix.h
@@ -99,8 +99,9 @@ WARRANTIES, see the file, "license.txt," in this distribution.
#endif
// Definition of OS/CPU
-#if defined(_MSC_VER)
+#if defined(_MSC_VER) || (defined(__ICC) && (FLEXT_OS == FLEXT_OS_WIN || defined(_WIN32)))
// Microsoft C++
+ // and Intel C++ (as guessed)
#ifndef FLEXT_CPU
#if defined(_M_IX86)
@@ -193,8 +194,10 @@ WARRANTIES, see the file, "license.txt," in this distribution.
// This is important for everything
#pragma bool on
-#elif defined(__GNUG__)
+#elif defined(__GNUG__) || (defined(__ICC) && (FLEXT_OS == FLEXT_OS_LINUX || defined(linux) || defined(__linux__)))
+
// GNU C++
+ // and Intel (as suggested by Tim Blechmann)
#ifndef FLEXT_CPU
#if defined(_X86_) || defined(__i386__) || defined(__i586__) || defined(__i686__)
diff --git a/externals/grill/flext/source/flsimd.cpp b/externals/grill/flext/source/flsimd.cpp
index f5db9f5e..bebf3d97 100755
--- a/externals/grill/flext/source/flsimd.cpp
+++ b/externals/grill/flext/source/flsimd.cpp
@@ -9,7 +9,12 @@ WARRANTIES, see the file, "license.txt," in this distribution.
*/
/*! \file flsimd.cpp
- \brief flext SIMD support functions
+ \brief flext SIMD support functions
+
+ If FLEXT_USE_SIMD is defined at compilation, SIMD instructions are used wherever feasible.
+ If used with MSVC++ the "Processor Pack" must be installed.
+
+ If FLEXT_USE_IPP is defined the Intel Performance Package is used.
*/
#include "flext.h"
@@ -19,14 +24,22 @@ WARRANTIES, see the file, "license.txt," in this distribution.
#include <windows.h>
#endif
-#if FLEXT_CPU == FLEXT_CPU_PPC && defined(__MWERKS__)
-#include "Altivec.h"
-#endif
-
#ifdef FLEXT_USE_IPP
#include <ipps.h>
#endif
+#ifdef FLEXT_USE_SIMD
+ #ifdef _MSC_VER
+ // include MSVC SIMD header files
+ #include <mmintrin.h> // MMX
+ #include <xmmintrin.h> // SSE
+ #include <emmintrin.h> // SSE2
+ #include <mm3dnow.h> // 3DNow!
+ #elif FLEXT_CPU == FLEXT_CPU_PPC && defined(__MWERKS__)
+ #include "Altivec.h"
+ #endif
+#endif // FLEXT_USE_SIMD
+
static unsigned long setsimdcaps();
/*! \brief Holds SIMD capability flags
@@ -37,6 +50,7 @@ unsigned long flext::simdcaps = setsimdcaps();
unsigned long flext::GetSIMDCapabilities() { return simdcaps; }
+#ifdef FLEXT_USE_SIMD
#if FLEXT_CPU == FLEXT_CPU_INTEL
@@ -247,6 +261,10 @@ static unsigned long setsimdcaps()
return simdflags;
}
+#else // FLEXT_USE_SIMD
+static unsigned long setsimdcaps() { return 0; }
+#endif // FLEXT_USE_SIMD
+
void flext::CopySamples(t_sample *dst,const t_sample *src,int cnt)
{
@@ -258,17 +276,89 @@ void flext::CopySamples(t_sample *dst,const t_sample *src,int cnt)
else
ERRINTERNAL();
#else
- int n = cnt>>3;
- cnt -= n<<3;
- while(n--) {
- dst[0] = src[0]; dst[1] = src[1];
- dst[2] = src[2]; dst[3] = src[3];
- dst[4] = src[4]; dst[5] = src[5];
- dst[6] = src[6]; dst[7] = src[7];
- src += 8,dst += 8;
- }
-
- while(cnt--) *(dst++) = *(src++);
+#ifdef FLEXT_USE_SIMD
+#ifdef _MSC_VER
+#if 1 // t_sample is float
+ if(GetSIMDCapabilities()&simd_sse) {
+ // single precision
+
+ int n = cnt>>4;
+ cnt -= n<<4;
+
+ if((reinterpret_cast<unsigned long>(src)&(__alignof(t_sample)-1)) == 0
+ && (reinterpret_cast<unsigned long>(dst)&(__alignof(t_sample)-1)) == 0
+ ) {
+ // aligned version
+ while(n--) {
+ _mm_store_ps(dst+0,_mm_load_ps(src+0));
+ _mm_store_ps(dst+4,_mm_load_ps(src+4));
+ _mm_store_ps(dst+8,_mm_load_ps(src+8));
+ _mm_store_ps(dst+12,_mm_load_ps(src+12));
+ src += 16,dst += 16;
+ }
+ }
+ else {
+ // unaligned version
+ while(n--) {
+ _mm_storeu_ps(dst+0,_mm_loadu_ps(src+0));
+ _mm_storeu_ps(dst+4,_mm_loadu_ps(src+4));
+ _mm_storeu_ps(dst+8,_mm_loadu_ps(src+8));
+ _mm_storeu_ps(dst+12,_mm_loadu_ps(src+12));
+ src += 16,dst += 16;
+ }
+ }
+ while(cnt--) *(dst++) = *(src++);
+ }
+ else
+#elif 0 // t_sample is double
+ if(GetSIMDCapabilities()&simd_sse2) {
+ // double precision
+
+ int n = cnt>>3;
+ cnt -= n<<3;
+
+ if((reinterpret_cast<unsigned long>(src)&(__alignof(t_sample)-1)) == 0
+ && (reinterpret_cast<unsigned long>(dst)&(__alignof(t_sample)-1)) == 0
+ ) {
+ // aligned version
+ while(n--) {
+ _mm_store_pd(dst+0,_mm_load_pd(src+0));
+ _mm_store_pd(dst+2,_mm_load_pd(src+2));
+ _mm_store_pd(dst+4,_mm_load_pd(src+4));
+ _mm_store_pd(dst+6,_mm_load_pd(src+6));
+ src += 8,dst += 8;
+ }
+ }
+ else {
+ // unaligned version
+ while(n--) {
+ _mm_storeu_pd(dst+0,_mm_loadu_pd(src+0));
+ _mm_storeu_pd(dst+2,_mm_loadu_pd(src+2));
+ _mm_storeu_pd(dst+4,_mm_loadu_pd(src+4));
+ _mm_storeu_pd(dst+6,_mm_loadu_pd(src+6));
+ src += 8,dst += 8;
+ }
+ }
+ while(cnt--) *(dst++) = *(src++);
+ }
+ else
+#else
+ #error t_sample data type has illegal size
+#endif
+#endif // _MSC_VER
+#endif // FLEXT_USE_SIMD
+ {
+ int n = cnt>>3;
+ cnt -= n<<3;
+ while(n--) {
+ dst[0] = src[0]; dst[1] = src[1];
+ dst[2] = src[2]; dst[3] = src[3];
+ dst[4] = src[4]; dst[5] = src[5];
+ dst[6] = src[6]; dst[7] = src[7];
+ src += 8,dst += 8;
+ }
+ while(cnt--) *(dst++) = *(src++);
+ }
#endif
}
@@ -282,13 +372,84 @@ void flext::SetSamples(t_sample *dst,int cnt,t_sample s)
else
ERRINTERNAL();
#else
- int n = cnt>>3;
- cnt -= n<<3;
- while(n--) {
- dst[0] = dst[1] = dst[2] = dst[3] = dst[4] = dst[5] = dst[6] = dst[7] = s;
- dst += 8;
- }
-
- while(cnt--) *(dst++) = s;
+#ifdef FLEXT_USE_SIMD
+#ifdef _MSC_VER
+#if 1 // t_sample is float
+ if(GetSIMDCapabilities()&simd_sse) {
+ // single precision
+
+ __m128 v = _mm_load1_ps(&s);
+ int n = cnt>>4;
+ cnt -= n<<4;
+
+ if((reinterpret_cast<unsigned long>(dst)&(__alignof(t_sample)-1)) == 0) {
+ // aligned version
+ while(n--) {
+ _mm_store_ps(dst+0,v);
+ _mm_store_ps(dst+4,v);
+ _mm_store_ps(dst+8,v);
+ _mm_store_ps(dst+12,v);
+ dst += 16;
+ }
+ }
+ else {
+ // unaligned version
+ while(n--) {
+ _mm_storeu_ps(dst+0,v);
+ _mm_storeu_ps(dst+4,v);
+ _mm_storeu_ps(dst+8,v);
+ _mm_storeu_ps(dst+12,v);
+ dst += 16;
+ }
+ }
+ while(cnt--) *(dst++) = s;
+ }
+ else
+#elif 0 // t_sample is double
+ if(GetSIMDCapabilities()&simd_sse2) {
+ // double precision
+
+ __m128 v = _mm_load1_pd(&s);
+ int n = cnt>>3;
+ cnt -= n<<3;
+
+ if((reinterpret_cast<unsigned long>(dst)&(__alignof(t_sample)-1)) == 0) {
+ // aligned version
+ while(n--) {
+ _mm_store_pd(dst+0,v);
+ _mm_store_pd(dst+2,v);
+ _mm_store_pd(dst+4,v);
+ _mm_store_pd(dst+8,v);
+ dst += 8;
+ }
+ }
+ else {
+ // unaligned version
+ while(n--) {
+ _mm_storeu_pd(dst+0,v);
+ _mm_storeu_pd(dst+2,v);
+ _mm_storeu_pd(dst+4,v);
+ _mm_storeu_pd(dst+8,v);
+ dst += 8;
+ }
+ }
+ while(cnt--) *(dst++) = s;
+ }
+ else
+#else
+ #error t_sample data type has illegal size
+#endif
+#endif // _MSC_VER
+#endif // FLEXT_USE_SIMD
+ {
+ int n = cnt>>3;
+ cnt -= n<<3;
+ while(n--) {
+ dst[0] = dst[1] = dst[2] = dst[3] = dst[4] = dst[5] = dst[6] = dst[7] = s;
+ dst += 8;
+ }
+
+ while(cnt--) *(dst++) = s;
+ }
#endif
}
diff --git a/externals/grill/flext/tutorial/timer1/main.cpp b/externals/grill/flext/tutorial/timer1/main.cpp
index 6388eb4a..d751c784 100755
--- a/externals/grill/flext/tutorial/timer1/main.cpp
+++ b/externals/grill/flext/tutorial/timer1/main.cpp
@@ -39,8 +39,8 @@ protected:
// timers
Timer tmrA,tmrB;
- void m_getostime(float &f) { f = GetOSTime(); } // method for operating system time attribute
- void m_getrttime(float &f) { f = GetTime(); } // method for real-time system time attribute
+ void m_getostime(float &f) { f = (float)GetOSTime(); } // method for operating system time attribute
+ void m_getrttime(float &f) { f = (float)GetTime(); } // method for real-time system time attribute
void m_timerA(void *) { ToOutString(0,"Timer A"); } // timer A method
void m_timerB(void *) { ToOutString(0,"Timer B"); } // timer B method
diff --git a/externals/grill/flext/tutorial/timer1/timer1.dsp b/externals/grill/flext/tutorial/timer1/timer1.dsp
index 35716adc..4c8be353 100755
--- a/externals/grill/flext/tutorial/timer1/timer1.dsp
+++ b/externals/grill/flext/tutorial/timer1/timer1.dsp
@@ -1,35 +1,35 @@
-# Microsoft Developer Studio Project File - Name="simple1" - Package Owner=<4>
+# Microsoft Developer Studio Project File - Name="timer1" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** NICHT BEARBEITEN **
# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-CFG=simple1 - Win32 Debug
+CFG=timer1 - Win32 Debug
!MESSAGE Dies ist kein gültiges Makefile. Zum Erstellen dieses Projekts mit NMAKE
!MESSAGE verwenden Sie den Befehl "Makefile exportieren" und führen Sie den Befehl
!MESSAGE
-!MESSAGE NMAKE /f "simple1.mak".
+!MESSAGE NMAKE /f "timer1.mak".
!MESSAGE
!MESSAGE Sie können beim Ausführen von NMAKE eine Konfiguration angeben
!MESSAGE durch Definieren des Makros CFG in der Befehlszeile. Zum Beispiel:
!MESSAGE
-!MESSAGE NMAKE /f "simple1.mak" CFG="simple1 - Win32 Debug"
+!MESSAGE NMAKE /f "timer1.mak" CFG="timer1 - Win32 Debug"
!MESSAGE
!MESSAGE Für die Konfiguration stehen zur Auswahl:
!MESSAGE
-!MESSAGE "simple1 - Win32 Release" (basierend auf "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "simple1 - Win32 Debug" (basierend auf "Win32 (x86) Dynamic-Link Library")
+!MESSAGE "timer1 - Win32 Release" (basierend auf "Win32 (x86) Dynamic-Link Library")
+!MESSAGE "timer1 - Win32 Debug" (basierend auf "Win32 (x86) Dynamic-Link Library")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName "simple1"
+# PROP Scc_ProjName "timer1"
# PROP Scc_LocalPath "."
CPP=cl.exe
MTL=midl.exe
RSC=rc.exe
-!IF "$(CFG)" == "simple1 - Win32 Release"
+!IF "$(CFG)" == "timer1 - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
@@ -53,9 +53,9 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib /nologo /dll /machine:I386
-# ADD LINK32 kernel32.lib user32.lib pd.lib flext-pdwin.lib /nologo /dll /machine:I386 /out:"../pd-msvc/simple1.dll" /libpath:"..\..\pd-msvc"
+# ADD LINK32 kernel32.lib user32.lib pd.lib flext-pdwin.lib /nologo /dll /machine:I386 /out:"../pd-msvc/timer1.dll" /libpath:"..\..\pd-msvc"
-!ELSEIF "$(CFG)" == "simple1 - Win32 Debug"
+!ELSEIF "$(CFG)" == "timer1 - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
@@ -69,7 +69,7 @@ LINK32=link.exe
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /YX /FD /GZ /c
-# ADD CPP /nologo /W3 /Gm /ZI /Od /I "..\..\source" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PD" /Fr /YX /FD /GZ /c
+# ADD CPP /nologo /W3 /Gm /ZI /Od /I "c:\programme\audio\pd\src" /I "..\..\source" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PD" /Fr /YX /FD /GZ /c
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0xc07 /d "_DEBUG"
@@ -85,8 +85,8 @@ LINK32=link.exe
# Begin Target
-# Name "simple1 - Win32 Release"
-# Name "simple1 - Win32 Debug"
+# Name "timer1 - Win32 Release"
+# Name "timer1 - Win32 Debug"
# Begin Source File
SOURCE=.\main.cpp
diff --git a/externals/grill/flext/tutorial/tutorial.dsw b/externals/grill/flext/tutorial/tutorial.dsw
index 9fdef2da..28586ab7 100644
--- a/externals/grill/flext/tutorial/tutorial.dsw
+++ b/externals/grill/flext/tutorial/tutorial.dsw
@@ -291,6 +291,22 @@ Package=<4>
###############################################################################
+Project: "timer1"=.\timer1\timer1.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+ begin source code control
+ timer1
+ .\timer1
+ end source code control
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
Global:
Package=<5>