shaintrin.h revision 1.1 1 1.1 joerg /*===---- shaintrin.h - SHA intrinsics -------------------------------------===
2 1.1 joerg *
3 1.1 joerg * Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 1.1 joerg * See https://llvm.org/LICENSE.txt for license information.
5 1.1 joerg * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 1.1 joerg *
7 1.1 joerg *===-----------------------------------------------------------------------===
8 1.1 joerg */
9 1.1 joerg
10 1.1 joerg #ifndef __IMMINTRIN_H
11 1.1 joerg #error "Never use <shaintrin.h> directly; include <immintrin.h> instead."
12 1.1 joerg #endif
13 1.1 joerg
14 1.1 joerg #ifndef __SHAINTRIN_H
15 1.1 joerg #define __SHAINTRIN_H
16 1.1 joerg
17 1.1 joerg /* Define the default attributes for the functions in this file. */
18 1.1 joerg #define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("sha"), __min_vector_width__(128)))
19 1.1 joerg
20 1.1 joerg #define _mm_sha1rnds4_epu32(V1, V2, M) \
21 1.1 joerg __builtin_ia32_sha1rnds4((__v4si)(__m128i)(V1), (__v4si)(__m128i)(V2), (M))
22 1.1 joerg
23 1.1 joerg static __inline__ __m128i __DEFAULT_FN_ATTRS
24 1.1 joerg _mm_sha1nexte_epu32(__m128i __X, __m128i __Y)
25 1.1 joerg {
26 1.1 joerg return (__m128i)__builtin_ia32_sha1nexte((__v4si)__X, (__v4si)__Y);
27 1.1 joerg }
28 1.1 joerg
29 1.1 joerg static __inline__ __m128i __DEFAULT_FN_ATTRS
30 1.1 joerg _mm_sha1msg1_epu32(__m128i __X, __m128i __Y)
31 1.1 joerg {
32 1.1 joerg return (__m128i)__builtin_ia32_sha1msg1((__v4si)__X, (__v4si)__Y);
33 1.1 joerg }
34 1.1 joerg
35 1.1 joerg static __inline__ __m128i __DEFAULT_FN_ATTRS
36 1.1 joerg _mm_sha1msg2_epu32(__m128i __X, __m128i __Y)
37 1.1 joerg {
38 1.1 joerg return (__m128i)__builtin_ia32_sha1msg2((__v4si)__X, (__v4si)__Y);
39 1.1 joerg }
40 1.1 joerg
41 1.1 joerg static __inline__ __m128i __DEFAULT_FN_ATTRS
42 1.1 joerg _mm_sha256rnds2_epu32(__m128i __X, __m128i __Y, __m128i __Z)
43 1.1 joerg {
44 1.1 joerg return (__m128i)__builtin_ia32_sha256rnds2((__v4si)__X, (__v4si)__Y, (__v4si)__Z);
45 1.1 joerg }
46 1.1 joerg
47 1.1 joerg static __inline__ __m128i __DEFAULT_FN_ATTRS
48 1.1 joerg _mm_sha256msg1_epu32(__m128i __X, __m128i __Y)
49 1.1 joerg {
50 1.1 joerg return (__m128i)__builtin_ia32_sha256msg1((__v4si)__X, (__v4si)__Y);
51 1.1 joerg }
52 1.1 joerg
53 1.1 joerg static __inline__ __m128i __DEFAULT_FN_ATTRS
54 1.1 joerg _mm_sha256msg2_epu32(__m128i __X, __m128i __Y)
55 1.1 joerg {
56 1.1 joerg return (__m128i)__builtin_ia32_sha256msg2((__v4si)__X, (__v4si)__Y);
57 1.1 joerg }
58 1.1 joerg
59 1.1 joerg #undef __DEFAULT_FN_ATTRS
60 1.1 joerg
61 1.1 joerg #endif /* __SHAINTRIN_H */
62