[testsuite] require sqrt_insn effective target where needed
[official-gcc.git] / gcc / testsuite / gcc.target / powerpc / mma-builtin-5.c
blob00503b7343d290fa22a48065ee889cce151e8e30
1 /* { dg-do compile } */
2 /* { dg-require-effective-target power10_ok } */
3 /* { dg-options "-Wno-psabi -mdejagnu-cpu=power10 -O2" } */
5 typedef unsigned char vec_t __attribute__((vector_size(16)));
7 void
8 foo (__vector_quad *dst, vec_t *src)
10 __vector_quad acc;
11 __builtin_mma_assemble_acc (&acc, src[0], src[4], src[8], src[12]);
12 *dst = acc;
15 void
16 foo2 (__vector_quad *dst, vec_t *src)
18 __vector_quad acc;
19 __builtin_mma_build_acc (&acc, src[12], src[8], src[4], src[0]);
20 *dst = acc;
23 void
24 bar (vec_t *dst, __vector_quad *src)
26 vec_t res[4];
27 __builtin_mma_disassemble_acc (res, src);
28 dst[0] = res[0];
29 dst[4] = res[1];
30 dst[8] = res[2];
31 dst[12] = res[3];
34 #if !__has_builtin (__builtin_mma_assemble_acc)
35 # error "__has_builtin (__builtin_mma_assemble_acc) failed"
36 #endif
38 #if !__has_builtin (__builtin_mma_build_acc)
39 # error "__has_builtin (__builtin_mma_build_acc) failed"
40 #endif
42 /* { dg-final { scan-assembler-times {\mlxv\M} 8 } } */
43 /* { dg-final { scan-assembler-times {\mlxvp\M} 2 } } */
44 /* { dg-final { scan-assembler-times {\mstxv\M} 4 } } */
45 /* { dg-final { scan-assembler-times {\mstxvp\M} 4 } } */
46 /* { dg-final { scan-assembler-times {\mxxmfacc\M} 3 } } */
47 /* { dg-final { scan-assembler-times {\mxxmtacc\M} 3 } } */