Skip to content

Commit 9c1f2ba

Browse files
committed
Use zend_cpu_supports
1 parent ca77f1f commit 9c1f2ba

File tree

2 files changed

+3
-71
lines changed

2 files changed

+3
-71
lines changed

ext/opcache/jit/zend_cpuid.h

Lines changed: 0 additions & 60 deletions
This file was deleted.

ext/opcache/jit/zend_jit_x86.dasc

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@
6363

6464
|.define HYBRID_SPAD, 16
6565

66+
#include "Zend/zend_cpuinfo.h"
6667
#include "jit/zend_jit_x86.h"
67-
#include "jit/zend_cpuid.h"
6868

6969
const char* zend_reg_name[] = {
7070
#ifdef __x86_64__
@@ -2161,21 +2161,13 @@ static const zend_jit_stub zend_jit_stubs[] = {
21612161

21622162
static int zend_jit_setup(void)
21632163
{
2164-
zend_cpuid_info info;
2165-
2166-
zend_cpuid(0, 0, &info);
2167-
if (info.eax < 1) {
2168-
return FAILURE;
2169-
}
2170-
zend_cpuid(1, 0, &info);
2171-
21722164
|.if SSE
2173-
if (!(info.edx & ZEND_CPUID_EDX_SSE2)) {
2165+
if (!zend_cpu_supports(ZEND_CPU_FEATURE_SSE2)) {
21742166
zend_error(E_CORE_ERROR, "CPU doesn't support SSE2");
21752167
return FAILURE;
21762168
}
21772169
if (zend_jit_cpu_flags & ZEND_JIT_CPU_AVX) {
2178-
if (info.ecx & ZEND_CPUID_ECX_AVX) {
2170+
if (zend_cpu_supports(ZEND_CPU_FEATURE_AVX)) {
21792171
zend_jit_x86_flags |= ZEND_JIT_CPU_AVX;
21802172
}
21812173
}

0 commit comments

Comments
 (0)