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] altivec tests, 1 of 3


Modify an executable altivec test so that it checks whether the hardware
support exists before trying to use it to initialize local variables.
Tested on powerpc64-unknown-linux-gnu with -m32 and -m64.

OK for mainline?

2004-05-20  Janis Johnson  <janis187@us.ibm.com>

	* gcc.dg/altivec-3.c: Move call to altivec_check.

--- gcc.dg/altivec-3.c.orig	2004-05-20 16:02:19.138166184 -0500
+++ gcc.dg/altivec-3.c	2004-05-20 16:03:10.135266656 -0500
@@ -49,7 +49,8 @@ compare_float4 (float *a, float *b)
       abort ();
 }
 
-main ()
+void
+main1 ()
 {
   int loc1 = 600, loc2 = 800;
   int4 a3 = (int4) { loc1, loc2, 1000, 1200 };
@@ -58,8 +59,6 @@ main ()
   float4 f3 = (float4) { 6.0, 8.0, 10.0, 12.0 };
   float4 ftmp;
 
-  altivec_check ();
-
   vec_store (i3, a3);
   itmp = vec_add_int4 (a1, a2);
   vec_store (j3, itmp);
@@ -69,6 +68,12 @@ main ()
   ftmp = vec_add_float4 (f1, f2);
   vec_store (h3, ftmp);
   compare_float4 (g3, h3);
+}
 
+int
+main ()
+{
+  altivec_check ();
+  main1 ();
   exit (0);
 }


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