Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix CPU architecture guards for x86 and x64 on MSVC #8

Merged
merged 1 commit into from
Apr 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/aegis128l/aegis128l.c
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ aegis128l_pick_best_implementation(void)
}
#endif

#if defined(__x86_64__) || defined(__i386__)
#if defined(__x86_64__) || defined(_M_AMD64) || defined(__i386__) || defined(_M_IX86)
if (aegis_runtime_has_aesni() && aegis_runtime_has_avx()) {
implementation = &aegis128l_aesni_implementation;
return 0;
Expand Down
2 changes: 1 addition & 1 deletion src/aegis128l/aegis128l_aesni.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if defined(__i386__) || defined(__x86_64__)
#if defined(__i386__) || defined(_M_IX86) || defined(__x86_64__) || defined(_M_AMD64)

# include <errno.h>
# include <stddef.h>
Expand Down
2 changes: 1 addition & 1 deletion src/aegis128x2/aegis128x2.c
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ aegis128x2_pick_best_implementation(void)
}
#endif

#if defined(__x86_64__) || defined(__i386__)
#if defined(__x86_64__) || defined(_M_AMD64) || defined(__i386__) || defined(_M_IX86)
if (aegis_runtime_has_vaes() && aegis_runtime_has_avx2()) {
implementation = &aegis128x2_avx2_implementation;
return 0;
Expand Down
2 changes: 1 addition & 1 deletion src/aegis128x2/aegis128x2_aesni.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if defined(__i386__) || defined(__x86_64__)
#if defined(__i386__) || defined(_M_IX86) || defined(__x86_64__) || defined(_M_AMD64)

# include <errno.h>
# include <stddef.h>
Expand Down
2 changes: 1 addition & 1 deletion src/aegis128x2/aegis128x2_avx2.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if defined(__i386__) || defined(__x86_64__)
#if defined(__i386__) || defined(_M_IX86) || defined(__x86_64__) || defined(_M_AMD64)

# include <errno.h>
# include <stddef.h>
Expand Down
2 changes: 1 addition & 1 deletion src/aegis128x4/aegis128x4.c
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ aegis128x4_pick_best_implementation(void)
}
#endif

#if defined(__x86_64__) || defined(__i386__)
#if defined(__x86_64__) || defined(_M_AMD64) || defined(__i386__) || defined(_M_IX86)
# ifdef HAVE_VAESINTRIN_H
if (aegis_runtime_has_vaes() && aegis_runtime_has_avx512f()) {
implementation = &aegis128x4_avx512_implementation;
Expand Down
2 changes: 1 addition & 1 deletion src/aegis128x4/aegis128x4_aesni.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if defined(__i386__) || defined(__x86_64__)
#if defined(__i386__) || defined(_M_IX86) || defined(__x86_64__) || defined(_M_AMD64)

# include <errno.h>
# include <stddef.h>
Expand Down
2 changes: 1 addition & 1 deletion src/aegis128x4/aegis128x4_avx2.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if defined(__i386__) || defined(__x86_64__)
#if defined(__i386__) || defined(_M_IX86) || defined(__x86_64__) || defined(_M_AMD64)

# include <errno.h>
# include <stddef.h>
Expand Down
2 changes: 1 addition & 1 deletion src/aegis128x4/aegis128x4_avx512.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if defined(__i386__) || defined(__x86_64__)
#if defined(__i386__) || defined(_M_IX86) || defined(__x86_64__) || defined(_M_AMD64)

# include <errno.h>
# include <stddef.h>
Expand Down
2 changes: 1 addition & 1 deletion src/aegis256/aegis256.c
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ aegis256_pick_best_implementation(void)
}
#endif

