[x265-commits] [x265] cmake: ignore unreferenced formal paramter warnings in co...

Steve Borho steve at borho.org
Mon Dec 2 07:16:27 CET 2013


details:   http://hg.videolan.org/x265/rev/b4eef7d41af1
branches:  
changeset: 5410:b4eef7d41af1
user:      Steve Borho <steve at borho.org>
date:      Sun Dec 01 23:51:20 2013 -0600
description:
cmake: ignore unreferenced formal paramter warnings in common/vec

And remove all the hacks that were in place to avoid those warnings
Subject: [x265] vec: remove pixel-ssse3.cpp, its last function has asm coverage

details:   http://hg.videolan.org/x265/rev/bd3fad7cffec
branches:  
changeset: 5411:bd3fad7cffec
user:      Steve Borho <steve at borho.org>
date:      Sun Dec 01 23:55:18 2013 -0600
description:
vec: remove pixel-ssse3.cpp, its last function has asm coverage
Subject: [x265] cmake: ignore gcc warnings in vector intrinsic files

details:   http://hg.videolan.org/x265/rev/bb65f4686d68
branches:  
changeset: 5412:bb65f4686d68
user:      Steve Borho <steve at borho.org>
date:      Mon Dec 02 00:12:51 2013 -0600
description:
cmake: ignore gcc warnings in vector intrinsic files
Subject: [x265] cmake: nits

details:   http://hg.videolan.org/x265/rev/189ac76266a9
branches:  
changeset: 5413:189ac76266a9
user:      Steve Borho <steve at borho.org>
date:      Mon Dec 02 00:12:58 2013 -0600
description:
cmake: nits

diffstat:

 source/common/CMakeLists.txt         |  37 +++++++++++++---------
 source/common/vec/dct-sse3.cpp       |   2 -
 source/common/vec/dct-ssse3.cpp      |   4 +-
 source/common/vec/intra-sse41.cpp    |   4 +-
 source/common/vec/ipfilter-ssse3.cpp |   4 +-
 source/common/vec/pixel-sse41.cpp    |   1 -
 source/common/vec/pixel-ssse3.cpp    |  59 ------------------------------------
 source/common/vec/pixel16-sse41.cpp  |   3 -
 source/common/vec/vec-primitives.cpp |   2 -
 9 files changed, 25 insertions(+), 91 deletions(-)

diffs (232 lines):

diff -r e83550d5f10d -r 189ac76266a9 source/common/CMakeLists.txt
--- a/source/common/CMakeLists.txt	Sun Dec 01 19:44:27 2013 -0600
+++ b/source/common/CMakeLists.txt	Mon Dec 02 00:12:58 2013 -0600
@@ -73,13 +73,16 @@ if(ENABLE_PRIMITIVES_VEC)
         include_directories(../VectorClass)
     endif()
     set(SSE3  vec/dct-sse3.cpp  vec/blockcopy-sse3.cpp)
-    set(SSSE3 vec/pixel-ssse3.cpp vec/dct-ssse3.cpp vec/ipfilter-ssse3.cpp vec/intra-ssse3.cpp)
-    set(SSE41 vec/pixel-sse41.cpp vec/dct-sse41.cpp vec/ipfilter-sse41.cpp vec/intra-sse41.cpp vec/pixel16-sse41.cpp)
+    set(SSSE3 vec/dct-ssse3.cpp vec/ipfilter-ssse3.cpp vec/intra-ssse3.cpp)
+    set(SSE41 vec/pixel-sse41.cpp vec/dct-sse41.cpp vec/ipfilter-sse41.cpp
+              vec/intra-sse41.cpp vec/pixel16-sse41.cpp)
 
     if (MSVC)
-        add_definitions(/wd4127) # conditional expression is constant
-        add_definitions(/wd4244) # 'argument' : conversion from 'int' to 'char', possible loss of data
         set(PRIMITIVES ${SSE3} ${SSSE3} ${SSE41})
