]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
common: rename YASM MACRO to hint support SIMD
authorChangcheng Liu <changcheng.liu@aliyun.com>
Thu, 22 Oct 2020 02:42:29 +0000 (10:42 +0800)
committerChangcheng Liu <changcheng.liu@aliyun.com>
Thu, 29 Oct 2020 00:57:54 +0000 (08:57 +0800)
Signed-off-by: Changcheng Liu <changcheng.liu@aliyun.com>
13 files changed:
src/CMakeLists.txt
src/common/CMakeLists.txt
src/common/crc32c_intel_fast.c
src/common/options.cc
src/compressor/zlib/CMakeLists.txt
src/compressor/zlib/ZlibCompressor.cc
src/crypto/CMakeLists.txt
src/crypto/isa-l/CMakeLists.txt
src/erasure-code/CMakeLists.txt
src/erasure-code/isa/CMakeLists.txt
src/include/config-h.in.cmake
src/test/erasure-code/CMakeLists.txt
src/test/erasure-code/TestErasureCodePluginClay.cc

index 5526e469c4a3ec3ccc6a2e297e3bdd11d598a5d8..3a66b350542c0fc064778dcc2f95a90bdffd3e0d 100644 (file)
@@ -151,8 +151,8 @@ if(HAVE_INTEL)
     # might not work in this case (especially when targeting Windows).
     include(CheckYasm)
     check_yasm_support(${object_format}
-      HAVE_GOOD_YASM_ELF64
-      HAVE_BETTER_YASM_ELF64)
+      HAVE_YASM_X64
+      HAVE_YASM_X64_AVX2)
   endif()
 endif()
 
