Skip to content

Support SHA256_Transform_shani() with MSVC #15312

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

Closed
wants to merge 2 commits into from
Closed
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 ext/hash/hash_sha_ni.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

# include <immintrin.h>

# if PHP_HASH_INTRIN_SHA_RESOLVER
# if defined(PHP_HASH_INTRIN_SHA_RESOLVER) && defined(HAVE_FUNC_ATTRIBUTE_TARGET)
static __m128i be32dec_128(const uint8_t * src) __attribute__((target("ssse3")));
void SHA256_Transform_shani(uint32_t state[PHP_STATIC_RESTRICT 8], const uint8_t block[PHP_STATIC_RESTRICT 64]) __attribute__((target("ssse3,sha")));
# endif
Expand Down
4 changes: 2 additions & 2 deletions ext/hash/php_hash_sha.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@ PHP_HASH_API void PHP_SHA256Update(PHP_SHA256_CTX *, const unsigned char *, size
void SHA256_Transform_sse2(uint32_t state[PHP_STATIC_RESTRICT 8], const uint8_t block[PHP_STATIC_RESTRICT 64], uint32_t W[PHP_STATIC_RESTRICT 64], uint32_t S[PHP_STATIC_RESTRICT 8]);
#endif

#if (defined(__i386__) || defined(__x86_64__)) && defined(HAVE_IMMINTRIN_H)
#if ((defined(__i386__) || defined(__x86_64__)) && defined(HAVE_IMMINTRIN_H)) || defined(_M_X64) || defined(_M_IX86)
# if defined(__SSSE3__) && defined(__SHA__)
# define PHP_HASH_INTRIN_SHA_NATIVE 1
# elif defined(HAVE_FUNC_ATTRIBUTE_TARGET)
# elif defined(HAVE_FUNC_ATTRIBUTE_TARGET) || defined(_M_X64) || defined(_M_IX86)
# define PHP_HASH_INTRIN_SHA_RESOLVER 1
# endif
#endif
Expand Down
Loading