2018-03-08 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / gcc.target / powerpc / fold-vec-logical-other-short.c
blobcc354b935dcc15ce03b2f2be7b60af72fcd2ff7b
1 /* Verify that overloaded built-ins for vec_orc and vec_nand with short
2 * inputs produce the right results. These intrinsics (vec_orc,
3 * vec_nand) were added as part of ISA 2.07 (P8). */
5 /* { dg-do compile } */
6 /* { dg-require-effective-target powerpc_p8vector_ok } */
7 /* { dg-options "-mpower8-vector -O1" } */
9 #include <altivec.h>
11 vector signed short
12 test1_orc (vector bool short x, vector signed short y)
14 vector signed short *foo;
15 *foo += vec_orc (x, y);
16 return *foo;
19 vector signed short
20 test1_nand (vector bool short x, vector signed short y)
22 vector signed short *foo;
23 *foo += vec_nand (x, y);
24 return *foo;
27 vector signed short
28 test2_orc (vector signed short x, vector bool short y)
30 vector signed short *foo;
31 *foo += vec_orc (x, y);
32 return *foo;
35 vector signed short
36 test2_nand (vector signed short x, vector bool short y)
38 vector signed short *foo;
39 *foo += vec_nand (x, y);
40 return *foo;
43 vector signed short
44 test3_orc (vector signed short x, vector signed short y)
46 vector signed short *foo;
47 *foo += vec_orc (x, y);
48 return *foo;
51 vector signed short
52 test3_nand (vector signed short x, vector signed short y)
54 vector signed short *foo;
55 *foo += vec_nand (x, y);
56 return *foo;
59 vector unsigned short
60 test4_orc (vector bool short x, vector unsigned short y)
62 vector unsigned short *foo;
63 *foo += vec_orc (x, y);
64 return *foo;
67 vector unsigned short
68 test4_nand (vector bool short x, vector unsigned short y)
70 vector unsigned short *foo;
71 *foo += vec_nand (x, y);
72 return *foo;
75 vector unsigned short
76 test5_orc (vector unsigned short x, vector bool short y)
78 vector unsigned short *foo;
79 *foo += vec_orc (x, y);
80 return *foo;
83 vector unsigned short
84 test5_nand (vector unsigned short x, vector bool short y)
86 vector unsigned short *foo;
87 *foo += vec_nand (x, y);
88 return *foo;
91 vector unsigned short
92 test6_orc (vector unsigned short x, vector unsigned short y)
94 vector unsigned short *foo;
95 *foo += vec_orc (x, y);
96 return *foo;
99 vector unsigned short
100 test6_nand (vector unsigned short x, vector unsigned short y)
102 vector unsigned short *foo;
103 *foo += vec_nand (x, y);
104 return *foo;
107 /* { dg-final { scan-assembler-times {\mxxlnand\M} 6 } } */
108 /* { dg-final { scan-assembler-times {\mxxlorc\M} 6 } } */