]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/testsuite/gcc.target/powerpc/crypto-builtin-1.c
Get rid of dg-skip-if etc. default args
[thirdparty/gcc.git] / gcc / testsuite / gcc.target / powerpc / crypto-builtin-1.c
1 /* { dg-do compile { target { powerpc*-*-* } } } */
2 /* { dg-skip-if "" { powerpc*-*-darwin* } } */
3 /* { dg-require-effective-target powerpc_p8vector_ok } */
4 /* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power8" } } */
5 /* { dg-options "-mcpu=power8 -O2 -ftree-vectorize -fvect-cost-model=dynamic -fno-unroll-loops -fno-unroll-all-loops" } */
6
7 typedef vector unsigned long long crypto_t;
8 typedef vector unsigned long long v2di_t;
9 typedef vector unsigned int v4si_t;
10 typedef vector unsigned short v8hi_t;
11 typedef vector unsigned char v16qi_t;
12
13 crypto_t crpyto1 (crypto_t a)
14 {
15 return __builtin_crypto_vsbox (a);
16 }
17
18 crypto_t crypto2 (crypto_t a, crypto_t b)
19 {
20 return __builtin_crypto_vcipher (a, b);
21 }
22
23 crypto_t crypto3 (crypto_t a, crypto_t b)
24 {
25 return __builtin_crypto_vcipherlast (a, b);
26 }
27
28 crypto_t crypto4 (crypto_t a, crypto_t b)
29 {
30 return __builtin_crypto_vncipher (a, b);
31 }
32
33 crypto_t crypto5 (crypto_t a, crypto_t b)
34 {
35 return __builtin_crypto_vncipherlast (a, b);
36 }
37
38 v16qi_t crypto6a (v16qi_t a, v16qi_t b, v16qi_t c)
39 {
40 return __builtin_crypto_vpermxor (a, b, c);
41 }
42
43 v8hi_t crypto6b (v8hi_t a, v8hi_t b, v8hi_t c)
44 {
45 return __builtin_crypto_vpermxor (a, b, c);
46 }
47
48 v4si_t crypto6c (v4si_t a, v4si_t b, v4si_t c)
49 {
50 return __builtin_crypto_vpermxor (a, b, c);
51 }
52
53 v2di_t crypto6d (v2di_t a, v2di_t b, v2di_t c)
54 {
55 return __builtin_crypto_vpermxor (a, b, c);
56 }
57
58 v16qi_t crypto7a (v16qi_t a, v16qi_t b)
59 {
60 return __builtin_crypto_vpmsumb (a, b);
61 }
62
63 v16qi_t crypto7b (v16qi_t a, v16qi_t b)
64 {
65 return __builtin_crypto_vpmsum (a, b);
66 }
67
68 v8hi_t crypto7c (v8hi_t a, v8hi_t b)
69 {
70 return __builtin_crypto_vpmsumh (a, b);
71 }
72
73 v8hi_t crypto7d (v8hi_t a, v8hi_t b)
74 {
75 return __builtin_crypto_vpmsum (a, b);
76 }
77
78 v4si_t crypto7e (v4si_t a, v4si_t b)
79 {
80 return __builtin_crypto_vpmsumw (a, b);
81 }
82
83 v4si_t crypto7f (v4si_t a, v4si_t b)
84 {
85 return __builtin_crypto_vpmsum (a, b);
86 }
87
88 v2di_t crypto7g (v2di_t a, v2di_t b)
89 {
90 return __builtin_crypto_vpmsumd (a, b);
91 }
92
93 v2di_t crypto7h (v2di_t a, v2di_t b)
94 {
95 return __builtin_crypto_vpmsum (a, b);
96 }
97
98 v2di_t crypto8a (v2di_t a)
99 {
100 return __builtin_crypto_vshasigmad (a, 0, 8);
101 }
102
103 v2di_t crypto8b (v2di_t a)
104 {
105 return __builtin_crypto_vshasigma (a, 0, 8);
106 }
107
108 v4si_t crypto8c (v4si_t a)
109 {
110 return __builtin_crypto_vshasigmaw (a, 1, 15);
111 }
112
113 v4si_t crypto8d (v4si_t a)
114 {
115 return __builtin_crypto_vshasigma (a, 1, 15);
116 }
117
118 /* Note space is used after the instruction so that vcipherlast does not match
119 vcipher. */
120 /* { dg-final { scan-assembler-times "vcipher " 1 } } */
121 /* { dg-final { scan-assembler-times "vcipherlast " 1 } } */
122 /* { dg-final { scan-assembler-times "vncipher " 1 } } */
123 /* { dg-final { scan-assembler-times "vncipherlast " 1 } } */
124 /* { dg-final { scan-assembler-times "vpermxor " 4 } } */
125 /* { dg-final { scan-assembler-times "vpmsumb " 2 } } */
126 /* { dg-final { scan-assembler-times "vpmsumd " 2 } } */
127 /* { dg-final { scan-assembler-times "vpmsumh " 2 } } */
128 /* { dg-final { scan-assembler-times "vpmsumw " 2 } } */
129 /* { dg-final { scan-assembler-times "vsbox " 1 } } */
130 /* { dg-final { scan-assembler-times "vshasigmad " 2 } } */
131 /* { dg-final { scan-assembler-times "vshasigmaw " 2 } } */