diff options
author | Werner Schweer <ws.seh.de> | 2007-04-19 16:00:28 +0000 |
---|---|---|
committer | Werner Schweer <ws.seh.de> | 2007-04-19 16:00:28 +0000 |
commit | a328390d794b66a2c47b72b7dc0a3c8b7bff82ca (patch) | |
tree | 9a43d16210a8411761707494c5cb52a72085033d /muse/al | |
parent | 6966b30f75f329cef03baa6554a667895864b8c0 (diff) |
updates
Diffstat (limited to 'muse/al')
-rw-r--r-- | muse/al/dsp.cpp | 10 | ||||
-rw-r--r-- | muse/al/dsp.h | 9 |
2 files changed, 9 insertions, 10 deletions
diff --git a/muse/al/dsp.cpp b/muse/al/dsp.cpp index b9032443..7fb41fe7 100644 --- a/muse/al/dsp.cpp +++ b/muse/al/dsp.cpp @@ -93,15 +93,7 @@ void initDsp() unsigned long useSSE = 0; #ifdef __x86_64__ - asm ( - "pushq %%rbx\n" - "movq $1, %%rax\n" - "cpuid\n" - "movq %%rdx, %0\n" - "popq %%rbx\n" - : "=r" (useSSE) - : - : "%rax", "%rcx", "%rdx", "memory"); + useSSE = 1 << 25; // we know the platform has SSE #else asm ( "mov $1, %%eax\n" diff --git a/muse/al/dsp.h b/muse/al/dsp.h index d8da11dc..6c7123ac 100644 --- a/muse/al/dsp.h +++ b/muse/al/dsp.h @@ -23,7 +23,6 @@ namespace AL { - //--------------------------------------------------------- // f_max //--------------------------------------------------------- @@ -65,6 +64,14 @@ class Dsp { for (unsigned i = 0; i < n; ++i) dst[i] += src[i]; } + virtual void cpy(float* dst, float* src, unsigned n) { +#if defined(ARCH_X86) || defined(ARCH_X86_64) + register unsinged long int dummy; + __asm__ __volatile__ "rep; movsl" :"=&D"(dst), "=&S"(src), "=&c"(dummy) :"0" (to), "1" (from),"2" (n) : "memory"); +#else + memcpy(dst, src, sizeof(float) * n); +#endif + } }; extern void initDsp(); |