OSDN Git Service

* gcc.target/powerpc/altivec-consts.c: Run if vmx_hw, compile
authorfroydnj <froydnj@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 13 Jan 2009 17:52:32 +0000 (17:52 +0000)
committerfroydnj <froydnj@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 13 Jan 2009 17:52:32 +0000 (17:52 +0000)
otherwise.  Do not check for AltiVec at runtime.
* gcc.target/powerpc/altivec-varargs-1.c: Likewise.
* gcc.target/powerpc/altivec-vec-merge.c: Likewise.
* gcc.target/powerpc/altivec-1.c: Likewise.
* gcc.target/powerpc/altivec-3.c: Likewise.
* gcc.target/powerpc/altivec-10.c: Likewise.
* gcc.target/powerpc/altivec-12.c: Likewise.
* gcc.target/powerpc/altivec-24.c: Likewise.
* gcc.target/powerpc/altivec-cell-2.c: Likewise.
* gcc.target/powerpc/altivec-cell-3.c: Likewise.
* gcc.target/powerpc/altivec-cell-4.c: Likewise.
* gcc.target/powerpc/pr35907.c: Likewise.
* gcc.target/powerpc/altivec-cell-8.c: Run if cell_hw, compile
otherwise.  Do not check for Cell at runtime.
* gcc.target/powerpc/altivec_check.h: Delete.

* g++.dg/ext/altivec-2.C: Do not check for AltiVec at runtime.
* g++.dg/ext/altivec-3.C: Run if vmx_hw, compile otherwise.  Do
not check for AltiVec at runtime.
* g++.dg/ext/altivec-cell-2.C: Likewise.
* g++.dg/ext/altivec-cell-3.C: Likewise.
* g++.dg/ext/altivec-cell-4.C: Likewise.
* g++.dg/eh/simd-2.C: Only use -maltivec if vmx_hw.
* g++.dg/eh/check-vect.h (sig_ill_handler): Remove AltiVec runtime
check.
* g++.dg/ext/altivec_check.h: Delete.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@143350 138bc75d-0d04-0410-961f-82ee72b054a4

24 files changed:
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/eh/check-vect.h
gcc/testsuite/g++.dg/eh/simd-2.C
gcc/testsuite/g++.dg/ext/altivec-2.C
gcc/testsuite/g++.dg/ext/altivec-3.C
gcc/testsuite/g++.dg/ext/altivec-cell-2.C
gcc/testsuite/g++.dg/ext/altivec-cell-3.C
gcc/testsuite/g++.dg/ext/altivec-cell-4.C
gcc/testsuite/g++.dg/ext/altivec_check.h [deleted file]
gcc/testsuite/gcc.target/powerpc/altivec-1.c
gcc/testsuite/gcc.target/powerpc/altivec-10.c
gcc/testsuite/gcc.target/powerpc/altivec-12.c
gcc/testsuite/gcc.target/powerpc/altivec-24.c
gcc/testsuite/gcc.target/powerpc/altivec-3.c
gcc/testsuite/gcc.target/powerpc/altivec-cell-2.c
gcc/testsuite/gcc.target/powerpc/altivec-cell-3.c
gcc/testsuite/gcc.target/powerpc/altivec-cell-4.c
gcc/testsuite/gcc.target/powerpc/altivec-cell-8.c
gcc/testsuite/gcc.target/powerpc/altivec-consts.c
gcc/testsuite/gcc.target/powerpc/altivec-varargs-1.c
gcc/testsuite/gcc.target/powerpc/altivec-vec-merge.c
gcc/testsuite/gcc.target/powerpc/altivec_check.h [deleted file]
gcc/testsuite/gcc.target/powerpc/pr35907.c
gcc/testsuite/lib/target-supports.exp

