src/dpdk/lib/librte_acl/acl_run_avx512.c
static inline void
resolve_mcle8_avx512x1(uint32_t result[],
	const struct rte_acl_match_results pr[], const uint32_t match[],
	uint32_t nb_pkt, uint32_t nb_cat, uint32_t nb_trie)
{
	const int32_t *pri;
	const uint32_t *pm, *res;
	uint32_t i, j, k, mi, mn;
	__mmask8 msk;
	xmm_t cp, cr, np, nr;

	res = pr->results;
	pri = pr->priority;

	for (k = 0; k != nb_pkt; k++, result += nb_cat) {

		mi = match[k] << match_log;

		for (j = 0; j != nb_cat; j += RTE_ACL_RESULTS_MULTIPLIER) {

			cr = _mm_loadu_si128((const xmm_t *)(res + mi + j));
			cp = _mm_loadu_si128((const xmm_t *)(pri + mi + j));

			for (i = 1, pm = match + nb_pkt; i != nb_trie;
				i++, pm += nb_pkt) {

				mn = j + (pm[k] << match_log);

				nr = _mm_loadu_si128((const xmm_t *)(res + mn));
				np = _mm_loadu_si128((const xmm_t *)(pri + mn));

				msk = _mm_cmpgt_epi32_mask(cp, np);
				cr = _mm_mask_mov_epi32(nr, msk, cr);
				cp = _mm_mask_mov_epi32(np, msk, cp);
			}

			_mm_storeu_si128((xmm_t *)(result + j), cr);
		}
	}
}
/*
 * Resolve matches for multiple categories (LE 8, use 128b instuctions/regs)
 */
Resolve matches for multiple categories (LE 8, use 128b instuctions/regs)
Resolve matches for multiple categories ( LE 8 use 128b instuctions / regs )
static inline void
resolve_mcle8_avx512x1(uint32_t result[],
	const struct rte_acl_match_results pr[], const uint32_t match[],
	uint32_t nb_pkt, uint32_t nb_cat, uint32_t nb_trie)
{
	const int32_t *pri;
	const uint32_t *pm, *res;
	uint32_t i, j, k, mi, mn;
	__mmask8 msk;
	xmm_t cp, cr, np, nr;
	res = pr->results;
	pri = pr->priority;
	for (k = 0; k != nb_pkt; k++, result += nb_cat) {
		mi = match[k] << match_log;
		for (j = 0; j != nb_cat; j += RTE_ACL_RESULTS_MULTIPLIER) {
			cr = _mm_loadu_si128((const xmm_t *)(res + mi + j));
			cp = _mm_loadu_si128((const xmm_t *)(pri + mi + j));
			for (i = 1, pm = match + nb_pkt; i != nb_trie;
				i++, pm += nb_pkt) {
				mn = j + (pm[k] << match_log);
				nr = _mm_loadu_si128((const xmm_t *)(res + mn));
				np = _mm_loadu_si128((const xmm_t *)(pri + mn));
				msk = _mm_cmpgt_epi32_mask(cp, np);
				cr = _mm_mask_mov_epi32(nr, msk, cr);
				cp = _mm_mask_mov_epi32(np, msk, cp);
			}
			_mm_storeu_si128((xmm_t *)(result + j), cr);
		}
	}
}
static inline void resolve_mcle8_avx512x1 ( uint32_t result [ ] , const struct rte_acl_match_results pr [ ] , const uint32_t match [ ] , uint32_t nb_pkt , uint32_t nb_cat , uint32_t nb_trie ) { const int32_t * pri ; const uint32_t * pm , * res ; uint32_t i , j , k , mi , mn ; __mmask8 msk ; xmm_t cp , cr , np , nr ; res = pr -> results ; pri = pr -> priority ; for ( k = 0 ; k != nb_pkt ; k ++ , result += nb_cat ) { mi = match [ k ] << match_log ; for ( j = 0 ; j != nb_cat ; j += RTE_ACL_RESULTS_MULTIPLIER ) { cr = _mm_loadu_si128 ( ( const xmm_t * ) ( res + mi + j ) ) ; cp = _mm_loadu_si128 ( ( const xmm_t * ) ( pri + mi + j ) ) ; for ( i = 1 , pm = match + nb_pkt ; i != nb_trie ; i ++ , pm += nb_pkt ) { mn = j + ( pm [ k ] << match_log ) ; nr = _mm_loadu_si128 ( ( const xmm_t * ) ( res + mn ) ) ; np = _mm_loadu_si128 ( ( const xmm_t * ) ( pri + mn ) ) ; msk = _mm_cmpgt_epi32_mask ( cp , np ) ; cr = _mm_mask_mov_epi32 ( nr , msk , cr ) ; cp = _mm_mask_mov_epi32 ( np , msk , cp ) ; } _mm_storeu_si128 ( ( xmm_t * ) ( result + j ) , cr ) ; } } }
Resolve matches for multiple categories (LE 8, use 128b instuctions/regs)
Resolve matches for multiple categories ( LE 8 use 128b instuctions / regs )