[x265-commits] [x265] common: move no-asm indication into build info string

Steve Borho steve at borho.org
Tue Jun 30 20:15:26 CEST 2015


details:   http://hg.videolan.org/x265/rev/856f5f548550
branches:  
changeset: 10738:856f5f548550
user:      Steve Borho <steve at borho.org>
date:      Tue Jun 30 13:05:10 2015 -0500
description:
common: move no-asm indication into build info string

This is most helpful in static multilib situations:

% ./x265 -V
x265 [info]: HEVC encoder version 1.7+262-61df434bea40
x265 [info]: build info [Mac OS X][clang 6.1.0][64 bit] 8bit
x265 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX AVX2 FMA3 LZCNT BMI2
% ./x265 -V -D10
x265 [info]: HEVC encoder version 1.7+262-61df434bea40
x265 [info]: build info [Mac OS X][clang 6.1.0][64 bit][noasm] 10bit
x265 [info]: using cpu capabilities: none!
Subject: [x265] cmake: remove dead LIBOCOMMON variables

details:   http://hg.videolan.org/x265/rev/e5ebbaa7471f
branches:  
changeset: 10739:e5ebbaa7471f
user:      Steve Borho <steve at borho.org>
date:      Tue Jun 30 13:05:29 2015 -0500
description:
cmake: remove dead LIBOCOMMON variables
Subject: [x265] version: cleanup macro names (remove HM oddness)

details:   http://hg.videolan.org/x265/rev/2f345c1c0d8e
branches:  
changeset: 10740:2f345c1c0d8e
user:      Steve Borho <steve at borho.org>
date:      Tue Jun 30 13:08:15 2015 -0500
description:
version: cleanup macro names (remove HM oddness)

these macros are no longer used in a common header, so it is safe to use simpler
macro names

diffstat:

 source/common/CMakeLists.txt |   9 ++++---
 source/common/primitives.cpp |   2 -
 source/common/version.cpp    |  48 ++++++++++++++++++++++++-------------------
 3 files changed, 32 insertions(+), 27 deletions(-)

diffs (139 lines):

diff -r 61df434bea40 -r 2f345c1c0d8e source/common/CMakeLists.txt
--- a/source/common/CMakeLists.txt	Tue Jun 30 11:36:55 2015 -0500
+++ b/source/common/CMakeLists.txt	Tue Jun 30 13:08:15 2015 -0500
@@ -2,6 +2,8 @@
 
 if(ENABLE_ASSEMBLY)
     set_source_files_properties(threading.cpp primitives.cpp PROPERTIES COMPILE_FLAGS -DENABLE_ASSEMBLY=1)
+    set_source_files_properties(version.cpp PROPERTIES COMPILE_FLAGS
+                                "-DX265_VERSION=${X265_VERSION} -DENABLE_ASSEMBLY=1")
 
     set(SSE3  vec/dct-sse3.cpp)
     set(SSSE3 vec/dct-ssse3.cpp)
@@ -67,6 +69,8 @@ if(ENABLE_ASSEMBLY)
         set(ASM_PRIMITIVES ${ASM_PRIMITIVES} x86/${SRC})
     endforeach()
     source_group(Assembly FILES ${ASM_PRIMITIVES})
+else(ENABLE_ASSEMBLY)
+    set_source_files_properties(version.cpp PROPERTIES COMPILE_FLAGS -DX265_VERSION=${X265_VERSION})
 endif(ENABLE_ASSEMBLY)
 
 check_symbol_exists(strtok_r "string.h" HAVE_STRTOK_R)
@@ -81,11 +85,8 @@ if(WIN32)
     set(WINXP winxp.h winxp.cpp)
 endif(WIN32)
 