index 26b8c93..37223ec 100644 (file)
@@ -1,3 +1,35 @@
+2009-01-13  Daniel Jacobowitz  <dan@codesourcery.com>
+           Nathan Froyd  <froydnj@codesourcery.com>
+           Joseph Myers  <joseph@codesourcery.com>
+
+       * gcc.target/powerpc/altivec-consts.c: Run if vmx_hw, compile
+       otherwise.  Do not check for AltiVec at runtime.
+       * gcc.target/powerpc/altivec-varargs-1.c: Likewise.
+       * gcc.target/powerpc/altivec-vec-merge.c: Likewise.
+       * gcc.target/powerpc/altivec-1.c: Likewise.
+       * gcc.target/powerpc/altivec-3.c: Likewise.
+       * gcc.target/powerpc/altivec-10.c: Likewise.
+       * gcc.target/powerpc/altivec-12.c: Likewise.
+       * gcc.target/powerpc/altivec-24.c: Likewise.
+       * gcc.target/powerpc/altivec-cell-2.c: Likewise.
+       * gcc.target/powerpc/altivec-cell-3.c: Likewise.
+       * gcc.target/powerpc/altivec-cell-4.c: Likewise.
+       * gcc.target/powerpc/pr35907.c: Likewise.
+       * gcc.target/powerpc/altivec-cell-8.c: Run if cell_hw, compile
+       otherwise.  Do not check for Cell at runtime.
+       * gcc.target/powerpc/altivec_check.h: Delete.
+
+       * g++.dg/ext/altivec-2.C: Do not check for AltiVec at runtime.
+       * g++.dg/ext/altivec-3.C: Run if vmx_hw, compile otherwise.  Do
+       not check for AltiVec at runtime.
+       * g++.dg/ext/altivec-cell-2.C: Likewise.
+       * g++.dg/ext/altivec-cell-3.C: Likewise.
+       * g++.dg/ext/altivec-cell-4.C: Likewise.
+       * g++.dg/eh/simd-2.C: Only use -maltivec if vmx_hw.
+       * g++.dg/eh/check-vect.h (sig_ill_handler): Remove AltiVec runtime
+       check.
+       * g++.dg/ext/altivec_check.h: Delete.
+       
 2009-01-13  Nathan Froyd  <froydnj@codesourcery.com>
 
        * gcc.target/powerpc/altivec-macros.c: Require a powerpc_altivec_ok
