[testsuite] Fix directives order
[official-gcc.git] / gcc / testsuite / gcc.target / powerpc / vec-rlmi-rlnm.c
blobc4f791dbba6f81ab2a86a20aa1877b3209549167
1 /* { dg-do compile { target { powerpc*-*-* } } } */
2 /* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */
3 /* { dg-require-effective-target lp64 } */
4 /* { dg-require-effective-target powerpc_p9vector_ok } */
5 /* { dg-options "-O2 -mcpu=power9" } */
7 #include <altivec.h>
9 vector unsigned int
10 rlmi_test_1 (vector unsigned int x, vector unsigned int y,
11 vector unsigned int z)
13 return vec_rlmi (x, y, z);
16 vector unsigned long long
17 rlmi_test_2 (vector unsigned long long x, vector unsigned long long y,
18 vector unsigned long long z)
20 return vec_rlmi (x, y, z);
23 vector unsigned int
24 vrlnm_test_1 (vector unsigned int x, vector unsigned int y)
26 return vec_vrlnm (x, y);
29 vector unsigned long long
30 vrlnm_test_2 (vector unsigned long long x, vector unsigned long long y)
32 return vec_vrlnm (x, y);
35 vector unsigned int
36 rlnm_test_1 (vector unsigned int x, vector unsigned int y,
37 vector unsigned int z)
39 return vec_rlnm (x, y, z);
42 vector unsigned long long
43 rlnm_test_2 (vector unsigned long long x, vector unsigned long long y,
44 vector unsigned long long z)
46 return vec_rlnm (x, y, z);
49 /* Expected code generation for rlmi_test_1 is vrlwmi.
50 Expected code generation for rlmi_test_2 is vrldmi.
51 Expected code generation for vrlnm_test_1 is vrlwnm.
52 Expected code generation for vrlnm_test_2 is vrldnm.
53 Expected code generation for the others is more complex, because
54 the second and third arguments are combined by a shift and OR,
55 and because there is no splat-immediate doubleword.
56 - For rlnm_test_1: vspltisw, vslw, xxlor, vrlwnm.
57 - For rlnm_test_2: xxspltib, vextsb2d, vsld, xxlor, vrldnm.
58 There is a choice of splat instructions in both cases, so we
59 just check for "splt". */
61 /* { dg-final { scan-assembler-times "vrlwmi" 1 } } */
62 /* { dg-final { scan-assembler-times "vrldmi" 1 } } */
63 /* { dg-final { scan-assembler-times "splt" 2 } } */
64 /* { dg-final { scan-assembler-times "vextsb2d" 1 } } */
65 /* { dg-final { scan-assembler-times "vslw" 1 } } */
66 /* { dg-final { scan-assembler-times "vsld" 1 } } */
67 /* { dg-final { scan-assembler-times "xxlor" 2 } } */
68 /* { dg-final { scan-assembler-times "vrlwnm" 2 } } */
69 /* { dg-final { scan-assembler-times "vrldnm" 2 } } */