[committed] Fix previously latent bug in reorg affecting cris port
[official-gcc.git] / gcc / testsuite / gcc.target / powerpc / altivec-10.c
blob50e84dba669b790953b612fae2426413ce557503
1 /* { dg-do run { target { powerpc*-*-* && vmx_hw } } } */
2 /* { dg-do compile { target { powerpc*-*-* && { ! vmx_hw } } } } */
3 /* { dg-options "-maltivec -mabi=altivec -fno-inline" } */
4 /* { dg-require-effective-target powerpc_altivec } */
6 #include <altivec.h>
8 extern void exit (int);
9 extern void abort (void);
11 typedef union
13 float f[4];
14 unsigned int i[4];
15 vector float v;
16 } vec_float_t;
18 void
19 check_vec_all_num ()
21 vec_float_t a, b, c;
23 a.i[0] = 0xfffa5a5a;
24 a.f[1] = 1.0;
25 a.f[2] = 1.0;
26 a.f[3] = 1.0;
28 b.f[0] = 1.0;
29 b.f[1] = 1.0;
30 b.f[2] = 1.0;
31 b.f[3] = 1.0;
33 c.i[0] = 0xfffa5a5a;
34 c.i[1] = 0xfffa5a5a;
35 c.i[2] = 0xfffa5a5a;
36 c.i[3] = 0xfffa5a5a;
38 if (vec_all_numeric (a.v))
39 abort ();
41 if (vec_all_nan (a.v))
42 abort ();
44 if (!vec_all_numeric (b.v))
45 abort ();
47 if (vec_all_nan (b.v))
48 abort ();
50 if (vec_all_numeric (c.v))
51 abort ();
53 if (!vec_all_nan (c.v))
54 abort ();
58 void
59 check_cmple()
61 vector float a = {1.0, 2.0, 3.0, 4.0};
62 vector float b = {1.0, 3.0, 2.0, 5.0};
63 vector bool int aux;
64 vector signed int le = {-1, -1, 0, -1};
66 aux = vec_cmple (a, b);
68 if (!vec_all_eq (aux, le))
69 abort ();
73 int
74 main()
76 check_cmple ();
77 check_vec_all_num ();
78 exit (0);