summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/20020523-2.c
diff options
context:
space:
mode:
authorstuart <stuart@138bc75d-0d04-0410-961f-82ee72b054a4>2004-01-09 01:01:50 +0000
committerstuart <stuart@138bc75d-0d04-0410-961f-82ee72b054a4>2004-01-09 01:01:50 +0000
commit5cd426186c1366fe0c03e971dc605c89d1894f87 (patch)
treeb4da94d23ce849099109f79856686c4a80998703 /gcc/testsuite/gcc.dg/20020523-2.c
parent02a8962d494d2f3049175fefcc2ed485ebd2ec33 (diff)
downloadgcc-5cd426186c1366fe0c03e971dc605c89d1894f87.tar.gz
2004-01-08 Stuart Hastings <stuart@apple.com>
* 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
Diffstat (limited to 'gcc/testsuite/gcc.dg/20020523-2.c')
-rw-r--r--gcc/testsuite/gcc.dg/20020523-2.c21
1 files changed, 4 insertions, 17 deletions
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);
}