+        # wd4127 conditional expression is constant
+        # wd4244 'argument' : conversion from 'int' to 'char', possible loss of data
+        # wd4100 unreferenced formal parameter
+        set(WARNDISABLE "/wd4244 /wd4127 /wd4100")
         if (INTEL_CXX)
             add_definitions(/Qwd111) # statement is unreachable
             add_definitions(/Qwd128) # loop is unreachable
@@ -87,23 +90,26 @@ if(ENABLE_PRIMITIVES_VEC)
             add_definitions(/Qwd185) # dynamic initialization in unreachable code
             add_definitions(/Qwd280) # conditional expression is constant
         endif()
-        if (NOT X64)
+        if (X64)
             # x64 implies SSE4, so this flag would have no effect (and it issues a warning)
-            set_source_files_properties(${SSE3} ${SSSE3} ${SSE41} PROPERTIES COMPILE_FLAGS /arch:SSE2)
+            set_source_files_properties(${SSE3} ${SSSE3} ${SSE41} PROPERTIES COMPILE_FLAGS "${WARNDISABLE} /arch:SSE2")
+        else()
+            set_source_files_properties(${SSE3} ${SSSE3} ${SSE41} PROPERTIES COMPILE_FLAGS "${WARNDISABLE}")
         endif()
     endif()
     if(GCC)
         if(CLANG)
-            # llvm intrinsic headers trigger this warning
-            add_definitions(-Wno-shadow)
-            # llvm reports these warnings for the vector class headers
-            add_definitions(-Wno-shift-overflow -Wno-uninitialized)
+            # llvm intrinsic headers trigger these warning
+            # the middle two are for the vector class headers only
+            set(WARNDISABLE "-Wno-shadow -Wno-shift-overflow -Wno-uninitialized -Wno-unused-parameter")
+        else()
+            set(WARNDISABLE "-Wno-unused-parameter")
         endif()
         if(INTEL_CXX OR CLANG OR (NOT GCC_VERSION VERSION_LESS 4.3))
             set(PRIMITIVES ${SSE3} ${SSSE3} ${SSE41})
-            set_source_files_properties(${SSE3}  PROPERTIES COMPILE_FLAGS "-msse3")
-            set_source_files_properties(${SSSE3} PROPERTIES COMPILE_FLAGS "-mssse3")
-            set_source_files_properties(${SSE41} PROPERTIES COMPILE_FLAGS "-msse4.1")
+            set_source_files_properties(${SSE3}  PROPERTIES COMPILE_FLAGS "${WARNDISABLE} -msse3")
+            set_source_files_properties(${SSSE3} PROPERTIES COMPILE_FLAGS "${WARNDISABLE} -mssse3")
+            set_source_files_properties(${SSE41} PROPERTIES COMPILE_FLAGS "${WARNDISABLE} -msse4.1")
         endif()
     endif(GCC)
 
@@ -113,8 +119,9 @@ endif(ENABLE_PRIMITIVES_VEC)
 
 if(ENABLE_PRIMITIVES_ASM)
     set(C_SRCS asm-primitives.cpp pixel.h mc.h ipfilter8.h blockcopy8.h dct8.h)
-    set(A_SRCS pixel-a.asm const-a.asm cpu-a.asm sad-a.asm mc-a.asm mc-a2.asm ipfilter8.asm pixel-util8.asm
-               blockcopy8.asm intrapred8.asm pixeladd8.asm dct8.asm)
+    set(A_SRCS pixel-a.asm const-a.asm cpu-a.asm sad-a.asm mc-a.asm mc-a2.asm
+               ipfilter8.asm pixel-util8.asm blockcopy8.asm intrapred8.asm
+               pixeladd8.asm dct8.asm)
     if (NOT X64)
         set(A_SRCS ${A_SRCS} pixel-32.asm)
     endif()