-set_source_files_properties(version.cpp PROPERTIES COMPILE_FLAGS -DX265_VERSION=${X265_VERSION})
-
 add_library(common OBJECT
-    ${ASM_PRIMITIVES} ${VEC_PRIMITIVES}
-    ${LIBCOMMON_SRC} ${LIBCOMMON_HDR} ${WINXP}
+    ${ASM_PRIMITIVES} ${VEC_PRIMITIVES} ${WINXP}
     primitives.cpp primitives.h
     pixel.cpp dct.cpp ipfilter.cpp intrapred.cpp loopfilter.cpp
     constants.cpp constants.h
diff -r 61df434bea40 -r 2f345c1c0d8e source/common/primitives.cpp
--- a/source/common/primitives.cpp	Tue Jun 30 11:36:55 2015 -0500
+++ b/source/common/primitives.cpp	Tue Jun 30 13:08:15 2015 -0500
@@ -240,8 +240,6 @@ void x265_setup_primitives(x265_param *p
 #if ENABLE_ASSEMBLY
         setupInstrinsicPrimitives(primitives, param->cpuid);
         setupAssemblyPrimitives(primitives, param->cpuid);
-#else
-        x265_log(param, X265_LOG_WARNING, "Assembly not supported in this binary\n");
 #endif
 
         setupAliasPrimitives(primitives);
diff -r 61df434bea40 -r 2f345c1c0d8e source/common/version.cpp
--- a/source/common/version.cpp	Tue Jun 30 11:36:55 2015 -0500
+++ b/source/common/version.cpp	Tue Jun 30 13:08:15 2015 -0500
@@ -29,57 +29,63 @@
 #define STR(x) #x
 
 #if defined(__clang__)
-#define NVM_COMPILEDBY  "[clang " XSTR(__clang_major__) "." XSTR(__clang_minor__) "." XSTR(__clang_patchlevel__) "]"
+#define COMPILEDBY  "[clang " XSTR(__clang_major__) "." XSTR(__clang_minor__) "." XSTR(__clang_patchlevel__) "]"
 #ifdef __IA64__
-#define NVM_ONARCH    "[on 64-bit] "
+#define ONARCH    "[on 64-bit] "
 #else
-#define NVM_ONARCH    "[on 32-bit] "
+#define ONARCH    "[on 32-bit] "
 #endif
 #endif
 
 #if defined(__GNUC__) && !defined(__INTEL_COMPILER) && !defined(__clang__)
-#define NVM_COMPILEDBY  "[GCC " XSTR(__GNUC__) "." XSTR(__GNUC_MINOR__) "." XSTR(__GNUC_PATCHLEVEL__) "]"
+#define COMPILEDBY  "[GCC " XSTR(__GNUC__) "." XSTR(__GNUC_MINOR__) "." XSTR(__GNUC_PATCHLEVEL__) "]"
 #ifdef __IA64__
-#define NVM_ONARCH    "[on 64-bit] "
+#define ONARCH    "[on 64-bit] "
 #else
-#define NVM_ONARCH    "[on 32-bit] "
+#define ONARCH    "[on 32-bit] "
 #endif
 #endif
 
 #ifdef __INTEL_COMPILER
-#define NVM_COMPILEDBY  "[ICC " XSTR(__INTEL_COMPILER) "]"
+#define COMPILEDBY "[ICC " XSTR(__INTEL_COMPILER) "]"
 #elif  _MSC_VER
-#define NVM_COMPILEDBY  "[MSVC " XSTR(_MSC_VER) "]"
+#define COMPILEDBY "[MSVC " XSTR(_MSC_VER) "]"
 #endif
 
-#ifndef NVM_COMPILEDBY
-#define NVM_COMPILEDBY "[Unk-CXX]"
+#ifndef COMPILEDBY
+#define COMPILEDBY "[Unk-CXX]"
 #endif
 
 #ifdef _WIN32
-#define NVM_ONOS        "[Windows]"
+#define ONOS    "[Windows]"
 #elif  __linux
-#define NVM_ONOS        "[Linux]"
+#define ONOS    "[Linux]"
 #elif __OpenBSD__
-#define NVM_ONOS        "[OpenBSD]"
+#define ONOS    "[OpenBSD]"
 #elif  __CYGWIN__
-#define NVM_ONOS        "[Cygwin]"
+#define ONOS    "[Cygwin]"
 #elif __APPLE__
-#define NVM_ONOS        "[Mac OS X]"
+#define ONOS    "[Mac OS X]"
 #else
-#define NVM_ONOS "[Unk-OS]"
+#define ONOS    "[Unk-OS]"
 #endif
 
 #if X86_64
-#define NVM_BITS        "[64 bit]"
+#define BITS    "[64 bit]"
 #else
-#define NVM_BITS        "[32 bit]"
+#define BITS    "[32 bit]"
 #endif
 
+#if defined(ENABLE_ASSEMBLY)
+#define ASM     ""
+#else
+#define ASM     "[noasm]"
+#endif
+ 
 #if CHECKED_BUILD
-#define CHECKED         "[CHECKED] "
+#define CHECKED "[CHECKED] "
 #else
-#define CHECKED         " "
+#define CHECKED " "
 #endif
 
 #if HIGH_BIT_DEPTH
@@ -91,4 +97,4 @@ const int PFX(max_bit_depth) = 8;
 #endif
 
 const char* PFX(version_str) = XSTR(X265_VERSION);
-const char* PFX(build_info_str) = NVM_ONOS NVM_COMPILEDBY NVM_BITS CHECKED BITDEPTH;
+const char* PFX(build_info_str) = ONOS COMPILEDBY BITS ASM CHECKED BITDEPTH;


More information about the x265-commits mailing list