From 6e02b3e9327b7dbb063958d2b124b64fcb4bbe3f Mon Sep 17 00:00:00 2001 From: Sajan Karumanchi Date: Tue, 2 Feb 2021 12:42:14 +0100 Subject: x86: Adding an upper bound for Enhanced REP MOVSB. In the process of optimizing memcpy for AMD machines, we have found the vector move operations are outperforming enhanced REP MOVSB for data transfers above the L2 cache size on Zen3 architectures. To handle this use case, we are adding an upper bound parameter on enhanced REP MOVSB:'__x86_rep_movsb_stop_threshold'. As per large-bench results, we are configuring this parameter to the L2 cache size for AMD machines and applicable from Zen3 architecture supporting the ERMS feature. For architectures other than AMD, it is the computed value of non-temporal threshold parameter. Reviewed-by: Premachandra Mallappa --- sysdeps/x86/include/cpu-features.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'sysdeps/x86/include/cpu-features.h') diff --git a/sysdeps/x86/include/cpu-features.h b/sysdeps/x86/include/cpu-features.h index 624736b40e..475e877294 100644 --- a/sysdeps/x86/include/cpu-features.h +++ b/sysdeps/x86/include/cpu-features.h @@ -870,6 +870,8 @@ struct cpu_features unsigned long int non_temporal_threshold; /* Threshold to use "rep movsb". */ unsigned long int rep_movsb_threshold; + /* Threshold to stop using "rep movsb". */ + unsigned long int rep_movsb_stop_threshold; /* Threshold to use "rep stosb". */ unsigned long int rep_stosb_threshold; /* _SC_LEVEL1_ICACHE_SIZE. */ -- cgit v1.2.3-70-g09d2