lpm: fix build with gcc -O0 option
authorSangjin Han <sangjin@eecs.berkeley.edu>
Fri, 2 Jun 2017 05:07:46 +0000 (05:07 +0000)
committerThomas Monjalon <thomas@monjalon.net>
Mon, 5 Jun 2017 13:10:31 +0000 (15:10 +0200)
commitbbdb7136652ab80a77e9e3231b06dc63c5cd686b
tree22fb3cace7b837cd63aeefc236f7ed4239d1587f
parent62a0e941b5000fec02dc3bd3efed092b809ce570
lpm: fix build with gcc -O0 option

When rte_lpm.h is used on x86, -O0 option (no optimization at all)
given to gcc causes a compile error like this:

error: the last argument must be an 8-bit immediate
   i24 = _mm_srli_si128(i24, sizeof(uint64_t));

-O0 option is useful for debugging and code coverage measurement, but
this error prevents DPDK programs from building. This patch replaces
"sizeof(uint64_t)" with a constant literal "8" to work around the issue.
The issue occurs on gcc/g++ versions from 4.8 to 5.

Signed-off-by: Sangjin Han <sangjin@eecs.berkeley.edu>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
lib/librte_lpm/rte_lpm_sse.h