This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] another obvious altivec testcase fix


This patch makes an AltiVec execution test check for the existence
of AltiVec hardware before using any AltiVec instructions.  Committed
to mainline as obvious after testing on powerpc64-linux systems with
and without VMX hardware.

2004-08-12  Janis Johnson  <janis187@us.ibm.com>

	* g++.dg/ext/altivec-2.C: Check for hardware support before
	executing any VMX instructions.

--- g++.dg/ext/altivec-2.C.orig	2004-08-12 10:58:55.000000000 -0700
+++ g++.dg/ext/altivec-2.C	2004-08-12 10:52:21.000000000 -0700
@@ -8,15 +8,13 @@
 #include <altivec.h>
 #include "altivec_check.h"
 
-int main (int argc, const char * argv[])
+int main1 (void)
 {
   int i;
   const float cf = 1.0;
   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);
@@ -24,3 +22,9 @@ int main (int argc, const char * argv[])
   
   return 0;
 }
+
+int main (int argc, const char * argv[])
+{
+  altivec_check ();
+  return main1 ();
+}


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]