summaryrefslogtreecommitdiffstats
path: root/src/plugins/crypto_ia32/CMakeLists.txt
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2019-05-22 15:11:18 +0200
committerNeale Ranns <nranns@cisco.com>2019-05-23 08:56:46 +0000
commitd5023a72ddabe7e9a8698ad57c82d6be117fff73 (patch)
tree751aa38f2b9559099859449c0bc0ca88f8b55a11 /src/plugins/crypto_ia32/CMakeLists.txt
parent0ad4a439d68f906295656876cc3bb3092da2cf56 (diff)
crypto_ia32: multiarch
Change-Id: Iead43a2b524b735a2069e611d899cd41d3a8efdc Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/plugins/crypto_ia32/CMakeLists.txt')
-rw-r--r--src/plugins/crypto_ia32/CMakeLists.txt22
1 files changed, 16 insertions, 6 deletions
diff --git a/src/plugins/crypto_ia32/CMakeLists.txt b/src/plugins/crypto_ia32/CMakeLists.txt
index a100cdbb681..b01c57b9f6f 100644
--- a/src/plugins/crypto_ia32/CMakeLists.txt
+++ b/src/plugins/crypto_ia32/CMakeLists.txt
@@ -15,10 +15,20 @@ if(NOT CMAKE_SYSTEM_PROCESSOR MATCHES "amd64.*|x86_64.*|AMD64.*")
return()
endif()
-add_vpp_plugin(crypto_ia32
- SOURCES
- aes_cbc.c
- main.c
-)
+add_vpp_plugin(crypto_ia32 SOURCES main.c)
-target_compile_options(crypto_ia32_plugin PRIVATE "-march=silvermont")
+list(APPEND VARIANTS "sse42\;-march=silvermont")
+list(APPEND VARIANTS "avx2\;-march=core-avx2")
+if(compiler_flag_march_skylake_avx512)
+ list(APPEND VARIANTS "avx512\;-march=skylake-avx512")
+endif()
+
+foreach(VARIANT ${VARIANTS})
+ list(GET VARIANT 0 v)
+ list(GET VARIANT 1 f)
+ set(l crypto_ia32_${v})
+ add_library(${l} OBJECT aes_cbc.c)
+ set_target_properties(${l} PROPERTIES POSITION_INDEPENDENT_CODE ON)
+ target_compile_options(${l} PUBLIC ${f} -O3 -Wall -fno-common)
+ target_sources(crypto_ia32_plugin PRIVATE $<TARGET_OBJECTS:${l}>)
+endforeach()