ld-vsx.c: Don't use vec_all_eq.
[gcc.git] / gcc / testsuite / gcc.dg / vmx / merge-vsx-be-order.c
1 /* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */
2 /* { dg-require-effective-target powerpc_vsx_ok } */
3 /* { dg-options "-maltivec=be -mabi=altivec -std=gnu99 -mvsx" } */
4
5 #include "harness.h"
6
7 static int vec_long_eq (vector long x, vector long y)
8 {
9 return (x[0] == y[0] && x[1] == y[1]);
10 }
11
12 static int vec_double_eq (vector double x, vector double y)
13 {
14 return (x[0] == y[0] && x[1] == y[1]);
15 }
16
17 static void test()
18 {
19 /* Input vectors. */
20 vector long vla = {-2,-1};
21 vector long vlb = {0,1};
22 vector double vda = {-2.0,-1.0};
23 vector double vdb = {0.0,1.0};
24
25 /* Result vectors. */
26 vector long vlh, vll;
27 vector double vdh, vdl;
28
29 /* Expected result vectors. */
30 #if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
31 vector long vlrh = {1,-1};
32 vector long vlrl = {0,-2};
33 vector double vdrh = {1.0,-1.0};
34 vector double vdrl = {0.0,-2.0};
35 #else
36 vector long vlrh = {-2,0};
37 vector long vlrl = {-1,1};
38 vector double vdrh = {-2.0,0.0};
39 vector double vdrl = {-1.0,1.0};
40 #endif
41
42 vlh = vec_mergeh (vla, vlb);
43 vll = vec_mergel (vla, vlb);
44 vdh = vec_mergeh (vda, vdb);
45 vdl = vec_mergel (vda, vdb);
46
47 check (vec_long_eq (vlh, vlrh), "vlh");
48 check (vec_long_eq (vll, vlrl), "vll");
49 check (vec_double_eq (vdh, vdrh), "vdh" );
50 check (vec_double_eq (vdl, vdrl), "vdl" );
51 }