]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/testsuite/gcc.target/powerpc/fold-vec-insert-float-p8.c
fold-vec-insert-char-p8.c: New.
[thirdparty/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 { target { powerpc*-*-linux* } } } */
5 /* { dg-require-effective-target powerpc_p8vector_ok } */
6 /* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power8" } } */
7 /* { dg-options "-O2 -mcpu=power8" } */
8
9 #include <altivec.h>
10
11 vector float
12 testf_var (float f, vector float vf, signed int i)
13 {
14 return vec_insert (f, vf, i);
15 }
16
17 vector float
18 testf_cst (float f, vector float vf)
19 {
20 return vec_insert (f, vf, 12);
21 }
22
23 /* { dg-final { scan-assembler-times {\mstvx\M|\mstxv\M|\mstxvd2x\M} 1 } } */
24 /* cst tests has stfs instead of stfsx. */
25 /* { dg-final { scan-assembler-times {\mstfs\M|\mstfsx\M} 2 } } */
26 /* { dg-final { scan-assembler-times {\mlvx\M|\mlxv\M|\mlxvd2x\M|\mlxvw4x\M} 2 } } */
27
28 /* cst test has a lvewx,vperm combo */
29 /* { dg-final { scan-assembler-times {\mlvewx\M} 1 } } */
30 /* { dg-final { scan-assembler-times {\mvperm\M} 1 } } */
31