Fix GH-15292: Dynamic AVX detection is broken for MSVC

See https://learn.microsoft.com/en-us/cpp/preprocessor/predefined-macros?view=msvc-170
For x64, either _M_X64 or _M_AMD64 would work but I'm going with what's
already used in php-src.

Closes GH-15301.
This commit is contained in:
Niels Dossche 2024-08-08 22:54:48 +02:00
parent 3a30c29d73
commit 00001c4a0c
No known key found for this signature in database
GPG Key ID: B8A8AD166DF0E2E5
2 changed files with 2 additions and 1 deletions

1
NEWS
View File

@ -10,6 +10,7 @@ PHP NEWS
type). (ilutov)
. Fixed bug GH-15181 (Disabled output handler is flushed again). (cmb)
. Passing E_USER_ERROR to trigger_error() is now deprecated. (Girgias)
. Fixed bug GH-15292 (Dynamic AVX detection is broken for MSVC). (nielsdos)
- Date:
. Constants SUNFUNCS_RET_TIMESTAMP, SUNFUNCS_RET_STRING, and SUNFUNCS_RET_DOUBLE

View File

@ -73,7 +73,7 @@ static void __zend_cpuid(uint32_t func, uint32_t subfunc, zend_cpu_info *cpuinfo
}
#endif
#if defined(__i386__) || defined(__x86_64__)
#if defined(__i386__) || defined(__x86_64__) || defined(_M_X64) || defined(_M_IX86)
/* Function based on compiler-rt implementation. */
static unsigned get_xcr0_eax(void) {
# if defined(__GNUC__) || defined(__clang__)