Skip to content

Commit

Permalink
aes: initial implementation of most aes instructions (#1072)
Browse files Browse the repository at this point in the history
  • Loading branch information
Vineg committed Oct 13, 2023
1 parent aae2245 commit 8632391
Show file tree
Hide file tree
Showing 7 changed files with 983 additions and 1 deletion.
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Expand Up @@ -106,6 +106,7 @@ jobs:
- -mavx
- -mfma
- -mavx2
- -maes
include:
- target: tgl
- isax: -mavx512bw -mavx512vl -mavx512cd -mavx512dq -mavx512vbmi -mavx512ifma -mavx512vpopcntdq -mavx512bitalg -mavx512vnni -mvpclmulqdq -mavx512fp16
Expand Down
1 change: 1 addition & 0 deletions meson.build
Expand Up @@ -393,6 +393,7 @@ if not meson.is_subproject()

install_headers(
files([
'simde/x86/aes.h',
'simde/x86/avx512.h',
'simde/x86/avx2.h',
'simde/x86/avx.h',
Expand Down
3 changes: 3 additions & 0 deletions simde/simde-arch.h
Expand Up @@ -339,6 +339,9 @@
# if defined(__F16C__) || (defined(HEDLEY_MSVC_VERSION) && HEDLEY_MSVC_VERSION_CHECK(19,30,0) && defined(SIMDE_ARCH_X86_AVX2) )
# define SIMDE_ARCH_X86_F16C 1
# endif
# if defined(__AES__)
# define SIMDE_ARCH_X86_AES 1
# endif
#endif

/* Itanium
Expand Down
16 changes: 16 additions & 0 deletions simde/simde-features.h
Expand Up @@ -241,6 +241,15 @@
#define SIMDE_X86_SSE2_NATIVE
#endif

#if !defined(SIMDE_X86_AES_NATIVE) && !defined(SIMDE_X86_AES_NO_NATIVE) && !defined(SIMDE_NO_NATIVE)
#if defined(SIMDE_ARCH_X86_AES)
#define SIMDE_X86_AES_NATIVE
#endif
#endif
#if defined(SIMDE_X86_AES_NATIVE) && !defined(SIMDE_X86_SSE2_NATIVE)
#define SIMDE_X86_SSE2_NATIVE
#endif

#if !defined(SIMDE_X86_SSE2_NATIVE) && !defined(SIMDE_X86_SSE2_NO_NATIVE) && !defined(SIMDE_NO_NATIVE)
#if defined(SIMDE_ARCH_X86_SSE2)
#define SIMDE_X86_SSE2_NATIVE
Expand Down Expand Up @@ -324,6 +333,10 @@
#endif
#endif

#if defined(SIMDE_X86_AES_NATIVE)
#include <wmmintrin.h>
#endif

#if defined(HEDLEY_MSVC_VERSION)
#pragma warning(pop)
#endif
Expand Down Expand Up @@ -647,6 +660,9 @@
#if !defined(SIMDE_X86_F16C_NATIVE)
#define SIMDE_X86_F16C_ENABLE_NATIVE_ALIASES
#endif
#if !defined(SIMDE_X86_AES_NATIVE)
#define SIMDE_X86_AES_ENABLE_NATIVE_ALIASES
#endif

#if !defined(SIMDE_ARM_NEON_A32V7_NATIVE)
#define SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES
Expand Down
605 changes: 605 additions & 0 deletions simde/x86/aes.h

Large diffs are not rendered by default.

355 changes: 355 additions & 0 deletions test/x86/aes.c

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion test/x86/meson.build
Expand Up @@ -13,7 +13,8 @@ simde_test_x86_tests = [
'gfni',
'clmul',
'svml',
'xop'
'xop',
'aes'
]

subdir('avx512')
Expand Down

0 comments on commit 8632391

Please sign in to comment.