index 4321be0..b46a882 100644 (file)
@@ -13,10 +13,7 @@ sig_ill_handler (int sig)
 void check_vect (void)
 {
   signal(SIGILL, sig_ill_handler);
-#if defined(__ppc__) || defined(__ppc64__) || defined(__powerpc__) || defined(powerpc)
-  /* Altivec instruction, 'vor %v0,%v0,%v0'.  */
-  asm volatile (".long 0x10000484");
-#elif defined(__i386__) || defined(__x86_64__)
+#if defined(__i386__) || defined(__x86_64__)
   /* SSE2 instruction: movsd %xmm0,%xmm0 */
   asm volatile (".byte 0xf2,0x0f,0x10,0xc0");
 #elif defined(__sparc__)
index e2af866..b4c8690 100644 (file)
@@ -3,9 +3,7 @@
 // { dg-options "-O" }
 // { dg-options "-O -w" { target { { i?86-*-* x86_64-*-* } && ilp32 } } }
 // { dg-options "-O -w" { target powerpc*-*-* } }
-// { dg-options "-O -w -maltivec" { target { powerpc*-*-linux* && powerpc_altivec_ok } } }
-// { dg-options "-O -w -maltivec" { target { powerpc*-*-darwin* && powerpc_altivec_ok } } }
-// { dg-xfail-if "" { "powerpc-*-eabispe*" "powerpc-ibm-aix*" } { "*" } { "" } }
+// { dg-options "-O -w -maltivec" { target { powerpc*-*-* && vmx_hw } } }
 // { dg-do run }
 
 #include "check-vect.h"
index 268ff99..2996936 100644 (file)
@@ -6,7 +6,6 @@
    arguments.  */
 
 #include <altivec.h>
-#include "altivec_check.h"
 
 int main (int argc, const char * argv[])
 {
@@ -15,8 +14,6 @@ int main (int argc, const char * argv[])
   vector float v;
   const vector float cv = (vector float){1.0, 2.0, 3.0, 4.0};
 
-  altivec_check ();
-
   vec_dst(&cv, i, 0);
   v = vec_ld(0, &cv);  
   v = vec_lde(0, &cf);
index d42303d..1511320 100644 (file)
@@ -1,4 +1,5 @@
-/* { dg-do run { target powerpc*-*-* } } */
+/* { dg-do run { target { powerpc*-*-* && vmx_hw } } } */
+/* { dg-do compile { target { powerpc*-*-* && { ! vmx_hw } } } } */
 /* { dg-require-effective-target powerpc_altivec_ok } */
 /* { dg-options "-maltivec" } */
 
@@ -10,7 +11,6 @@
 #include <stdlib.h>
 
 #include <altivec.h>
-#include "altivec_check.h"
 
 #define CHECK_INVARIANT(expr) \
   if (!(expr)) { \
@@ -132,7 +132,6 @@ void main1(void)
 
 int main(void)
 {
-    altivec_check();
     main1();
     return 0;
 }
index 969cc97..f0d3433 100644 (file)
@@ -1,9 +1,9 @@
-/* { dg-do run { target powerpc*-*-* } } */
+/* { dg-do run { target { powerpc*-*-* && vmx_hw } } } */
+/* { dg-do compile { target { powerpc*-*-* && { ! vmx_hw } } } } */
 /* { dg-require-effective-target powerpc_altivec_ok } */
 /* { dg-options "-maltivec" } */
 /* Test the vec_extract VMX intrinsics.  */
 #include <altivec.h>
-#include "altivec_check.h"
 
 extern "C" void abort (void);
 
@@ -137,6 +137,5 @@ int main1(void)
 
 int main(void)
 { 
-  altivec_check();  /* Exits if AltiVec not supported */
   return main1 ();
 }
index f7ebcae..bd7e774 100644 (file)
@@ -1,9 +1,9 @@
-/* { dg-do run { target powerpc*-*-* } } */
+/* { dg-do run { target { powerpc*-*-* && vmx_hw } } } */
+/* { dg-do compile { target { powerpc*-*-* && { ! vmx_hw } } } } */
 /* { dg-require-effective-target powerpc_altivec_ok } */
 /* { dg-options "-maltivec" } */
 /* Test the vec_splats and vec_promote VMX intrinsics.  */
 #include <altivec.h>
-#include "altivec_check.h"
     
 extern "C" void abort (void);
         
@@ -33,6 +33,5 @@ int main1(int t)
     
 int main(void)
 { 
-  altivec_check();  /* Exits if AltiVec not supported */
   return main1 (0);
 }
index 10ab162..7d91adb 100644 (file)
@@ -1,10 +1,10 @@
-/* { dg-do run { target powerpc*-*-* } } */
+/* { dg-do run { target { powerpc*-*-* && vmx_hw } } } */
+/* { dg-do compile { target { powerpc*-*-* && { ! vmx_hw } } } } */
 /* { dg-require-effective-target powerpc_altivec_ok } */
 /* { dg-options "-maltivec" } */
 
 /* Test the vec_splats and vec_promote VMX intrinsics.  */
 #include <altivec.h>
-#include "altivec_check.h"
     
 extern "C" void abort (void);
         
@@ -38,6 +38,5 @@ int main1(int t)
   
 int main(void)
 {
-  altivec_check();  /* Exits if AltiVec not supported */
   return main1 (0);
 }
diff --git a/gcc/testsuite/g++.dg/ext/altivec_check.h b/gcc/testsuite/g++.dg/ext/altivec_check.h
deleted file mode 100644 (file)
index 9e8b3f7..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-/* A runtime check for AltiVec capability.  */
-/* Contributed by Ziemowit Laski  <zlaski@apple.com>  */
-
-#include <signal.h>
-extern
-#ifdef __cplusplus
-"C"
-#endif
-void exit(int);
-
-void 
-sig_ill_handler (int sig)
-{
-    exit (0);
-}
-
-void altivec_check(void) {
-
-  /* Exit on systems without AltiVec.  */
-  signal (SIGILL, sig_ill_handler);
-#ifdef __MACH__
-  asm volatile ("vor v0,v0,v0");
-#else
-  asm volatile ("vor 0,0,0");
-#endif
-  signal (SIGILL, SIG_DFL);
-}
index f235e7b..b1809fe 100644 (file)
@@ -1,11 +1,11 @@
-/* { dg-do run { target powerpc*-*-* } } */
+/* { dg-do run { target { powerpc*-*-* && vmx_hw } } } */
+/* { dg-do compile { target { powerpc*-*-* && { ! vmx_hw } } } } */
 /* { dg-require-effective-target powerpc_altivec_ok } */
 /* { dg-options "-maltivec" } */
 
 /* Program to test PowerPC AltiVec instructions.  */
 
 #include <altivec.h>
-#include "altivec_check.h"
 
 extern void abort (void);
 
@@ -24,8 +24,6 @@ vector float f, g, h;
 
 int main ()
 {
-  altivec_check();  /* Exits if AltiVec not supported */
-
   k = vec_add (a1, a2);
   if (!vec_all_eq (addi, k))
     abort ();
index 82b3f45..f532eeb 100644 (file)
@@ -1,11 +1,12 @@
-/* { dg-do compile { target powerpc*-*-* } } */
+/* { dg-do run { target { powerpc*-*-* && vmx_hw } } } */
+/* { dg-do compile { target { powerpc*-*-* && { ! vmx_hw } } } } */
 /* { dg-require-effective-target powerpc_altivec_ok } */
 /* { dg-options "-maltivec -mabi=altivec -fno-inline" } */
 
 #include <altivec.h>
-#include <signal.h>
 
-#include "altivec_check.h"
+extern void exit (int);
+extern void abort (void);
 
 typedef union
 {
@@ -72,8 +73,6 @@ check_cmple()
 int 
 main()
 {
-  altivec_check ();
-
   check_cmple ();
   check_vec_all_num ();
   exit (0);
index 296a3f7..39d2694 100644 (file)
@@ -1,11 +1,11 @@
-/* { dg-do run { target powerpc*-*-* } } */
+/* { dg-do run { target { powerpc*-*-* && vmx_hw } } } */
+/* { dg-do compile { target { powerpc*-*-* && { ! vmx_hw } } } } */
 /* { dg-require-effective-target powerpc_altivec_ok } */
 /* { dg-options "-maltivec" } */
 
 /* Program to test PowerPC AltiVec instructions.  */
 
 #include <altivec.h>
-#include "altivec_check.h"
 
 extern void abort (void);
 #define CHECK_IF(E) if(!(E)) abort()
@@ -26,9 +26,6 @@ vector float f, g, h;
 
 int main ()
 {
-
-  altivec_check();  /* Exit if AltiVec not available.  */
-
   k = vec_add (a1, a2);
   CHECK_IF (vec_all_eq (addi, k));
   CHECK_IF (vec_all_ge (addi, k));
index cb1a668..d296fe2 100644 (file)
@@ -1,9 +1,9 @@
-/* { dg-do run { target powerpc*-*-* } } */
+/* { dg-do run { target { powerpc*-*-* && vmx_hw } } } */
+/* { dg-do compile { target { powerpc*-*-* && { ! vmx_hw } } } } */
 /* { dg-require-effective-target powerpc_altivec_ok } */
 /* { dg-options "-maltivec" } */
 
 #include <altivec.h>
-#include "altivec_check.h"
 
 extern void abort (void);
 
@@ -28,7 +28,6 @@ int verify (void)
 
 int main (void)
 {
-  altivec_check ();   /* Exit if hardware doesn't support AltiVec.  */
   initialize (MAGIC_NUMBER);
   verify ();
   return 0;
index 17f62fd..d388ad2 100644 (file)
@@ -1,8 +1,10 @@
-/* { dg-do run { target powerpc*-*-* } } */
+/* { dg-do run { target { powerpc*-*-* && vmx_hw } } } */
+/* { dg-do compile { target { powerpc*-*-* && { ! vmx_hw } } } } */
 /* { dg-require-effective-target powerpc_altivec_ok } */
 /* { dg-options "-maltivec" } */
 
-#include "altivec_check.h"
+extern void exit (int);
+extern void abort (void);
 
 typedef int int4 __attribute__ ((vector_size (16)));
 typedef float float4 __attribute__ ((vector_size (16)));
@@ -73,7 +75,6 @@ main1 ()
 int
 main ()
 {
-  altivec_check ();
   main1 ();
   exit (0);
 }
index b9c7c90..fdb375c 100644 (file)
@@ -1,9 +1,9 @@
-/* { dg-do run { target powerpc*-*-* } } */
+/* { dg-do run { target { powerpc*-*-* && vmx_hw } } } */
+/* { dg-do compile { target { powerpc*-*-* && { ! vmx_hw } } } } */
 /* { dg-require-effective-target powerpc_altivec_ok } */
 /* { dg-options "-maltivec" } */
 /* Test the vec_extract VMX intrinsics.  */
 #include <altivec.h>
-#include "altivec_check.h"
 
 extern void abort (void);
 
@@ -137,6 +137,5 @@ int main1(void)
 
 int main(void)
 { 
-  altivec_check();  /* Exits if AltiVec not supported */
   return main1 ();
 }
index abaf56f..b941ab1 100644 (file)
@@ -1,9 +1,9 @@
-/* { dg-do run { target powerpc*-*-* } } */
+/* { dg-do run { target { powerpc*-*-* && vmx_hw } } } */
+/* { dg-do compile { target { powerpc*-*-* && { ! vmx_hw } } } } */
 /* { dg-require-effective-target powerpc_altivec_ok } */
 /* { dg-options "-maltivec" } */
 /* Test the vec_splats and vec_promote VMX intrinsics.  */
 #include <altivec.h>
-#include "altivec_check.h"
     
 extern void abort (void);
         
@@ -33,6 +33,5 @@ int main1(int t)
     
 int main(void)
 { 
-  altivec_check();  /* Exits if AltiVec not supported */
   return main1 (0);
 }
index b800ea5..c694691 100644 (file)
@@ -1,10 +1,10 @@
-/* { dg-do run { target powerpc*-*-* } } */
+/* { dg-do run { target { powerpc*-*-* && vmx_hw } } } */
+/* { dg-do compile { target { powerpc*-*-* && { ! vmx_hw } } } } */
 /* { dg-require-effective-target powerpc_altivec_ok } */
 /* { dg-options "-maltivec" } */
 
 /* Test the vec_splats and vec_promote VMX intrinsics.  */
 #include <altivec.h>
-#include "altivec_check.h"
     
 extern void abort (void);
         
@@ -38,6 +38,5 @@ int main1(int t)
   
 int main(void)
 {
-  altivec_check();  /* Exits if AltiVec not supported */
   return main1 (0);
 }
index 12e13e0..dda5eb0 100644 (file)
@@ -1,9 +1,11 @@
-/* { dg-do run } */
+/* { dg-do run { target { powerpc*-*-* && cell_hw } } } */
+/* { dg-do compile { target { powerpc*-*-* && { ! cell_hw } } } } */
 /* { dg-require-effective-target powerpc_ppu_ok } */
 /* { dg-options "-O2 -maltivec -mabi=altivec -mcpu=cell" } */
 #include <altivec.h>
 #include <string.h>
-#include "altivec_check.h"
+
+extern void abort (void);
 
 typedef short int sint16;
 typedef signed char int8;
@@ -51,6 +53,5 @@ return 0;
 
 int main(void)
 {
-  altivec_cell_check ();
   return main1();
 }
index e06a528..2c5bc99 100644 (file)
@@ -1,11 +1,10 @@
-/* { dg-do run { target powerpc*-*-* } } */
+/* { dg-do run { target { powerpc*-*-* && vmx_hw } } } */
+/* { dg-do compile { target { powerpc*-*-* && { ! vmx_hw } } } } */
 /* { dg-require-effective-target powerpc_altivec_ok } */
 /* { dg-options "-maltivec -mabi=altivec -O2" } */
 
 /* Check that "easy" AltiVec constants are correctly synthesized.  */
 
-#include "altivec_check.h"
-
 extern void abort (void);
 
 typedef __attribute__ ((vector_size (16))) unsigned char v16qi;
@@ -283,8 +282,6 @@ void v4si_vspltisw_neg_addself ()
 
 int main ()
 {
-  altivec_check ();   /* Exit if hardware doesn't support AltiVec.  */
-
   v16qi_vspltisb ();
   v16qi_vspltisb_neg ();
   v16qi_vspltisb_addself ();
index 2aa54a9..1349ae5 100644 (file)
@@ -1,11 +1,12 @@
-/* { dg-do run { target powerpc*-*-* } } */
+/* { dg-do run { target { powerpc*-*-* && vmx_hw } } } */
+/* { dg-do compile { target { powerpc*-*-* && { ! vmx_hw } } } } */
 /* { dg-require-effective-target powerpc_altivec_ok } */
 /* { dg-options "-maltivec -mabi=altivec -fno-inline" } */
 
 #include <stdarg.h>
-#include <signal.h>
 
-#include "altivec_check.h"
+extern void exit (int);
+extern void abort (void);
 
 #define vector __attribute__((vector_size (16)))
 
@@ -77,8 +78,5 @@ int main1(void)
 
 int main (void)
 {
-  /* Exit on systems without AltiVec.  */
-  altivec_check ();
-
   return main1 ();
 }
index e6027bd..3689f97 100644 (file)
@@ -1,9 +1,9 @@
-/* { dg-do run { target powerpc*-*-* } } */
+/* { dg-do run { target { powerpc*-*-* && vmx_hw } } } */
+/* { dg-do compile { target { powerpc*-*-* && { ! vmx_hw } } } } */
 /* { dg-require-effective-target powerpc_altivec_ok } */
 /* { dg-options "-maltivec -O2" } */
 
 #include <altivec.h>
-#include "altivec_check.h"
 
 int printf(const char * , ...);
 extern void abort();
@@ -600,7 +600,6 @@ int main(int argc, char **argv)
 {
     char toto[32] __attribute__((aligned(16)));
 
-    altivec_check ();  /* Exit if hardware doesn't support AltiVec.  */
     foo(toto, toto, 0, 0);
     return 0;
 }
diff --git a/gcc/testsuite/gcc.target/powerpc/altivec_check.h b/gcc/testsuite/gcc.target/powerpc/altivec_check.h
deleted file mode 100644 (file)
index d966e23..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-/* A runtime check for AltiVec capability.  */
-/* Contributed by Ziemowit Laski  <zlaski@apple.com>  */
-
-#include <signal.h>
-extern void exit (int);
-extern void abort (void);
-
-void 
-sig_ill_handler (int sig)
-{
-    exit (0);
-}
-
-void altivec_check(void) {
-
-  /* Exit on systems without AltiVec.  */
-  signal (SIGILL, sig_ill_handler);
-#ifdef __MACH__
-  asm volatile ("vor v0,v0,v0");
-#else
-  asm volatile ("vor 0,0,0");
-#endif
-  signal (SIGILL, SIG_DFL);
-}
-
-void altivec_cell_check (void)
-{
-#ifdef __PPU__
-  /* Exit on systems without the Cell Altivec instructions.  */
-  signal (SIGILL, sig_ill_handler);
-#ifdef __MACH__
-  asm volatile ("vor v0,v0,v0");
-  asm volatile ("lvlx v0,r0,r0");
-#else
-  asm volatile ("vor 0,0,0");
-  asm volatile ("lvlx 0,0,0");
-#endif
-  signal (SIGILL, SIG_DFL);
-#else
-  /* altivec_cell_check shouldn't be called without -mcpu=cell.  */
-  abort ();
-#endif
-}
index e1749de..7d5465e 100644 (file)
@@ -1,10 +1,9 @@
 /* PR target/35907 */
-/* { dg-do run { target powerpc*-*-* } } */
+/* { dg-do run { target { powerpc*-*-* && vmx_hw } } } */
+/* { dg-do compile { target { powerpc*-*-* && { ! vmx_hw } } } } */
 /* { dg-require-effective-target powerpc_altivec_ok } */
 /* { dg-options "-O2 -maltivec" } */
 
-#include "altivec_check.h"
-
 #define vector __attribute__((vector_size (16)))
 union
 {
@@ -53,7 +52,6 @@ test (void)
 int
 main ()
 {
-  altivec_check ();
   test ();
   return 0;
 }
index 1aa1855..af806be 100644 (file)
@@ -905,6 +905,40 @@ proc check_vmx_hw_available { } {
     }]
 }
 
+# Return 1 if the target supports executing AltiVec and Cell PPU
+# instructions, 0 otherwise.  Cache the result.
+
+proc check_effective_target_cell_hw { } {
+    return [check_cached_effective_target cell_hw_available {
+       # Some simulators are known to not support VMX and PPU instructions.
+       if { [istarget powerpc-*-eabi*] } {
+           expr 0
+       } else {
+           # Most targets don't require special flags for this test
+           # case, but Darwin and AIX do.
+           if { [istarget *-*-darwin*]
+                || [istarget *-*-aix*] } {
+               set options "-maltivec -mcpu=cell"
+           } else {
+               set options "-mcpu=cell"
+           }
+           check_runtime_nocache cell_hw_available {
+               int main()
+               {
+               #ifdef __MACH__
+                 asm volatile ("vor v0,v0,v0");
+                  asm volatile ("lvlx v0,r0,r0");
+               #else
+                 asm volatile ("vor 0,0,0");
+                  asm volatile ("lvlx 0,0,0");
+               #endif
+                 return 0;
+               }
+           } $options
+       }
+    }]
+}
+
 # Return 1 if the target supports executing 64-bit instructions, 0
 # otherwise.  Cache the result.