summaryrefslogtreecommitdiff
path: root/arch/arc/lib
diff options
context:
space:
mode:
authorVineet Gupta <vgupta@kernel.org>2020-02-07 12:27:02 -0800
committerVineet Gupta <vgupta@kernel.org>2023-08-17 12:40:26 -0700
commit1918693ff1891ba57af22dbbf511cf300158a975 (patch)
treec3c498cb41a36f3315da04350fe6a631cc6b666e /arch/arc/lib
parentc8ee610afe654da7276d4aa8ad2bb60ffff6ddfc (diff)
ARCv2: memset: don't prefetch for len == 0 which happens a alot
This avoids potential "bleeding" when size == 0 as cache line would be dirtied (and possibly fetched from other cores) and due to the same reaons more optimal too. Signed-off-by: Vineet Gupta <vgupta@kernel.org>
Diffstat (limited to 'arch/arc/lib')
-rw-r--r--arch/arc/lib/memset-archs.S3
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/arc/lib/memset-archs.S b/arch/arc/lib/memset-archs.S
index d2e09fece5bc..d0a5cec4cdca 100644
--- a/arch/arc/lib/memset-archs.S
+++ b/arch/arc/lib/memset-archs.S
@@ -36,12 +36,13 @@
#endif
ENTRY_CFI(memset)
- PREFETCHW_INSTR r0, 0 ; Prefetch the first write location
mov.f 0, r2
;;; if size is zero
jz.d [blink]
mov r3, r0 ; don't clobber ret val
+ PREFETCHW_INSTR r0, 0 ; Prefetch the first write location
+
;;; if length < 8
brls.d.nt r2, 8, .Lsmallchunk
mov.f lp_count,r2