Skip to content
Commit aa424926 authored by Adhemerval Zanella's avatar Adhemerval Zanella Committed by Arjun Shankar
Browse files

x86: Fix Zen3/Zen4 ERMS selection (BZ 30994)



The REP MOVSB usage on memcpy/memmove does not show much performance
improvement on Zen3/Zen4 cores compared to the vectorized loops.  Also,
as from BZ 30994, if the source is aligned and the destination is not
the performance can be 20x slower.

The performance difference is noticeable with small buffer sizes, closer
to the lower bounds limits when memcpy/memmove starts to use ERMS.  The
performance of REP MOVSB is similar to vectorized instruction on the
size limit (the L2 cache).  Also, there is no drawback to multiple cores
sharing the cache.

Checked on x86_64-linux-gnu on Zen3.
Reviewed-by: default avatarH.J. Lu <hjl.tools@gmail.com>

(cherry picked from commit 0c0d39fe)
parent 5a461f29
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment