From 5cd426186c1366fe0c03e971dc605c89d1894f87 Mon Sep 17 00:00:00 2001 From: stuart Date: Fri, 9 Jan 2004 01:01:50 +0000 Subject: 2004-01-08 Stuart Hastings * config/i386/i386.md: Typos in MMX/SSE immediate shifts. * testsuite/gcc.dg/20020523-2.c (bail_if_no_sse): Moved cpu-ID code... testsuite/gcc.dg/i386-cpuid.h (i386_cpuid): ...to here, to share with... * testsuite/gcc.dg/i386-sse-6.c: ...this new testcase. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@75566 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/testsuite/gcc.dg/20020523-2.c | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) (limited to 'gcc/testsuite/gcc.dg/20020523-2.c') diff --git a/gcc/testsuite/gcc.dg/20020523-2.c b/gcc/testsuite/gcc.dg/20020523-2.c index 5ae3da5473a..1bb5a1a6567 100644 --- a/gcc/testsuite/gcc.dg/20020523-2.c +++ b/gcc/testsuite/gcc.dg/20020523-2.c @@ -4,6 +4,7 @@ /* { dg-do run { target i386-*-* } } */ /* { dg-options "-march=pentium3 -msse -ffast-math -O2" } */ +#include "i386-cpuid.h" extern void abort (void); extern void exit (int); @@ -27,24 +28,10 @@ typedef struct void bail_if_no_sse (void) { - int fl1, fl2; - - /* See if we can use cpuid. */ - __asm__ ("pushfl; pushfl; popl %0; movl %0,%1; xorl %2,%0;" - "pushl %0; popfl; pushfl; popl %0; popfl" - : "=&r" (fl1), "=&r" (fl2) - : "i" (0x00200000)); - if (((fl1 ^ fl2) & 0x00200000) == 0) - exit (0); - - /* See if cpuid gives capabilities. */ - __asm__ ("cpuid" : "=a" (fl1) : "0" (0) : "ebx", "ecx", "edx", "cc"); - if (fl1 == 0) - exit (0); - + unsigned int edx; /* See if capabilities include SSE (25th bit; 26 for SSE2). */ - __asm__ ("cpuid" : "=a" (fl1), "=d" (fl2) : "0" (1) : "ebx", "ecx", "cc"); - if ((fl2 & (1 << 25)) == 0) + edx = i386_cpuid(); + if (!(edx & bit_SSE)) exit (0); } -- cgit v1.2.1