__wmmintrin_aes.h revision 296417
11541Srgrimes/*===---- __wmmintrin_aes.h - AES intrinsics -------------------------------===
21541Srgrimes *
31541Srgrimes * Permission is hereby granted, free of charge, to any person obtaining a copy
41541Srgrimes * of this software and associated documentation files (the "Software"), to deal
51541Srgrimes * in the Software without restriction, including without limitation the rights
61541Srgrimes * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
71541Srgrimes * copies of the Software, and to permit persons to whom the Software is
81541Srgrimes * furnished to do so, subject to the following conditions:
91541Srgrimes *
101541Srgrimes * The above copyright notice and this permission notice shall be included in
111541Srgrimes * all copies or substantial portions of the Software.
121541Srgrimes *
131541Srgrimes * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
141541Srgrimes * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
151541Srgrimes * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
161541Srgrimes * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
171541Srgrimes * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
181541Srgrimes * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
191541Srgrimes * THE SOFTWARE.
201541Srgrimes *
211541Srgrimes *===-----------------------------------------------------------------------===
221541Srgrimes */
231541Srgrimes#ifndef _WMMINTRIN_AES_H
241541Srgrimes#define _WMMINTRIN_AES_H
251541Srgrimes
261541Srgrimes#include <emmintrin.h>
271541Srgrimes
281541Srgrimes/* Define the default attributes for the functions in this file. */
291541Srgrimes#define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("aes")))
301541Srgrimes
311541Srgrimesstatic __inline__ __m128i __DEFAULT_FN_ATTRS
321541Srgrimes_mm_aesenc_si128(__m128i __V, __m128i __R)
331541Srgrimes{
341541Srgrimes  return (__m128i)__builtin_ia32_aesenc128(__V, __R);
3550477Speter}
361541Srgrimes
371541Srgrimesstatic __inline__ __m128i __DEFAULT_FN_ATTRS
381541Srgrimes_mm_aesenclast_si128(__m128i __V, __m128i __R)
391541Srgrimes{
401541Srgrimes  return (__m128i)__builtin_ia32_aesenclast128(__V, __R);
411541Srgrimes}
421541Srgrimes
431541Srgrimesstatic __inline__ __m128i __DEFAULT_FN_ATTRS
441541Srgrimes_mm_aesdec_si128(__m128i __V, __m128i __R)
451541Srgrimes{
461541Srgrimes  return (__m128i)__builtin_ia32_aesdec128(__V, __R);
47103506Smike}
48103506Smike
49103506Smikestatic __inline__ __m128i __DEFAULT_FN_ATTRS
50103506Smike_mm_aesdeclast_si128(__m128i __V, __m128i __R)
51103506Smike{
52103506Smike  return (__m128i)__builtin_ia32_aesdeclast128(__V, __R);
531541Srgrimes}
541541Srgrimes
55103506Smikestatic __inline__ __m128i __DEFAULT_FN_ATTRS
56103506Smike_mm_aesimc_si128(__m128i __V)
57103506Smike{
58103506Smike  return (__m128i)__builtin_ia32_aesimc128(__V);
59103506Smike}
60103506Smike
61103506Smike#define _mm_aeskeygenassist_si128(C, R) \
62103506Smike  (__m128i)__builtin_ia32_aeskeygenassist128((__v2di)(__m128i)(C), (int)(R))
63103506Smike
64103506Smike#undef __DEFAULT_FN_ATTRS
651541Srgrimes
661541Srgrimes#endif  /* _WMMINTRIN_AES_H */
671541Srgrimes