From 0fd4fb70a38cf964393eaebd223d8f204fc28993 Mon Sep 17 00:00:00 2001 From: sonarnerd Date: Sat, 10 Sep 2005 23:58:43 +0000 Subject: [PATCH] Fixed --enable-dynsimd parts to work with latest gcc releases when using -march=pentium4 git-svn-id: svn+ssh://jackaudio.org/trunk/jack@923 0c269be4-1314-0410-8aa9-9f06e86f4224 --- configure.ac | 2 +- jack/intsimd.h | 4 ++-- libjack/client.c | 34 ++++++++++++++++++++++------------ 3 files changed, 25 insertions(+), 15 deletions(-) diff --git a/configure.ac b/configure.ac index a86e944..7ca6d4e 100644 --- a/configure.ac +++ b/configure.ac @@ -15,7 +15,7 @@ dnl changes are made dnl --- JACK_MAJOR_VERSION=0 JACK_MINOR_VERSION=100 -JACK_MICRO_VERSION=5 +JACK_MICRO_VERSION=6 dnl --- dnl HOWTO: updating the jack protocol version diff --git a/jack/intsimd.h b/jack/intsimd.h index 2bfb394..4346eb8 100644 --- a/jack/intsimd.h +++ b/jack/intsimd.h @@ -22,9 +22,9 @@ #define __jack_intsimd_h__ #ifdef USE_DYNSIMD -#if (defined(__i686__) || defined(__x86_64__)) +#if (defined(__i386__) || defined(__x86_64__)) #define ARCH_X86 -#endif /* __i686__ || __x86_64__ */ +#endif /* __i386__ || __x86_64__ */ #endif /* USE_DYNSIMD */ #ifdef ARCH_X86 diff --git a/libjack/client.c b/libjack/client.c index 0383287..c977305 100644 --- a/libjack/client.c +++ b/libjack/client.c @@ -89,70 +89,77 @@ typedef struct { static int have_3dnow () { - int res = 0; + unsigned int res = 0; asm volatile ( "pushl %%ebx\n\t" \ "movl $0x80000000, %%eax\n\t" \ "cpuid\n\t" \ "cmpl $0x80000001, %%eax\n\t" \ - "jl tdnow_testexit\n\t" \ + "jl tdnow_prexit\n\t" \ \ "movl $0x80000001, %%eax\n\t" \ "cpuid\n\t" \ \ + "xorl %%eax, %%eax\n\t" \ + \ "movl $1, %%ecx\n\t" \ "shll $31, %%ecx\n\t" \ "testl %%ecx, %%edx\n\t" \ "jz tdnow_testexit\n\t" \ - "movl $1, %0\n\t" \ + "movl $1, %%eax\n\t" \ \ "movl $1, %%ecx\n\t" \ "shll $30, %%ecx\n\t" \ "testl %%ecx, %%edx\n\t" \ "jz tdnow_testexit\n\t" \ - "movl $2, %0\n\t" \ + "movl $2, %%eax\n\t" \ + "jmp tdnow_testexit\n\t" \ \ + "tdnow_prexit:\n\t" \ + "xorl %%eax, %%eax\n\t" \ "tdnow_testexit:\n\t" \ "popl %%ebx\n\t" - : "=m" (res) + : "=a" (res) : - : "eax", "ecx", "edx", "memory"); + : "ecx", "edx", "memory"); return res; } static int have_sse () { - int res = 0; + unsigned int res = 0; asm volatile ( "pushl %%ebx\n\t" \ "movl $1, %%eax\n\t" \ "cpuid\n\t" \ \ + "xorl %%eax, %%eax\n\t" \ + \ "movl $1, %%ebx\n\t" \ "shll $25, %%ebx\n\t" \ "testl %%ebx, %%edx\n\t" \ "jz sse_testexit\n\t" \ - "movl $1, %0\n\t" \ + "movl $1, %%eax\n\t" \ \ "movl $1, %%ebx\n\t" \ "shll $26, %%ebx\n\t" \ "testl %%ebx, %%edx\n\t" \ "jz sse_testexit\n\t" \ - "movl $2, %0\n\t" \ + "movl $2, %%eax\n\t" \ \ "movl $1, %%ebx\n\t" \ "testl %%ebx, %%ecx\n\t" \ "jz sse_testexit\n\t" \ - "movl $3, %0\n\t" \ + "movl $3, %%eax\n\t" \ \ "sse_testexit:\n\t" \ "popl %%ebx\n\t" - : "=m" (res) + : "=a" (res) : - : "eax", "ecx", "edx", "memory"); + : "ecx", "edx", "memory"); return res; } @@ -164,6 +171,9 @@ init_cpu () fprintf(stderr, "Enhanced3DNow! detected\n"); if (ARCH_X86_HAVE_SSE2(cpu_type)) fprintf(stderr, "SSE2 detected\n"); + if ((!ARCH_X86_HAVE_3DNOW(cpu_type)) && (!ARCH_X86_HAVE_SSE2(cpu_type))) + fprintf(stderr, + "No supported SIMD instruction sets detected\n"); } #endif /* ARCH_X86 */