Modified SSE4.1 and 4.2 checks with _may_i_use_cpu_feature()
This commit is contained in:
parent
6166d08183
commit
27e640d640
|
|
@ -33,7 +33,6 @@ using namespace std;
|
|||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
cout << "AVX supported? " << _may_i_use_cpu_feature(_FEATURE_AVX) << endl ;
|
||||
#define BATCH_SIZE 10000
|
||||
if(argc < 2)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -59,26 +59,28 @@ bool is_avx_supported()
|
|||
|
||||
bool is_sse41_supported()
|
||||
{
|
||||
int ecx = 0, edx = 0, ebx = 0;
|
||||
__asm__("cpuid"
|
||||
: "=b" (ebx),
|
||||
"=c" (ecx),
|
||||
"=d" (edx)
|
||||
: "a" (1)
|
||||
);
|
||||
return ((ecx >> 19)&1) == 1;
|
||||
return (_may_i_use_cpu_feature(_FEATURE_SSE4_1) > 0);
|
||||
//int ecx = 0, edx = 0, ebx = 0;
|
||||
//__asm__("cpuid"
|
||||
//: "=b" (ebx),
|
||||
//"=c" (ecx),
|
||||
//"=d" (edx)
|
||||
//: "a" (1)
|
||||
//);
|
||||
//return ((ecx >> 19)&1) == 1;
|
||||
}
|
||||
|
||||
bool is_sse42_supported()
|
||||
{
|
||||
int ecx = 0, edx = 0, ebx = 0;
|
||||
__asm__("cpuid"
|
||||
: "=b" (ebx),
|
||||
"=c" (ecx),
|
||||
"=d" (edx)
|
||||
: "a" (1)
|
||||
);
|
||||
return ((ecx >> 20)&1) == 1;
|
||||
return (_may_i_use_cpu_feature(_FEATURE_SSE4_2) > 0);
|
||||
//int ecx = 0, edx = 0, ebx = 0;
|
||||
//__asm__("cpuid"
|
||||
//: "=b" (ebx),
|
||||
//"=c" (ecx),
|
||||
//"=d" (edx)
|
||||
//: "a" (1)
|
||||
//);
|
||||
//return ((ecx >> 20)&1) == 1;
|
||||
}
|
||||
|
||||
uint64_t get_machine_capabilities()
|
||||
|
|
|
|||
Binary file not shown.
Loading…
Reference in New Issue