From 578ca872e4ba042bcdb88ea05593b40315a90cc8 Mon Sep 17 00:00:00 2001 From: Vincent Rabaud Date: Sun, 13 Mar 2011 22:51:33 +0000 Subject: [PATCH] - add support for the popcnt instruction (useful for the Hamming distance, soon to come in BRIEF and FLANN) --- modules/core/include/opencv2/core/core.hpp | 1 + modules/core/include/opencv2/core/core_c.h | 1 + modules/core/src/system.cpp | 1 + 3 files changed, 3 insertions(+) diff --git a/modules/core/include/opencv2/core/core.hpp b/modules/core/include/opencv2/core/core.hpp index 57cfcaedf2..ba6a0d18b7 100644 --- a/modules/core/include/opencv2/core/core.hpp +++ b/modules/core/include/opencv2/core/core.hpp @@ -262,6 +262,7 @@ CV_EXPORTS int64 getCPUTickCount(); - CV_CPU_SSSE3 - SSSE 3 - CV_CPU_SSE4_1 - SSE 4.1 - CV_CPU_SSE4_2 - SSE 4.2 + - CV_CPU_POPCNT - POPCOUNT - CV_CPU_AVX - AVX \note {Note that the function output is not static. Once you called cv::useOptimized(false), diff --git a/modules/core/include/opencv2/core/core_c.h b/modules/core/include/opencv2/core/core_c.h index cfd8bf4977..8e0b77051c 100644 --- a/modules/core/include/opencv2/core/core_c.h +++ b/modules/core/include/opencv2/core/core_c.h @@ -1705,6 +1705,7 @@ CVAPI(double) cvGetTickFrequency( void ); #define CV_CPU_SSSE3 5 #define CV_CPU_SSE4_1 6 #define CV_CPU_SSE4_2 7 +#define CV_CPU_POPCNT 8 #define CV_CPU_AVX 10 #define CV_HARDWARE_MAX_FEATURE 255 diff --git a/modules/core/src/system.cpp b/modules/core/src/system.cpp index f3f156d8e4..bae3780f76 100644 --- a/modules/core/src/system.cpp +++ b/modules/core/src/system.cpp @@ -139,6 +139,7 @@ struct HWFeatures f.have[CV_CPU_SSSE3] = (cpuid_data[2] & (1<<9)) != 0; f.have[CV_CPU_SSE4_1] = (cpuid_data[2] & (1<<19)) != 0; f.have[CV_CPU_SSE4_2] = (cpuid_data[2] & (1<<20)) != 0; + f.have[CV_CPU_POPCNT] = (cpuid_data[2] & (1<<23)) != 0; f.have[CV_CPU_AVX] = (cpuid_data[2] & (1<<28)) != 0; } -- GitLab