1 /* Copyright (C) 2018 Free Software Foundation, Inc.
3 This file is part of GCC.
5 GCC is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 3, or (at your option)
10 GCC is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 Under Section 7 of GPL version 3, you are granted additional
16 permissions described in the GCC Runtime Library Exception, version
17 3.1, as published by the Free Software Foundation.
19 You should have received a copy of the GNU General Public License and
20 a copy of the GCC Runtime Library Exception along with this program;
21 see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
22 <http://www.gnu.org/licenses/>. */
24 #if !defined _IMMINTRIN_H_INCLUDED
25 # error "Never use <keylockerintrin.h> directly; include <x86intrin.h> instead."
28 #ifndef _KEYLOCKERINTRIN_H_INCLUDED
29 #define _KEYLOCKERINTRIN_H_INCLUDED
32 #pragma GCC push_options
33 #pragma GCC target("kl")
34 #define __DISABLE_KL__
39 void __attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
40 _mm_loadiwkey (unsigned int __I
, __m128i __A
, __m128i __B
, __m128i __C
)
42 __builtin_ia32_loadiwkey ((__v2di
) __B
, (__v2di
) __C
, (__v2di
) __A
, __I
);
46 unsigned int __attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
47 _mm_encodekey128_u32 (unsigned int __I
, __m128i __A
, void * __P
)
49 return __builtin_ia32_encodekey128_u32 (__I
, (__v2di
)__A
, __P
);
53 unsigned int __attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
54 _mm_encodekey256_u32 (unsigned int __I
, __m128i __A
, __m128i __B
, void * __P
)
56 return __builtin_ia32_encodekey256_u32 (__I
, (__v2di
)__A
, (__v2di
)__B
, __P
);
60 unsigned char __attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
61 _mm_aesdec128kl_u8 (__m128i
* __A
, __m128i __B
, const void * __P
)
63 return __builtin_ia32_aesdec128kl_u8 ((__v2di
*) __A
, (__v2di
) __B
, __P
);
67 unsigned char __attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
68 _mm_aesdec256kl_u8 (__m128i
* __A
, __m128i __B
, const void * __P
)
70 return __builtin_ia32_aesdec256kl_u8 ((__v2di
*) __A
, (__v2di
) __B
, __P
);
74 unsigned char __attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
75 _mm_aesenc128kl_u8 (__m128i
* __A
, __m128i __B
, const void * __P
)
77 return __builtin_ia32_aesenc128kl_u8 ((__v2di
*) __A
, (__v2di
) __B
, __P
);
81 unsigned char __attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
82 _mm_aesenc256kl_u8 (__m128i
* __A
, __m128i __B
, const void * __P
)
84 return __builtin_ia32_aesenc256kl_u8 ((__v2di
*) __A
, (__v2di
) __B
, __P
);
89 #pragma GCC pop_options
90 #endif /* __DISABLE_KL__ */
93 #pragma GCC push_options
94 #pragma GCC target("widekl")
95 #define __DISABLE_WIDEKL__
96 #endif /* __WIDEKL__ */
99 unsigned char __attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
100 _mm_aesdecwide128kl_u8(__m128i __A
[8], const __m128i __B
[8], const void * __P
)
102 return __builtin_ia32_aesdecwide128kl_u8 ((__v2di
*) __A
, (__v2di
*) __B
, __P
);
106 unsigned char __attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
107 _mm_aesdecwide256kl_u8(__m128i __A
[8], const __m128i __B
[8], const void * __P
)
109 return __builtin_ia32_aesdecwide256kl_u8 ((__v2di
*) __A
, (__v2di
*) __B
, __P
);
113 unsigned char __attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
114 _mm_aesencwide128kl_u8(__m128i __A
[8], const __m128i __B
[8], const void * __P
)
116 return __builtin_ia32_aesencwide128kl_u8 ((__v2di
*) __A
, (__v2di
*) __B
, __P
);
120 unsigned char __attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
121 _mm_aesencwide256kl_u8(__m128i __A
[8], const __m128i __B
[8], const void * __P
)
123 return __builtin_ia32_aesencwide256kl_u8 ((__v2di
*) __A
, (__v2di
*) __B
, __P
);
125 #ifdef __DISABLE_WIDEKL__
126 #undef __DISABLE_WIDEKL__
127 #pragma GCC pop_options
128 #endif /* __DISABLE_WIDEKL__ */
129 #endif /* _KEYLOCKERINTRIN_H_INCLUDED */