Update concepts branch to revision 131834
[official-gcc.git] / gcc / testsuite / gcc.target / powerpc / altivec-10.c
blob82b3f45a391ea71685e743aa23303aee58ed243a
1 /* { dg-do compile { target powerpc*-*-* } } */
2 /* { dg-require-effective-target powerpc_altivec_ok } */
3 /* { dg-options "-maltivec -mabi=altivec -fno-inline" } */
5 #include <altivec.h>
6 #include <signal.h>
8 #include "altivec_check.h"
10 typedef union
12 float f[4];
13 unsigned int i[4];
14 vector float v;
15 } vec_float_t;
17 void
18 check_vec_all_num ()
20 vec_float_t a, b, c;
22 a.i[0] = 0xfffa5a5a;
23 a.f[1] = 1.0;
24 a.f[2] = 1.0;
25 a.f[3] = 1.0;
27 b.f[0] = 1.0;
28 b.f[1] = 1.0;
29 b.f[2] = 1.0;
30 b.f[3] = 1.0;
32 c.i[0] = 0xfffa5a5a;
33 c.i[1] = 0xfffa5a5a;
34 c.i[2] = 0xfffa5a5a;
35 c.i[3] = 0xfffa5a5a;
37 if (vec_all_numeric (a.v))
38 abort ();
40 if (vec_all_nan (a.v))
41 abort ();
43 if (!vec_all_numeric (b.v))
44 abort ();
46 if (vec_all_nan (b.v))
47 abort ();
49 if (vec_all_numeric (c.v))
50 abort ();
52 if (!vec_all_nan (c.v))
53 abort ();
57 void
58 check_cmple()
60 vector float a = {1.0, 2.0, 3.0, 4.0};
61 vector float b = {1.0, 3.0, 2.0, 5.0};
62 vector bool int aux;
63 vector signed int le = {-1, -1, 0, -1};
65 aux = vec_cmple (a, b);
67 if (!vec_all_eq (aux, le))
68 abort ();
72 int
73 main()
75 altivec_check ();
77 check_cmple ();
78 check_vec_all_num ();
79 exit (0);