From 529af67146a7695036a9fa8395616af4f28bbc7c Mon Sep 17 00:00:00 2001 From: Emma Finn Date: Fri, 15 Jul 2022 10:16:19 +0000 Subject: odp-execute: Add ISA implementation of actions. This commit adds the AVX512 implementation of the action functionality. Usage: $ ovs-appctl odp-execute/action-impl-set avx512 Signed-off-by: Emma Finn Signed-off-by: Harry van Haaren Co-authored-by: Harry van Haaren Acked-by: Sunil Pai G Acked-by: Eelco Chaudron Signed-off-by: Ian Stokes --- m4/openvswitch.m4 | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'm4') diff --git a/m4/openvswitch.m4 b/m4/openvswitch.m4 index 4c3bace6e..fe51455b4 100644 --- a/m4/openvswitch.m4 +++ b/m4/openvswitch.m4 @@ -421,6 +421,35 @@ AC_DEFUN([OVS_CHECK_SPHINX], AC_ARG_VAR([SPHINXBUILD]) AM_CONDITIONAL([HAVE_SPHINX], [test "$SPHINXBUILD" != none])]) + +dnl Checks for compiler correctly emitting AVX512-VL vpermd instruction. +dnl GCC5 says it exports AVX512-VL, but it doesn't implement "vpermd" instruction +dnl resulting in compilation failures. To workaround this "reported vs actual" +dnl mismatch, we compile a small snippet, and conditionally enable AVX512-VL. +AC_DEFUN([OVS_CHECK_GCC_AVX512VL], [ + AC_MSG_CHECKING([whether compiler correctly emits AVX512-VL]) + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([#include + static void __attribute__((__target__("avx512vl"))) + check_permutexvar(void) + { + __m256i v_swap32a = _mm256_setr_epi32(0x0, 0x4, 0xF, + 0xF, 0xF, 0xF, + 0xF, 0xF); + v_swap32a = _mm256_permutexvar_epi32(v_swap32a, + v_swap32a); + }],[])], + [AC_MSG_RESULT([yes]) + ovs_cv_gcc_avx512vl_good=yes], + [AC_MSG_RESULT([no]) + ovs_cv_gcc_avx512vl_good=no]) + if test "$ovs_cv_gcc_avx512vl_good" = yes; then + AC_DEFINE([HAVE_GCC_AVX512VL_GOOD], [1], + [Define to 1 if gcc implements the vpermd instruction.]) + fi + AM_CONDITIONAL([HAVE_GCC_AVX512VL_GOOD], + [test "$ovs_cv_gcc_avx512vl_good" = yes])]) + dnl Checks for binutils/assembler known issue with AVX512. dnl Due to backports, we probe assembling a reproducer instead of checking dnl binutils version string. More details, including ASM dumps and debug here: -- cgit v1.2.1