PATH:
lib64
/
llvm17
/
lib
/
clang
/
17
/
include
/*===-------------------- sm3intrin.h - SM3 intrinsics ---------------------=== * * Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. * See https://llvm.org/LICENSE.txt for license information. * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception * *===-----------------------------------------------------------------------=== */ #ifndef __IMMINTRIN_H #error "Never use <sm3intrin.h> directly; include <immintrin.h> instead." #endif // __IMMINTRIN_H #ifndef __SM3INTRIN_H #define __SM3INTRIN_H #define __DEFAULT_FN_ATTRS128 \ __attribute__((__always_inline__, __nodebug__, __target__("sm3"), \ __min_vector_width__(128))) /// This intrinisc is one of the two SM3 message scheduling intrinsics. The /// intrinsic performs an initial calculation for the next four SM3 message /// words. The calculated results are stored in \a dst. /// /// \headerfile <immintrin.h> /// /// \code /// __m128i _mm_sm3msg1_epi32(__m128i __A, __m128i __B, __m128i __C) /// \endcode /// /// This intrinsic corresponds to the \c VSM3MSG1 instruction. /// /// \param __A /// A 128-bit vector of [4 x int]. /// \param __B /// A 128-bit vector of [4 x int]. /// \param __C /// A 128-bit vector of [4 x int]. /// \returns /// A 128-bit vector of [4 x int]. /// /// \code{.operation} /// DEFINE ROL32(dword, n) { /// count := n % 32 /// dest := (dword << count) | (dword >> (32 - count)) /// RETURN dest /// } /// DEFINE P1(x) { /// RETURN x ^ ROL32(x, 15) ^ ROL32(x, 23) /// } /// W[0] := __C.dword[0] /// W[1] := __C.dword[1] /// W[2] := __C.dword[2] /// W[3] := __C.dword[3] /// W[7] := __A.dword[0] /// W[8] := __A.dword[1] /// W[9] := __A.dword[2] /// W[10] := __A.dword[3] /// W[13] := __B.dword[0] /// W[14] := __B.dword[1] /// W[15] := __B.dword[2] /// TMP0 := W[7] ^ W[0] ^ ROL32(W[13], 15) /// TMP1 := W[8] ^ W[1] ^ ROL32(W[14], 15) /// TMP2 := W[9] ^ W[2] ^ ROL32(W[15], 15) /// TMP3 := W[10] ^ W[3] /// dst.dword[0] := P1(TMP0) /// dst.dword[1] := P1(TMP1) /// dst.dword[2] := P1(TMP2) /// dst.dword[3] := P1(TMP3) /// dst[MAX:128] := 0 /// \endcode static __inline__ __m128i __DEFAULT_FN_ATTRS128 _mm_sm3msg1_epi32(__m128i __A, __m128i __B, __m128i __C) { return (__m128i)__builtin_ia32_vsm3msg1((__v4su)__A, (__v4su)__B, (__v4su)__C); } /// This intrinisc is one of the two SM3 message scheduling intrinsics. The /// intrinsic performs the final calculation for the next four SM3 message /// words. The calculated results are stored in \a dst. /// /// \headerfile <immintrin.h> /// /// \code /// __m128i _mm_sm3msg2_epi32(__m128i __A, __m128i __B, __m128i __C) /// \endcode /// /// This intrinsic corresponds to the \c VSM3MSG2 instruction. /// /// \param __A /// A 128-bit vector of [4 x int]. /// \param __B /// A 128-bit vector of [4 x int]. /// \param __C /// A 128-bit vector of [4 x int]. /// \returns /// A 128-bit vector of [4 x int]. /// /// \code{.operation} /// DEFINE ROL32(dword, n) { /// count := n % 32 /// dest := (dword << count) | (dword >> (32-count)) /// RETURN dest /// } /// WTMP[0] := __A.dword[0] /// WTMP[1] := __A.dword[1] /// WTMP[2] := __A.dword[2] /// WTMP[3] := __A.dword[3] /// W[3] := __B.dword[0] /// W[4] := __B.dword[1] /// W[5] := __B.dword[2] /// W[6] := __B.dword[3] /// W[10] := __C.dword[0] /// W[11] := __C.dword[1] /// W[12] := __C.dword[2] /// W[13] := __C.dword[3] /// W[16] := ROL32(W[3], 7) ^ W[10] ^ WTMP[0] /// W[17] := ROL32(W[4], 7) ^ W[11] ^ WTMP[1] /// W[18] := ROL32(W[5], 7) ^ W[12] ^ WTMP[2] /// W[19] := ROL32(W[6], 7) ^ W[13] ^ WTMP[3] /// W[19] := W[19] ^ ROL32(W[16], 6) ^ ROL32(W[16], 15) ^ ROL32(W[16], 30) /// dst.dword[0] := W[16] /// dst.dword[1] := W[17] /// dst.dword[2] := W[18] /// dst.dword[3] := W[19] /// dst[MAX:128] := 0 /// \endcode static __inline__ __m128i __DEFAULT_FN_ATTRS128 _mm_sm3msg2_epi32(__m128i __A, __m128i __B, __m128i __C) { return (__m128i)__builtin_ia32_vsm3msg2((__v4su)__A, (__v4su)__B, (__v4su)__C); } /// This intrinsic performs two rounds of SM3 operation using initial SM3 state /// (C, D, G, H) from \a __A, an initial SM3 states (A, B, E, F) /// from \a __B and a pre-computed words from the \a __C. \a __A with /// initial SM3 state of (C, D, G, H) assumes input of non-rotated left /// variables from previous state. The updated SM3 state (A, B, E, F) is /// written to \a __A. The \a imm8 should contain the even round number /// for the first of the two rounds computed by this instruction. The /// computation masks the \a imm8 value by AND’ing it with 0x3E so that only /// even round numbers from 0 through 62 are used for this operation. The /// calculated results are stored in \a dst. /// /// \headerfile <immintrin.h> /// /// \code /// __m128i _mm_sm3rnds2_epi32(__m128i __A, __m128i __B, __m128i __C, const int /// imm8) \endcode /// /// This intrinsic corresponds to the \c VSM3RNDS2 instruction. /// /// \param __A /// A 128-bit vector of [4 x int]. /// \param __B /// A 128-bit vector of [4 x int]. /// \param __C /// A 128-bit vector of [4 x int]. /// \param imm8 /// A 8-bit constant integer. /// \returns /// A 128-bit vector of [4 x int]. /// /// \code{.operation} /// DEFINE ROL32(dword, n) { /// count := n % 32 /// dest := (dword << count) | (dword >> (32-count)) /// RETURN dest /// } /// DEFINE P0(dword) { /// RETURN dword ^ ROL32(dword, 9) ^ ROL32(dword, 17) /// } /// DEFINE FF(x,y,z, round){ /// IF round < 16 /// RETURN (x ^ y ^ z) /// ELSE /// RETURN (x & y) | (x & z) | (y & z) /// FI /// } /// DEFINE GG(x, y, z, round){ /// IF round < 16 /// RETURN (x ^ y ^ z) /// ELSE /// RETURN (x & y) | (~x & z) /// FI /// } /// A[0] := __B.dword[3] /// B[0] := __B.dword[2] /// C[0] := __A.dword[3] /// D[0] := __A.dword[2] /// E[0] := __B.dword[1] /// F[0] := __B.dword[0] /// G[0] := __A.dword[1] /// H[0] := __A.dword[0] /// W[0] := __C.dword[0] /// W[1] := __C.dword[1] /// W[4] := __C.dword[2] /// W[5] := __C.dword[3] /// C[0] := ROL32(C[0], 9) /// D[0] := ROL32(D[0], 9) /// G[0] := ROL32(G[0], 19) /// H[0] := ROL32(H[0], 19) /// ROUND := __D & 0x3E /// IF ROUND < 16 /// CONST := 0x79CC4519 /// ELSE /// CONST := 0x7A879D8A /// FI /// CONST := ROL32(CONST,ROUND) /// FOR i:= 0 to 1 /// S1 := ROL32((ROL32(A[i], 12) + E[i] + CONST), 7) /// S2 := S1 ^ ROL32(A[i], 12) /// T1 := FF(A[i], B[i], C[i], ROUND) + D[i] + S2 + (W[i] ^ W[i+4]) /// T2 := GG(E[i], F[i], G[i], ROUND) + H[i] + S1 + W[i] /// D[i+1] := C[i] /// C[i+1] := ROL32(B[i],9) /// B[i+1] := A[i] /// A[i+1] := T1 /// H[i+1] := G[i] /// G[i+1] := ROL32(F[i], 19) /// F[i+1] := E[i] /// E[i+1] := P0(T2) /// CONST := ROL32(CONST, 1) /// ENDFOR /// dst.dword[3] := A[2] /// dst.dword[2] := B[2] /// dst.dword[1] := E[2] /// dst.dword[0] := F[2] /// dst[MAX:128] := 0 /// \endcode #define _mm_sm3rnds2_epi32(A, B, C, D) \ (__m128i) __builtin_ia32_vsm3rnds2((__v4su)A, (__v4su)B, (__v4su)C, (int)D) #undef __DEFAULT_FN_ATTRS128 #endif // __SM3INTRIN_H
[+]
..
[-] riscv_ntlh.h
[edit]
[-] avx512vlbitalgintrin.h
[edit]
[-] avxifmaintrin.h
[edit]
[-] mm_malloc.h
[edit]
[-] avx512vlbf16intrin.h
[edit]
[-] mwaitxintrin.h
[edit]
[-] adxintrin.h
[edit]
[-] arm_cmse.h
[edit]
[-] __clang_cuda_intrinsics.h
[edit]
[-] module.modulemap
[edit]
[-] crc32intrin.h
[edit]
[+]
cuda_wrappers
[-] msa.h
[edit]
[-] __clang_hip_stdlib.h
[edit]
[-] arm_acle.h
[edit]
[-] arm_neon_sve_bridge.h
[edit]
[-] xsaveintrin.h
[edit]
[-] velintrin_gen.h
[edit]
[-] stdatomic.h
[edit]
[-] hvx_hexagon_protos.h
[edit]
[-] uintrintrin.h
[edit]
[-] fxsrintrin.h
[edit]
[-] sha512intrin.h
[edit]
[-] __clang_cuda_texture_intrinsics.h
[edit]
[-] iso646.h
[edit]
[-] unwind.h
[edit]
[-] avx512vlbwintrin.h
[edit]
[-] avxvnniint8intrin.h
[edit]
[-] avx512erintrin.h
[edit]
[-] avxvnniintrin.h
[edit]
[-] ia32intrin.h
[edit]
[-] rdseedintrin.h
[edit]
[-] prfchiintrin.h
[edit]
[-] amxcomplexintrin.h
[edit]
[-] clflushoptintrin.h
[edit]
[-] htmxlintrin.h
[edit]
[-] avx512fintrin.h
[edit]
[-] gfniintrin.h
[edit]
[-] arm_cde.h
[edit]
[+]
ppc_wrappers
[-] amxfp16intrin.h
[edit]
[-] velintrin_approx.h
[edit]
[-] avx512pfintrin.h
[edit]
[-] stdarg.h
[edit]
[-] cmpccxaddintrin.h
[edit]
[-] avx512vlintrin.h
[edit]
[-] __clang_hip_math.h
[edit]
[-] vecintrin.h
[edit]
[-] xtestintrin.h
[edit]
[-] __wmmintrin_aes.h
[edit]
[-] arm_neon.h
[edit]
[-] immintrin.h
[edit]
[-] ammintrin.h
[edit]
[-] waitpkgintrin.h
[edit]
[-] vpclmulqdqintrin.h
[edit]
[-] fmaintrin.h
[edit]
[-] tsxldtrkintrin.h
[edit]
[-] prfchwintrin.h
[edit]
[-] avx512bitalgintrin.h
[edit]
[-] bmiintrin.h
[edit]
[-] __wmmintrin_pclmul.h
[edit]
[-] htmintrin.h
[edit]
[-] mm3dnow.h
[edit]
[-] __clang_cuda_builtin_vars.h
[edit]
[-] __clang_hip_runtime_wrapper.h
[edit]
[-] stdbool.h
[edit]
[-] altivec.h
[edit]
[-] wbnoinvdintrin.h
[edit]
[-] keylockerintrin.h
[edit]
[-] tgmath.h
[edit]
[-] hexagon_circ_brev_intrinsics.h
[edit]
[-] x86intrin.h
[edit]
[-] pkuintrin.h
[edit]
[-] avx512vbmivlintrin.h
[edit]
[-] avxneconvertintrin.h
[edit]
[-] __clang_hip_cmath.h
[edit]
[-] sgxintrin.h
[edit]
[-] f16cintrin.h
[edit]
[-] opencl-c-base.h
[edit]
[-] cpuid.h
[edit]
[-] raointintrin.h
[edit]
[-] builtins.h
[edit]
[-] emmintrin.h
[edit]
[-] smmintrin.h
[edit]
[-] vaesintrin.h
[edit]
[-] larchintrin.h
[edit]
[-] avx512ifmaintrin.h
[edit]
[-] intrin.h
[edit]
[-] avx512vlvp2intersectintrin.h
[edit]
[-] fma4intrin.h
[edit]
[-] pmmintrin.h
[edit]
[-] __clang_hip_libdevice_declares.h
[edit]
[-] limits.h
[edit]
[-] clwbintrin.h
[edit]
[-] rtmintrin.h
[edit]
[-] mmintrin.h
[edit]
[-] stddef.h
[edit]
[-] invpcidintrin.h
[edit]
[-] avx512vp2intersectintrin.h
[edit]
[-] cet.h
[edit]
[-] xopintrin.h
[edit]
[-] avx512vlvnniintrin.h
[edit]
[-] avx512vlfp16intrin.h
[edit]
[-] stdint.h
[edit]
[-] arm64intr.h
[edit]
[-] sm4intrin.h
[edit]
[-] avx512vnniintrin.h
[edit]
[-] avx2intrin.h
[edit]
[-] movdirintrin.h
[edit]
[-] tbmintrin.h
[edit]
[-] arm_mve.h
[edit]
[-] avx512ifmavlintrin.h
[edit]
[-] amxintrin.h
[edit]
[-] opencl-c.h
[edit]
[-] stdalign.h
[edit]
[-] __clang_cuda_device_functions.h
[edit]
[-] pconfigintrin.h
[edit]
[-] avx512fp16intrin.h
[edit]
[-] inttypes.h
[edit]
[-] arm_bf16.h
[edit]
[-] __clang_cuda_math_forward_declares.h
[edit]
[-] vadefs.h
[edit]
[-] shaintrin.h
[edit]
[-] hexagon_protos.h
[edit]
[-] ptwriteintrin.h
[edit]
[-] xsaveoptintrin.h
[edit]
[-] enqcmdintrin.h
[edit]
[-] x86gprintrin.h
[edit]
[-] tmmintrin.h
[edit]
[-] stdnoreturn.h
[edit]
[-] avx512bf16intrin.h
[edit]
[-] varargs.h
[edit]
[-] s390intrin.h
[edit]
[-] avx512vbmiintrin.h
[edit]
[+]
openmp_wrappers
[-] wmmintrin.h
[edit]
[-] __clang_cuda_cmath.h
[edit]
[-] clzerointrin.h
[edit]
[-] xsavesintrin.h
[edit]
[-] __clang_cuda_libdevice_declares.h
[edit]
[-] nmmintrin.h
[edit]
[-] wasm_simd128.h
[edit]
[-] xsavecintrin.h
[edit]
[-] avx512dqintrin.h
[edit]
[-] lwpintrin.h
[edit]
[-] serializeintrin.h
[edit]
[-] arm_sme_draft_spec_subject_to_change.h
[edit]
[-] avxintrin.h
[edit]
[-] __stddef_max_align_t.h
[edit]
[-] sm3intrin.h
[edit]
[-] velintrin.h
[edit]
[-] __clang_cuda_complex_builtins.h
[edit]
[-] armintr.h
[edit]
[-] avx512cdintrin.h
[edit]
[-] float.h
[edit]
[-] avx512vbmi2intrin.h
[edit]
[-] lzcntintrin.h
[edit]
[-] sifive_vector.h
[edit]
[-] rdpruintrin.h
[edit]
[-] arm_sve.h
[edit]
[-] avx512vpopcntdqintrin.h
[edit]
[-] xmmintrin.h
[edit]
[-] hresetintrin.h
[edit]
[-] bmi2intrin.h
[edit]
[-] hexagon_types.h
[edit]
[-] avx512bwintrin.h
[edit]
[-] cetintrin.h
[edit]
[-] __clang_cuda_math.h
[edit]
[-] avx512vlvbmi2intrin.h
[edit]
[-] arm_fp16.h
[edit]
[-] avx512vpopcntdqvlintrin.h
[edit]
[-] avxvnniint16intrin.h
[edit]
[+]
llvm_libc_wrappers
[-] __clang_cuda_runtime_wrapper.h
[edit]
[-] cldemoteintrin.h
[edit]
[-] avx512vldqintrin.h
[edit]
[-] avx512vlcdintrin.h
[edit]
[-] popcntintrin.h
[edit]