1 /* { dg-do run { target { power10_hw } } } */
2 /* { dg-do link { target { ! power10_hw } } } */
3 /* { dg-require-effective-target power10_ok } */
4 /* { dg-options "-O1 -mdejagnu-cpu=power10" } */
5 /* See vec-stril-21.c for the same test with -O2 optimization. */
9 extern void abort (void);
12 doString(vector
unsigned short *vp
)
14 /* Though two built-in functions are called, the implementation
15 should use a single instruction to implement both with -O1. */
16 vector
unsigned short result
= vec_stril (*vp
);
17 if (vec_stril_p (*vp
))
20 return doString (vp
+ 1);
23 int main (int argc
, short *argv
[])
25 vector
unsigned short composed_string
[4] = {
26 { 0x1, 0x3, 0x5, 0x7, 0x9, 0xb, 0xd, 0xf },
27 { 0x1, 0x0, 0x5, 0x7, 0x9, 0xb, 0xd, 0xf },
28 { 0x1, 0x0, 0x5, 0x7, 0x9, 0xb, 0xd, 0x0 },
29 { 0x1, 0x3, 0x5, 0x7, 0x9, 0xb, 0xd, 0x0 }
32 vector
unsigned short expected0
= { 0x1, 0x3, 0x5, 0x7, 0x9, 0xb, 0xd, 0xf };
33 vector
unsigned short expected1
= { 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 };
34 vector
unsigned short expected2
= { 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 };
35 vector
unsigned short expected3
= { 0x1, 0x3, 0x5, 0x7, 0x9, 0xb, 0xd, 0x0 };
37 if (!vec_all_eq (doString (&composed_string
[0]), expected1
))
39 if (!vec_all_eq (doString (&composed_string
[1]), expected1
))
41 if (!vec_all_eq (doString (&composed_string
[2]), expected2
))
43 if (!vec_all_eq (doString (&composed_string
[3]), expected3
))