Skip to content

Commit 00001c4

Browse files
committed
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.
1 parent 3a30c29 commit 00001c4

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

NEWS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ PHP NEWS
1010
type). (ilutov)
1111
. Fixed bug GH-15181 (Disabled output handler is flushed again). (cmb)
1212
. Passing E_USER_ERROR to trigger_error() is now deprecated. (Girgias)
13+
. Fixed bug GH-15292 (Dynamic AVX detection is broken for MSVC). (nielsdos)
1314

1415
- Date:
1516
. Constants SUNFUNCS_RET_TIMESTAMP, SUNFUNCS_RET_STRING, and SUNFUNCS_RET_DOUBLE

Zend/zend_cpuinfo.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ static void __zend_cpuid(uint32_t func, uint32_t subfunc, zend_cpu_info *cpuinfo
7373
}
7474
#endif
7575

76-
#if defined(__i386__) || defined(__x86_64__)
76+
#if defined(__i386__) || defined(__x86_64__) || defined(_M_X64) || defined(_M_IX86)
7777
/* Function based on compiler-rt implementation. */
7878
static unsigned get_xcr0_eax(void) {
7979
# if defined(__GNUC__) || defined(__clang__)

0 commit comments

Comments
 (0)