Skip to content

Commit 4799cde

Browse files
committed
Merge branch 'master' of https://github.com/oerdnj/php-src
* 'master' of https://github.com/oerdnj/php-src: Use __cpuid_count() from cpuid.h instead of custom assembly
2 parents 0b76865 + 1a07811 commit 4799cde

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

Zend/zend_cpuinfo.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,9 @@ typedef struct _zend_cpu_info {
2929
static zend_cpu_info cpuinfo = {0};
3030

3131
#if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))
32+
#include <cpuid.h>
3233
static void __zend_cpuid(uint32_t func, uint32_t subfunc, zend_cpu_info *cpuinfo) {
33-
__asm__ __volatile__ (
34-
"cpuid"
35-
: "=a"(cpuinfo->eax), "=b"(cpuinfo->ebx), "=c"(cpuinfo->ecx), "=d"(cpuinfo->edx)
36-
: "a"(func), "c"(subfunc)
37-
);
34+
__cpuid_count(func, subfunc, cpuinfo->eax, cpuinfo->ebx, cpuinfo->ecx, cpuinfo->edx);
3835
}
3936
#elif defined(ZEND_WIN32)
4037
# include <intrin.h>

0 commit comments

Comments
 (0)