diff -r e83550d5f10d -r 189ac76266a9 source/common/vec/dct-sse3.cpp
--- a/source/common/vec/dct-sse3.cpp	Sun Dec 01 19:44:27 2013 -0600
+++ b/source/common/vec/dct-sse3.cpp	Mon Dec 02 00:12:58 2013 -0600
@@ -1568,8 +1568,6 @@ void Setup_Vec_DCTPrimitives_sse3(Encode
     p.idct[IDCT_8x8] = idct8;
     p.idct[IDCT_16x16] = idct16;
     p.idct[IDCT_32x32] = idct32;
-#else
-    (void)p; //Ugly Hack to avoid unreferenced formal parameter errors
 #endif
 }
 }
diff -r e83550d5f10d -r 189ac76266a9 source/common/vec/dct-ssse3.cpp
--- a/source/common/vec/dct-ssse3.cpp	Sun Dec 01 19:44:27 2013 -0600
+++ b/source/common/vec/dct-ssse3.cpp	Mon Dec 02 00:12:58 2013 -0600
@@ -1279,9 +1279,7 @@ void dct32(int16_t *src, int32_t *dst, i
 namespace x265 {
 void Setup_Vec_DCTPrimitives_ssse3(EncoderPrimitives &p)
 {
-#if HIGH_BIT_DEPTH
-    p.dct[DST_4x4] = p.dct[DST_4x4]; // avoid unreferenced parameter warnings
-#else
+#if !HIGH_BIT_DEPTH
     p.dct[DCT_8x8] = dct8;
     p.dct[DCT_16x16] = dct16;
     p.dct[DCT_32x32] = dct32;
diff -r e83550d5f10d -r 189ac76266a9 source/common/vec/intra-sse41.cpp
--- a/source/common/vec/intra-sse41.cpp	Sun Dec 01 19:44:27 2013 -0600
+++ b/source/common/vec/intra-sse41.cpp	Mon Dec 02 00:12:58 2013 -0600
@@ -8118,9 +8118,7 @@ void predIntraAngs32(pixel *dst0, pixel 
 namespace x265 {
 void Setup_Vec_IPredPrimitives_sse41(EncoderPrimitives& p)
 {
-#if HIGH_BIT_DEPTH
-    p.intra_pred_planar[0] = p.intra_pred_planar[0];
-#else
+#if !HIGH_BIT_DEPTH
 #if defined(__GNUC__) || defined(__INTEL_COMPILER) || (defined(_MSC_VER) && (_MSC_VER == 1500))
     p.intra_pred_allangs[0] = predIntraAngs4;
     p.intra_pred_allangs[1] = predIntraAngs8;
diff -r e83550d5f10d -r 189ac76266a9 source/common/vec/ipfilter-ssse3.cpp
--- a/source/common/vec/ipfilter-ssse3.cpp	Sun Dec 01 19:44:27 2013 -0600
+++ b/source/common/vec/ipfilter-ssse3.cpp	Mon Dec 02 00:12:58 2013 -0600
@@ -135,9 +135,7 @@ void filterHorizontal_ps(pixel *src, int
 namespace x265 {
 void Setup_Vec_IPFilterPrimitives_ssse3(EncoderPrimitives& p)
 {
-#if HIGH_BIT_DEPTH
-    p.sad[0] = p.sad[0];
-#else
+#if !HIGH_BIT_DEPTH
     p.ipfilter_ps[FILTER_H_P_S_4] = filterHorizontal_ps<4>;
     p.ipfilter_ps[FILTER_H_P_S_8] = filterHorizontal_ps<8>;
 #endif
diff -r e83550d5f10d -r 189ac76266a9 source/common/vec/pixel-sse41.cpp
--- a/source/common/vec/pixel-sse41.cpp	Sun Dec 01 19:44:27 2013 -0600
+++ b/source/common/vec/pixel-sse41.cpp	Mon Dec 02 00:12:58 2013 -0600
@@ -317,7 +317,6 @@ void Setup_Vec_PixelPrimitives_sse41(Enc
 
 #if HIGH_BIT_DEPTH
     Setup_Vec_Pixel16Primitives_sse41(p);
-#else
 #endif /* !HIGH_BIT_DEPTH */
 }
 }
diff -r e83550d5f10d -r 189ac76266a9 source/common/vec/pixel-ssse3.cpp
--- a/source/common/vec/pixel-ssse3.cpp	Sun Dec 01 19:44:27 2013 -0600
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,59 +0,0 @@
-/*****************************************************************************
- * Copyright (C) 2013 x265 project
- *
- * Authors: Steve Borho <steve at borho.org>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111, USA.
- *
- * This program is also available under a commercial proprietary license.
- * For more information, contact us at licensing at multicorewareinc.com
- *****************************************************************************/
-
-#include "primitives.h"
-#include <xmmintrin.h> // SSE
-#include <pmmintrin.h> // SSE3
-#include <tmmintrin.h> // SSSE3
-
-using namespace x265;
-
-namespace {
-void convert16to32_shl(int32_t *dst, int16_t *org, intptr_t stride, int shift, int size)
-{
-    int i, j;
-
-    for (i = 0; i < size; i++)
-    {
-        for (j = 0; j < size; j += 4)
-        {
-            __m128i im16;
-            __m128i im32;
-
-            im16 = _mm_loadl_epi64((__m128i*)&org[i * stride + j]);
-            im32 = _mm_srai_epi32(_mm_unpacklo_epi16(im16, im16), 16);
-            im32 = _mm_slli_epi32(im32, shift);
-            _mm_storeu_si128((__m128i*)dst, im32);
-
-            dst += 4;
-        }
-    }
-}
-}
-
-namespace x265 {
-void Setup_Vec_PixelPrimitives_ssse3(EncoderPrimitives &p)
-{
-    p.cvt16to32_shl = convert16to32_shl;
-}
-}
diff -r e83550d5f10d -r 189ac76266a9 source/common/vec/pixel16-sse41.cpp
--- a/source/common/vec/pixel16-sse41.cpp	Sun Dec 01 19:44:27 2013 -0600
+++ b/source/common/vec/pixel16-sse41.cpp	Mon Dec 02 00:12:58 2013 -0600
@@ -1855,9 +1855,6 @@ void Setup_Vec_Pixel16Primitives_sse41(E
 
     SETUP_PARTITION(4, 4);
     /* 4x4 is too small for any sub partitions */
-
-#else // if HIGH_BIT_DEPTH
-    p.sad[0] = p.sad[0];
 #endif // if HIGH_BIT_DEPTH
 }
 }
diff -r e83550d5f10d -r 189ac76266a9 source/common/vec/vec-primitives.cpp
--- a/source/common/vec/vec-primitives.cpp	Sun Dec 01 19:44:27 2013 -0600
+++ b/source/common/vec/vec-primitives.cpp	Mon Dec 02 00:12:58 2013 -0600
@@ -63,7 +63,6 @@ void Setup_Vec_IPredPrimitives_sse41(Enc
 void Setup_Vec_IPFilterPrimitives_ssse3(EncoderPrimitives&);
 void Setup_Vec_IPFilterPrimitives_sse41(EncoderPrimitives&);
 
-void Setup_Vec_PixelPrimitives_ssse3(EncoderPrimitives&);
 void Setup_Vec_PixelPrimitives_sse41(EncoderPrimitives&);
 
 /* Use primitives for the best available vector architecture */
@@ -82,7 +81,6 @@ void Setup_Vector_Primitives(EncoderPrim
     if (cpuMask & X265_CPU_SSSE3)
     {
         Setup_Vec_IPredPrimitives_ssse3(p);
-        Setup_Vec_PixelPrimitives_ssse3(p);
         Setup_Vec_IPFilterPrimitives_ssse3(p);
         Setup_Vec_DCTPrimitives_ssse3(p);
     }


More information about the x265-commits mailing list