Use __cpuid_count() from cpuid.h instead of custom assembly#3395
Use __cpuid_count() from cpuid.h instead of custom assembly#3395php-pulls merged 1 commit intophp:masterfrom
Conversation
|
Shouldn't there be a fallback on the assembly here? (Not familiar with the Unix build system) |
|
cpuid.h header dates as far as CentOS 6 and gcc 4.4: And gcc-mirror/gcc@25010f2#diff-7b30c1b65dd03819c31106f3963a17b3 So, in theory, it might be better to wrap the code into HAVE___CPUID_COUNT, in practise, I don't think it's worth the effort. |
|
@laruence Okay to merge? |
|
it's better to still include the asm codes as a backup... :) |
|
@laruence Why exactly? Do you know any platform that is supported and would break without the fallback to the assembly? I can’t think of any. |
|
Imho we should not include backup code unless someone actually complains. PHP already has a problem with too many useless and outdated #if's, let's please not add more. |
|
I agree with @nikic let's go without and take it from there |
|
@oerdnj I just not sure about that... |
|
ok, fine, we could add it if there comes a broken build.. |
|
While reviewing while PHP 7.3 fails to build on Debian Jessie i386 (yeah, buggy gcc), I changed the custom assembly (that doesn't have to be volatile anyway) to use
__cpuid_count()from#include <cpuid.h>(provided both by GCC and Clang).