We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 043a11c + 5a361c3 commit beaea5cCopy full SHA for beaea5c
Zend/zend_cpuinfo.c
@@ -77,16 +77,24 @@ void zend_cpu_startup(void)
77
{
78
if (!cpuinfo.initialized) {
79
zend_cpu_info ebx;
80
+ int max_feature;
81
82
cpuinfo.initialized = 1;
83
__zend_cpuid(0, 0, &cpuinfo);
- if (cpuinfo.eax == 0) {
84
+ max_feature = cpuinfo.eax;
85
+ if (max_feature == 0) {
86
return;
87
}
88
+
89
__zend_cpuid(1, 0, &cpuinfo);
90
91
/* for avx2 */
- __zend_cpuid(7, 0, &ebx);
- cpuinfo.ebx = ebx.ebx;
92
+ if (max_feature >= 7) {
93
+ __zend_cpuid(7, 0, &ebx);
94
+ cpuinfo.ebx = ebx.ebx;
95
+ } else {
96
+ cpuinfo.ebx = 0;
97
+ }
98
99
100
0 commit comments