From: Andrey Kamaev Date: Wed, 25 Apr 2012 11:33:11 +0000 (+0000) Subject: Fixed most of the floating-point accuracy problems for x86 gcc X-Git-Tag: accepted/tizen/6.0/unified/20201030.111113~1314^2~1999 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8d130ff10cfefefd94c7ddfd5d8f588ee0833811;p=platform%2Fupstream%2Fopencv.git Fixed most of the floating-point accuracy problems for x86 gcc --- diff --git a/cmake/OpenCVCompilerOptions.cmake b/cmake/OpenCVCompilerOptions.cmake index 45e5b23..334d469 100644 --- a/cmake/OpenCVCompilerOptions.cmake +++ b/cmake/OpenCVCompilerOptions.cmake @@ -109,7 +109,11 @@ if(CMAKE_COMPILER_IS_GNUCXX) if(X86 OR X86_64) if(NOT APPLE AND CMAKE_SIZEOF_VOID_P EQUAL 4) - set(OPENCV_EXTRA_C_FLAGS_RELEASE "${OPENCV_EXTRA_C_FLAGS_RELEASE} -mfpmath=387") + if(ENABLE_SSE2) + set(OPENCV_EXTRA_C_FLAGS_RELEASE "${OPENCV_EXTRA_C_FLAGS_RELEASE} -mfpmath=sse")# !! important - be on the same wave with x64 compilers + else() + set(OPENCV_EXTRA_C_FLAGS_RELEASE "${OPENCV_EXTRA_C_FLAGS_RELEASE} -mfpmath=387") + endif() endif() endif() diff --git a/modules/core/src/stat.cpp b/modules/core/src/stat.cpp index 3d3b23e..7bdbc29 100644 --- a/modules/core/src/stat.cpp +++ b/modules/core/src/stat.cpp @@ -834,7 +834,6 @@ float normL2Sqr_(const float* a, const float* b, int n) } else #endif - //vz why do we need unroll here? no sse = no need to unroll { for( ; j <= n - 4; j += 4 ) { @@ -875,7 +874,6 @@ float normL1_(const float* a, const float* b, int n) } else #endif - //vz no need to unroll here - if no sse { for( ; j <= n - 4; j += 4 ) { @@ -916,7 +914,6 @@ int normL1_(const uchar* a, const uchar* b, int n) } else #endif - //vz why do we need unroll here? no sse = no unroll { for( ; j <= n - 4; j += 4 ) { diff --git a/modules/nonfree/test/test_features2d.cpp b/modules/nonfree/test/test_features2d.cpp index 9dff956..54d12d3 100644 --- a/modules/nonfree/test/test_features2d.cpp +++ b/modules/nonfree/test/test_features2d.cpp @@ -992,7 +992,7 @@ TEST( Features2d_DescriptorExtractor_SIFT, regression ) TEST( Features2d_DescriptorExtractor_SURF, regression ) { - CV_DescriptorExtractorTest > test( "descriptor-surf", 0.035f, + CV_DescriptorExtractorTest > test( "descriptor-surf", 0.05f, DescriptorExtractor::create("SURF"), 0.147372f ); test.safe_run(); }