From a328390d794b66a2c47b72b7dc0a3c8b7bff82ca Mon Sep 17 00:00:00 2001 From: Werner Schweer Date: Thu, 19 Apr 2007 16:00:28 +0000 Subject: updates --- muse/al/dsp.cpp | 10 +--------- muse/al/dsp.h | 9 ++++++++- 2 files changed, 9 insertions(+), 10 deletions(-) (limited to 'muse/al') 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(); -- cgit v1.2.3