index 39bc50d41fd9efad4495774c543eb99a0a169693..4cb5b333f459443444ff19a064a8842ace34c414 100644 (file)
@@ -170,11 +170,11 @@ set(crc32_srcs
 if(HAVE_INTEL)
   list(APPEND crc32_srcs
     crc32c_intel_fast.c)
-  if(HAVE_GOOD_YASM_ELF64)
+  if(HAVE_YASM_X64)
     list(APPEND crc32_srcs
       crc32c_intel_fast_asm.s
       crc32c_intel_fast_zero_asm.s)
-  endif(HAVE_GOOD_YASM_ELF64)
+  endif(HAVE_YASM_X64)
 elseif(HAVE_POWER8)
   list(APPEND crc32_srcs
     crc32c_ppc.c)
index 188ff95ff5af01f5d32309263c6499763a739817..654eb81e2e696cd25bcf7be99e6dadc19022b2f0 100644 (file)
@@ -4,7 +4,7 @@
 extern unsigned int crc32_iscsi_00(unsigned char const *buffer, uint64_t len, uint64_t crc) asm("crc32_iscsi_00");
 extern unsigned int crc32_iscsi_zero_00(unsigned char const *buffer, uint64_t len, uint64_t crc) asm("crc32_iscsi_zero_00");
 
-#ifdef HAVE_GOOD_YASM_ELF64
+#ifdef HAVE_YASM_X64
 
 uint32_t ceph_crc32c_intel_fast(uint32_t crc, unsigned char const *buffer, unsigned len)
 {
index 0f5b646f9c4552c1c49f060e65a1dd5e411e8fb3..dde32185d8dd1afc99f5f259e8a80f44004d2c51 100644 (file)
@@ -2708,7 +2708,7 @@ std::vector<Option> get_global_options() {
 
     Option("osd_erasure_code_plugins", Option::TYPE_STR, Option::LEVEL_ADVANCED)
     .set_default("jerasure lrc"
-  #if defined(HAVE_BETTER_YASM_ELF64) || defined(HAVE_ARMV8_SIMD)
+  #if defined(HAVE_YASM_X64_AVX2) || defined(HAVE_ARMV8_SIMD)
          " isa"
   #endif
         )
index c1c8413949c8fadb6cef8c76bed48a590a6e471e..22543c620c30f498dcb1b31350078b8d50a76195 100644 (file)
@@ -1,6 +1,6 @@
 # zlib
 
-if(HAVE_INTEL_SSE4_1 AND HAVE_BETTER_YASM_ELF64 AND (NOT APPLE))
+if(HAVE_INTEL_SSE4_1 AND HAVE_YASM_X64_AVX2 AND (NOT APPLE))
        set(zlib_sources
          CompressionPluginZlib.cc
          ZlibCompressor.cc
@@ -41,12 +41,12 @@ if(HAVE_INTEL_SSE4_1 AND HAVE_BETTER_YASM_ELF64 AND (NOT APPLE))
          ${CMAKE_SOURCE_DIR}/src/isa-l/igzip/igzip_set_long_icf_fg_04.asm
          ${CMAKE_SOURCE_DIR}/src/isa-l/igzip/igzip_set_long_icf_fg_06.asm
        )
-else(HAVE_INTEL_SSE4_1 AND HAVE_BETTER_YASM_ELF64 AND (NOT APPLE))
+else(HAVE_INTEL_SSE4_1 AND HAVE_YASM_X64_AVX2 AND (NOT APPLE))
        set(zlib_sources
          CompressionPluginZlib.cc
          ZlibCompressor.cc
        )
-endif(HAVE_INTEL_SSE4_1 AND HAVE_BETTER_YASM_ELF64 AND (NOT APPLE))
+endif(HAVE_INTEL_SSE4_1 AND HAVE_YASM_X64_AVX2 AND (NOT APPLE))
 
 add_library(ceph_zlib SHARED ${zlib_sources})
 target_link_libraries(ceph_zlib ZLIB::ZLIB compressor $<$<PLATFORM_ID:Windows>:ceph-common>)
index 5edaba67242107c500c6edc21b3732ac1f8d1b8d..e8fe7dfadb3503f4646992de383a16f2bde6cc1d 100644 (file)
@@ -113,7 +113,7 @@ int ZlibCompressor::zlib_compress(const bufferlist &in, bufferlist &out, boost::
   return 0;
 }
 
-#if __x86_64__ && defined(HAVE_BETTER_YASM_ELF64)
+#if __x86_64__ && defined(HAVE_YASM_X64_AVX2)
 int ZlibCompressor::isal_compress(const bufferlist &in, bufferlist &out, boost::optional<int32_t> &compressor_message)
 {
   int ret;
@@ -174,7 +174,7 @@ int ZlibCompressor::compress(const bufferlist &in, bufferlist &out, boost::optio
   if (qat_enabled)
     return qat_accel.compress(in, out, compressor_message);
 #endif
-#if __x86_64__ && defined(HAVE_BETTER_YASM_ELF64)
+#if __x86_64__ && defined(HAVE_YASM_X64_AVX2)
   if (isal_enabled)
     return isal_compress(in, out, compressor_message);
   else
index eee534435d6ee5d61c978027120bb7a6360fa11d..c9d76ac3bba0537d43af45f4717cd84d1354a8c1 100644 (file)
@@ -3,7 +3,7 @@ set(crypto_plugin_dir ${CEPH_INSTALL_PKGLIBDIR}/crypto)
 
 add_subdirectory(openssl)
 
-if(HAVE_INTEL AND HAVE_BETTER_YASM_ELF64 AND (NOT APPLE))
+if(HAVE_INTEL AND HAVE_YASM_X64_AVX2 AND (NOT APPLE))
   add_subdirectory(isa-l)
 endif()
 
index b6eece7039c0b3190b712d24d2ecac8f0bd075e0..78cd48dd58553169758337a026056344aa67395b 100644 (file)
@@ -22,9 +22,9 @@ set(isal_crypto_plugin_srcs
   ${isal_dir}/aes/cbc_enc_256_x4_sb.asm
   ${isal_dir}/aes/cbc_enc_256_x8_sb.asm)
 
-if(HAVE_GOOD_YASM_ELF64)
+if(HAVE_YASM_X64)
 add_dependencies(crypto_plugins ceph_crypto_isal)
-endif(HAVE_GOOD_YASM_ELF64)
+endif(HAVE_YASM_X64)
 
 add_library(ceph_crypto_isal SHARED ${isal_crypto_plugin_srcs})
 target_include_directories(ceph_crypto_isal PRIVATE ${isal_dir}/include)
index 59e7781594893a776aafb1c498c8769a9aea8697..26f545daae1e1d86c3aa86199a953a272b2ecec6 100644 (file)
@@ -22,7 +22,7 @@ add_subdirectory(lrc)
 add_subdirectory(shec)
 add_subdirectory(clay)
 
-if(HAVE_BETTER_YASM_ELF64 OR HAVE_ARMV8_SIMD)
+if(HAVE_YASM_X64_AVX2 OR HAVE_ARMV8_SIMD)
   add_subdirectory(isa)
   set(EC_ISA_LIB ec_isa)
 endif()
index 5043ac225dc3259c3924239743478320422192cc..3fb91df73e9dbfc8c05c485d107f6236de465ce7 100644 (file)
@@ -2,7 +2,7 @@
 set(isal_src_dir ${CMAKE_SOURCE_DIR}/src/isa-l)
 include_directories(${isal_src_dir}/include)
 
-if(HAVE_BETTER_YASM_ELF64)
+if(HAVE_YASM_X64_AVX2)
   set(isa_srcs
     ${isal_src_dir}/erasure_code/ec_base.c
     ${isal_src_dir}/erasure_code/gf_2vect_dot_prod_sse.asm
index cdf9cc909ad5a926225b7702ffc85cad5b7ae304..f9629dc2e9b3bbd82196f9e63b7f4964b3ecc4c5 100644 (file)
 #cmakedefine HAVE_NAME_TO_HANDLE_AT
 
 /* we have a recent yasm and are x86_64 */
-#cmakedefine HAVE_GOOD_YASM_ELF64 
+#cmakedefine HAVE_YASM_X64
 
-/* yasm can also build the isa-l */
-#cmakedefine HAVE_BETTER_YASM_ELF64
+/* yasm can also build the isa-l:avx2 */
+#cmakedefine HAVE_YASM_X64_AVX2
 
 /* Define if isa-l is compiled for arm64 */
 #cmakedefine HAVE_ARMV8_SIMD
index 640de24bd5fc3c6ad7465e5ccc83191e29a78132..e6fc327ff08fe57f4060dccf5a2b802262aee313 100644 (file)
@@ -74,7 +74,7 @@ target_link_libraries(unittest_erasure_code_plugin_jerasure
 add_dependencies(unittest_erasure_code_plugin_jerasure
   ec_jerasure)
 
-if(HAVE_BETTER_YASM_ELF64 OR HAVE_ARMV8_SIMD)
+if(HAVE_YASM_X64_AVX2 OR HAVE_ARMV8_SIMD)
 
 #unittest_erasure_code_isa
 add_executable(unittest_erasure_code_isa
@@ -105,7 +105,7 @@ target_link_libraries(unittest_erasure_code_plugin_isa
   )
 add_dependencies(unittest_erasure_code_plugin_isa
   ec_isa)
-endif(HAVE_BETTER_YASM_ELF64 OR HAVE_ARMV8_SIMD)
+endif(HAVE_YASM_X64_AVX2 OR HAVE_ARMV8_SIMD)
 
 # unittest_erasure_code_lrc
 add_executable(unittest_erasure_code_lrc
index 0491ba8981413a1ae03f076a71be043efd19927f..7d44ad7a36a7c5258fa669be479fc84971caba33 100644 (file)
@@ -58,7 +58,7 @@ TEST(ErasureCodePlugin, factory)
       EXPECT_TRUE(erasure_code.get());
     }
   }
-#ifdef HAVE_BETTER_YASM_ELF64
+#ifdef HAVE_YASM_X64_AVX2
   //check clay plugin with scalar_mds=isa
   {
     const char *techniques[] = {