2018-03-08 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / gcc.target / powerpc / builtins-1-be.c
blob9de8baf166c03c8802adee1f880a973478d6c276
1 /* { dg-do compile { target { powerpc64-*-* } } } */
2 /* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power8" } } */
3 /* { dg-options "-mcpu=power8 -O0 -mno-fold-gimple -dp" } */
4 /* { dg-prune-output "gimple folding of rs6000 builtins has been disabled." } */
6 /* Test that a number of newly added builtin overloads are accepted
7 by the compiler. */
9 /* Expected results for Big Endian:
10 vec_all_eq vcmpequd.
11 vec_all_ne vcmpequd.
12 vec_any_eq vcmpequd.
13 vec_any_ne vcmpequd.
14 vec_all_gt vcmpgtud.
15 vec_all_le vcmpgtud.
16 vec_any_gt vcmpgtud.
17 vec_any_lt vcmpgtud.
18 vec_any_le vcmpgtud.
19 vec_and xxland
20 vec_andc xxlandc
21 vec_cntlz vclzd, vclzb, vclzw, vclzh
22 xvcpsgnsp vec_cpsgn
23 vec_ctf xvmuldp
24 vec_cts xvcvdpsxds, vctsxs
25 vec_ctu xvcvdpuxds, vctuxs
26 vec_div divd, divdu | __divdi3(), __udivdi3()
27 vec_mergel vmrghb, vmrghh, xxmrghw
28 vec_mergeh xxmrglw, vmrglh
29 vec_mul mulld | mullw, mulhwu
30 vec_nor xxlnor
31 vec_or xxlor
32 vec_packsu vpksdus
33 vec_perm vperm
34 vec_round xvrdpi
35 vec_sel xxsel
36 vec_xor xxlxor
37 vec_rsqrt xvrsqrtesp
38 vec_rsqrte xvrsqrtesp */
40 /* { dg-final { scan-assembler-times {\mvcmpequd\M\.} 4 } } */
41 /* { dg-final { scan-assembler-times {\mvcmpgtud\M\.} 8 } } */
42 /* { dg-final { scan-assembler-times {\mxxland\M} 16 } } */
43 /* { dg-final { scan-assembler-times {\mxxlandc\M} 13 } } */
44 /* { dg-final { scan-assembler-times {\mvclzb\M} 2 } } */
45 /* { dg-final { scan-assembler-times {\mvclzd\M} 2 } } */
46 /* { dg-final { scan-assembler-times {\mvclzw\M} 2 } } */
47 /* { dg-final { scan-assembler-times {\mvclzh\M} 2 } } */
48 /* { dg-final { scan-assembler-times {\mxvcpsgnsp\M} 1 } } */
49 /* { dg-final { scan-assembler-times {\mxvmuldp\M} 6 } } */
50 /* { dg-final { scan-assembler-times {\mxvcvdpsxds\M} 1 } } */
51 /* { dg-final { scan-assembler-times {\mvctsxs\M} 1 } } */
52 /* { dg-final { scan-assembler-times {\mxvcvdpuxds\M} 1 } } */
53 /* { dg-final { scan-assembler-times {\mvctuxs\M} 1 } } */
54 /* { dg-final { scan-assembler-times {\mvmrghb\M} 0 } } */
55 /* { dg-final { scan-assembler-times {\mvmrghh\M} 3 } } */
56 /* { dg-final { scan-assembler-times {\mxxmrghw\M} 1 } } */
57 /* { dg-final { scan-assembler-times {\mxxmrglw\M} 4 } } */
58 /* { dg-final { scan-assembler-times {\mvmrglh\M} 4 } } */
59 /* { dg-final { scan-assembler-times {\mxxlnor\M} 6 } } */
60 /* { dg-final { scan-assembler-times {(?n)\mxxlor\M.*\mboolv4si3_internal\M} 6 } } */
61 /* { dg-final { scan-assembler-times {\mvpksdus\M} 1 } } */
62 /* { dg-final { scan-assembler-times {\mvperm\M} 2 } } */
63 /* { dg-final { scan-assembler-times {\mxvrdpi\M} 1 } } */
64 /* { dg-final { scan-assembler-times {\mxxsel\M} 6 } } */
65 /* { dg-final { scan-assembler-times {\mxxlxor\M} 6 } } */
66 /* { dg-final { scan-assembler-times {\mdivd\M} 2 { target lp64 } } } */
67 /* { dg-final { scan-assembler-times {\mdivdu\M} 2 { target lp64 } } } */
68 /* { dg-final { scan-assembler-times {\mmulld\M} 4 { target lp64 } } } */
69 /* { dg-final { scan-assembler-times {\mbl __divdi3\M} 2 { target ilp32 } } } */
70 /* { dg-final { scan-assembler-times {\mbl __udivdi3\M} 2 { target ilp32 } } } */
71 /* { dg-final { scan-assembler-times {\mmullw\M} 12 { target ilp32 } } } */
72 /* { dg-final { scan-assembler-times {\mmulhwu\M} 4 { target ilp32 } } } */
74 /* The source code for the test is in builtins-1.h. */
75 #include "builtins-1.h"