Debian Codegraph @

gcc/testsuite/gcc.target/i386/aes-pr114576.c

raw
1 /* PR target/114576 */
2 /* { dg-do compile } */
3 /* { dg-options "-O2 -maes -mno-avx" } */
4 /* { dg-final { scan-assembler-times "\taesenc\t" 2 } } */
5 /* { dg-final { scan-assembler-times "\taesdec\t" 2 } } */
6 /* { dg-final { scan-assembler-times "\taesenclast\t" 2 } } */
7 /* { dg-final { scan-assembler-times "\taesdeclast\t" 2 } } */
8 /* { dg-final { scan-assembler-not "\tvaesenc" } } */
9 /* { dg-final { scan-assembler-not "\tvaesdec" } } */
10
11 #include <immintrin.h>
12
13 __m128i
14 f1 (__m128i x, __m128i y)
15 {
16 return _mm_aesenc_si128 (x, y);
17 }
18
19 __m128i
20 f2 (__m128i x, __m128i y)
21 {
22 __m128i z = _mm_aesenc_si128 (x, y);
23 return z + x + y;
24 }
25
26 __m128i
27 f3 (__m128i x, __m128i y)
28 {
29 return _mm_aesdec_si128 (x, y);
30 }
31
32 __m128i
33 f4 (__m128i x, __m128i y)
34 {
35 __m128i z = _mm_aesdec_si128 (x, y);
36 return z + x + y;
37 }
38
39 __m128i
40 f5 (__m128i x, __m128i y)
41 {
42 return _mm_aesenclast_si128 (x, y);
43 }
44
45 __m128i
46 f6 (__m128i x, __m128i y)
47 {
48 __m128i z = _mm_aesenclast_si128 (x, y);
49 return z + x + y;
50 }
51
52 __m128i
53 f7 (__m128i x, __m128i y)
54 {
55 return _mm_aesdeclast_si128 (x, y);
56 }
57
58 __m128i
59 f8 (__m128i x, __m128i y)
60 {
61 __m128i z = _mm_aesdeclast_si128 (x, y);
62 return z + x + y;
63 }