rs6000: Enable vec_insert for P8 with rs6000_expand_vector_set_var_p8 [PR98093]
[gcc.git] / gcc / testsuite / gcc.target / powerpc / fold-vec-insert-float-p8.c
1 /* Verify that overloaded built-ins for vec_insert with float
2 inputs produce the right codegen. Power8 variant. */
3
4 /* { dg-do compile } */
5 /* { dg-require-effective-target powerpc_p8vector_ok } */
6 /* { dg-options "-O2 -mdejagnu-cpu=power8" } */
7
8 #include <altivec.h>
9
10 vector float
11 testf_var (float f, vector float vf, signed int i)
12 {
13 return vec_insert (f, vf, i);
14 }
15
16 vector float
17 testf_cst (float f, vector float vf)
18 {
19 return vec_insert (f, vf, 12);
20 }
21
22 /* { dg-final { scan-assembler-times {\mstvx\M|\mstxv\M|\mstxvd2x\M} 0 } } */
23 /* cst tests has stfs instead of stfsx. */
24 /* { dg-final { scan-assembler-times {\mstfs\M|\mstfsx\M} 1 } } */
25 /* { dg-final { scan-assembler-times {\mlvx\M|\mlxv\M|\mlxvd2x\M|\mlxvw4x\M} 2 } } */
26
27 /* cst test has a lvewx,vperm combo */
28 /* { dg-final { scan-assembler-times {\mlvewx\M} 1 } } */
29 /* { dg-final { scan-assembler-times {\mvperm\M} 3 } } */
30