acl: fix build with GCC 6.3
authorKonstantin Ananyev <konstantin.ananyev@intel.com>
Fri, 21 May 2021 14:42:07 +0000 (15:42 +0100)
committerThomas Monjalon <thomas@monjalon.net>
Thu, 17 Jun 2021 07:37:11 +0000 (09:37 +0200)
commitb3b36f0fbf1fd68980afce10300f1b8831607324
treede5df99db094dbe42a008528b371c73a8f4eaa62
parent08c16b212d036faedc74ae6ad3d159594a8836b9
acl: fix build with GCC 6.3

--buildtype=debug with gcc 6.3 produces the following error:

../lib/librte_acl/acl_run_avx512_common.h: In function
‘resolve_match_idx_avx512x16’:
../lib/librte_acl/acl_run_avx512x16.h:33:18: error:
the last argument must be an 8-bit immediate
                               ^
../lib/librte_acl/acl_run_avx512_common.h:373:9: note:
in expansion of macro ‘_M_I_’
      return _M_I_(slli_epi32)(mi, match_log);
             ^~~~~

Seems like gcc-6.3 complains about the following construct:

static const uint32_t match_log = 5;
    ...
_mm512_slli_epi32(mi, match_log);

It can't substitute constant variable 'match_log' with its actual value.
The fix replaces constant variable with its immediate value.

Bugzilla ID: 717
Fixes: b64c2295f7fc ("acl: add 256-bit AVX512 classify method")
Fixes: 45da22e42ec3 ("acl: add 512-bit AVX512 classify method")
Cc: stable@dpdk.org
Reported-by: Liang Ma <liangma@liangbit.com>
Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
lib/acl/acl_run_avx512.c
lib/acl/acl_run_avx512_common.h
lib/acl/acl_run_avx512x16.h