Handle T_HRESULT types in CodeView records
[official-gcc.git] / gcc / testsuite / gcc.target / powerpc / crypto-builtin-1.c
blobde6391909a9d93e237bc3db43019c9617a8c8f1e
1 /* { dg-do compile { target { powerpc*-*-* } } } */
2 /* { dg-skip-if "" { powerpc*-*-darwin* } } */
3 /* { dg-options "-mdejagnu-cpu=power8 -mvsx -O2 -ftree-vectorize -fvect-cost-model=dynamic -fno-unroll-loops -fno-unroll-all-loops" } */
4 /* { dg-require-effective-target powerpc_vsx } */
6 #include <altivec.h>
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;
13 crypto_t crypto1 (crypto_t a)
15 return __builtin_crypto_vsbox (a);
18 v16qi_t crypto1_be (v16qi_t a)
20 return vec_sbox_be (a);
23 crypto_t crypto2 (crypto_t a, crypto_t b)
25 return __builtin_crypto_vcipher (a, b);
28 v16qi_t crypto2_be (v16qi_t a, v16qi_t b)
30 return vec_cipher_be (a, b);
33 crypto_t crypto3 (crypto_t a, crypto_t b)
35 return __builtin_crypto_vcipherlast (a, b);
38 v16qi_t crypto3_be (v16qi_t a, v16qi_t b)
40 return vec_cipherlast_be (a, b);
43 crypto_t crypto4 (crypto_t a, crypto_t b)
45 return __builtin_crypto_vncipher (a, b);
48 v16qi_t crypto4_be (v16qi_t a, v16qi_t b)
50 return vec_ncipher_be (a, b);
53 crypto_t crypto5 (crypto_t a, crypto_t b)
55 return __builtin_crypto_vncipherlast (a, b);
58 v16qi_t crypto5_be (v16qi_t a, v16qi_t b)
60 return vec_ncipherlast_be (a, b);
63 v16qi_t crypto6a (v16qi_t a, v16qi_t b, v16qi_t c)
65 return __builtin_crypto_vpermxor (a, b, c);
68 v8hi_t crypto6b (v8hi_t a, v8hi_t b, v8hi_t c)
70 return __builtin_crypto_vpermxor (a, b, c);
73 v4si_t crypto6c (v4si_t a, v4si_t b, v4si_t c)
75 return __builtin_crypto_vpermxor (a, b, c);
78 v2di_t crypto6d (v2di_t a, v2di_t b, v2di_t c)
80 return __builtin_crypto_vpermxor (a, b, c);
83 v16qi_t crypto7a (v16qi_t a, v16qi_t b)
85 return __builtin_crypto_vpmsumb (a, b);
88 v16qi_t crypto7b (v16qi_t a, v16qi_t b)
90 return __builtin_crypto_vpmsum (a, b);
93 v8hi_t crypto7c (v8hi_t a, v8hi_t b)
95 return __builtin_crypto_vpmsumh (a, b);
98 v8hi_t crypto7d (v8hi_t a, v8hi_t b)
100 return __builtin_crypto_vpmsum (a, b);
103 v4si_t crypto7e (v4si_t a, v4si_t b)
105 return __builtin_crypto_vpmsumw (a, b);
108 v4si_t crypto7f (v4si_t a, v4si_t b)
110 return __builtin_crypto_vpmsum (a, b);
113 v2di_t crypto7g (v2di_t a, v2di_t b)
115 return __builtin_crypto_vpmsumd (a, b);
118 v2di_t crypto7h (v2di_t a, v2di_t b)
120 return __builtin_crypto_vpmsum (a, b);
123 v2di_t crypto8a (v2di_t a)
125 return __builtin_crypto_vshasigmad (a, 0, 8);
128 v2di_t crypto8b (v2di_t a)
130 return __builtin_crypto_vshasigma (a, 0, 8);
133 v4si_t crypto8c (v4si_t a)
135 return __builtin_crypto_vshasigmaw (a, 1, 15);
138 v4si_t crypto8d (v4si_t a)
140 return __builtin_crypto_vshasigma (a, 1, 15);
143 /* Note space is used after the instruction so that vcipherlast does not match
144 vcipher. */
145 /* { dg-final { scan-assembler-times "vcipher " 2 } } */
146 /* { dg-final { scan-assembler-times "vcipherlast " 2 } } */
147 /* { dg-final { scan-assembler-times "vncipher " 2 } } */
148 /* { dg-final { scan-assembler-times "vncipherlast " 2 } } */
149 /* { dg-final { scan-assembler-times "vpermxor " 4 } } */
150 /* { dg-final { scan-assembler-times "vpmsumb " 2 } } */
151 /* { dg-final { scan-assembler-times "vpmsumd " 2 } } */
152 /* { dg-final { scan-assembler-times "vpmsumh " 2 } } */
153 /* { dg-final { scan-assembler-times "vpmsumw " 2 } } */
154 /* { dg-final { scan-assembler-times "vsbox " 2 } } */
155 /* { dg-final { scan-assembler-times "vshasigmad " 2 } } */
156 /* { dg-final { scan-assembler-times "vshasigmaw " 2 } } */