#if defined(__x86_64__) || defined(__i386__)
#if defined(__x86_64__) || defined(_M_AMD64) || defined(__i386__) || defined(_M_IX86)
if (aegis_runtime_has_aesni() && aegis_runtime_has_avx()) {
implementation = &aegis256_aesni_implementation;
return 0;
Expand Down
2 changes: 1 addition & 1 deletion src/aegis256/aegis256_aesni.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if defined(__i386__) || defined(__x86_64__)
#if defined(__i386__) || defined(_M_IX86) || defined(__x86_64__) || defined(_M_AMD64)

# include <errno.h>
# include <stddef.h>
Expand Down
2 changes: 1 addition & 1 deletion src/aegis256x2/aegis256x2.c
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ aegis256x2_pick_best_implementation(void)
}
#endif

#if defined(__x86_64__) || defined(__i386__)
#if defined(__x86_64__) || defined(_M_AMD64) || defined(__i386__) || defined(_M_IX86)
if (aegis_runtime_has_vaes() && aegis_runtime_has_avx2()) {
implementation = &aegis256x2_avx2_implementation;
return 0;
Expand Down
2 changes: 1 addition & 1 deletion src/aegis256x2/aegis256x2_aesni.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if defined(__i386__) || defined(__x86_64__)
#if defined(__i386__) || defined(_M_IX86) || defined(__x86_64__) || defined(_M_AMD64)

# include <errno.h>
# include <stddef.h>
Expand Down
2 changes: 1 addition & 1 deletion src/aegis256x2/aegis256x2_avx2.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if defined(__i386__) || defined(__x86_64__)
#if defined(__i386__) || defined(_M_IX86) || defined(__x86_64__) || defined(_M_AMD64)

# include <errno.h>
# include <stddef.h>
Expand Down
2 changes: 1 addition & 1 deletion src/aegis256x4/aegis256x4.c
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ aegis256x4_pick_best_implementation(void)
}
#endif

#if defined(__x86_64__) || defined(__i386__)
#if defined(__x86_64__) || defined(_M_AMD64) || defined(__i386__) || defined(_M_IX86)
# ifdef HAVE_VAESINTRIN_H
if (aegis_runtime_has_vaes() && aegis_runtime_has_avx512f()) {
implementation = &aegis256x4_avx512_implementation;
Expand Down
2 changes: 1 addition & 1 deletion src/aegis256x4/aegis256x4_aesni.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if defined(__i386__) || defined(__x86_64__)
#if defined(__i386__) || defined(_M_IX86) || defined(__x86_64__) || defined(_M_AMD64)

# include <errno.h>
# include <stddef.h>
Expand Down
2 changes: 1 addition & 1 deletion src/aegis256x4/aegis256x4_avx2.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if defined(__i386__) || defined(__x86_64__)
#if defined(__i386__) || defined(_M_IX86) || defined(__x86_64__) || defined(_M_AMD64)

# include <errno.h>
# include <stddef.h>
Expand Down
2 changes: 1 addition & 1 deletion src/aegis256x4/aegis256x4_avx512.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if defined(__i386__) || defined(__x86_64__)
#if defined(__i386__) || defined(_M_IX86) || defined(__x86_64__) || defined(_M_AMD64)

# include <errno.h>
# include <stddef.h>
Expand Down
5 changes: 3 additions & 2 deletions src/common/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,15 @@
#ifdef __ANDROID_API__
# define HAVE_ANDROID_GETCPUFEATURES
#endif
#if defined(__i386__) || defined(__x86_64__)
#if defined(__i386__) || defined(_M_IX86) || defined(__x86_64__) || defined(_M_AMD64)

# define HAVE_CPUID
# define NATIVE_LITTLE_ENDIAN
# if defined(__clang__) || defined(__GNUC__)
# define HAVE_AVX_ASM
# endif
#endif
#ifdef __x86_64__
#if defined(__x86_64__) || defined(_M_AMD64)
# define HAVE_AVXINTRIN_H
# define HAVE_AVX2INTRIN_H
# define HAVE_AVX512FINTRIN_H
Expand Down
Loading