]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/config/i386/keylockerintrin.h
Update copyright years.
[thirdparty/gcc.git] / gcc / config / i386 / keylockerintrin.h
CommitLineData
a945c346 1/* Copyright (C) 2018-2024 Free Software Foundation, Inc.
632a2f50 2
3 This file is part of GCC.
4
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)
8 any later version.
9
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.
14
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.
18
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/>. */
23
24#if !defined _IMMINTRIN_H_INCLUDED
25# error "Never use <keylockerintrin.h> directly; include <x86intrin.h> instead."
26#endif
27
28#ifndef _KEYLOCKERINTRIN_H_INCLUDED
29#define _KEYLOCKERINTRIN_H_INCLUDED
30
31#ifndef __KL__
32#pragma GCC push_options
33#pragma GCC target("kl")
34#define __DISABLE_KL__
35#endif /* __KL__ */
36
37
38extern __inline
39void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
40_mm_loadiwkey (unsigned int __I, __m128i __A, __m128i __B, __m128i __C)
41{
42 __builtin_ia32_loadiwkey ((__v2di) __B, (__v2di) __C, (__v2di) __A, __I);
43}
44
45extern __inline
46unsigned int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
47_mm_encodekey128_u32 (unsigned int __I, __m128i __A, void * __P)
48{
49 return __builtin_ia32_encodekey128_u32 (__I, (__v2di)__A, __P);
50}
51
52extern __inline
53unsigned int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
54_mm_encodekey256_u32 (unsigned int __I, __m128i __A, __m128i __B, void * __P)
55{
56 return __builtin_ia32_encodekey256_u32 (__I, (__v2di)__A, (__v2di)__B, __P);
57}
58
59extern __inline
60unsigned char __attribute__((__gnu_inline__, __always_inline__, __artificial__))
61_mm_aesdec128kl_u8 (__m128i * __A, __m128i __B, const void * __P)
62{
63 return __builtin_ia32_aesdec128kl_u8 ((__v2di *) __A, (__v2di) __B, __P);
64}
65
66extern __inline
67unsigned char __attribute__((__gnu_inline__, __always_inline__, __artificial__))
68_mm_aesdec256kl_u8 (__m128i * __A, __m128i __B, const void * __P)
69{
70 return __builtin_ia32_aesdec256kl_u8 ((__v2di *) __A, (__v2di) __B, __P);
71}
72
73extern __inline
74unsigned char __attribute__((__gnu_inline__, __always_inline__, __artificial__))
75_mm_aesenc128kl_u8 (__m128i * __A, __m128i __B, const void * __P)
76{
77 return __builtin_ia32_aesenc128kl_u8 ((__v2di *) __A, (__v2di) __B, __P);
78}
79
80extern __inline
81unsigned char __attribute__((__gnu_inline__, __always_inline__, __artificial__))
82_mm_aesenc256kl_u8 (__m128i * __A, __m128i __B, const void * __P)
83{
84 return __builtin_ia32_aesenc256kl_u8 ((__v2di *) __A, (__v2di) __B, __P);
85}
86
87#ifdef __DISABLE_KL__
88#undef __DISABLE_KL__
89#pragma GCC pop_options
90#endif /* __DISABLE_KL__ */
91
92#ifndef __WIDEKL__
93#pragma GCC push_options
94#pragma GCC target("widekl")
95#define __DISABLE_WIDEKL__
96#endif /* __WIDEKL__ */
97
98extern __inline
99unsigned char __attribute__((__gnu_inline__, __always_inline__, __artificial__))
100_mm_aesdecwide128kl_u8(__m128i __A[8], const __m128i __B[8], const void * __P)
101{
102 return __builtin_ia32_aesdecwide128kl_u8 ((__v2di *) __A, (__v2di *) __B, __P);
103}
104
105extern __inline
106unsigned char __attribute__((__gnu_inline__, __always_inline__, __artificial__))
107_mm_aesdecwide256kl_u8(__m128i __A[8], const __m128i __B[8], const void * __P)
108{
109 return __builtin_ia32_aesdecwide256kl_u8 ((__v2di *) __A, (__v2di *) __B, __P);
110}
111
112extern __inline
113unsigned char __attribute__((__gnu_inline__, __always_inline__, __artificial__))
114_mm_aesencwide128kl_u8(__m128i __A[8], const __m128i __B[8], const void * __P)
115{
116 return __builtin_ia32_aesencwide128kl_u8 ((__v2di *) __A, (__v2di *) __B, __P);
117}
118
119extern __inline
120unsigned char __attribute__((__gnu_inline__, __always_inline__, __artificial__))
121_mm_aesencwide256kl_u8(__m128i __A[8], const __m128i __B[8], const void * __P)
122{
123 return __builtin_ia32_aesencwide256kl_u8 ((__v2di *) __A, (__v2di *) __B, __P);
124}
125#ifdef __DISABLE_WIDEKL__
126#undef __DISABLE_WIDEKL__
127#pragma GCC pop_options
128#endif /* __DISABLE_WIDEKL__ */
129#endif /* _KEYLOCKERINTRIN_H_INCLUDED */