2 * Copyright (C) 2013, 2014-2015, 2017 Synopsys, Inc. (www.synopsys.com)
3 * Copyright (C) 2007 ARC International (UK) LTD
5 * Licensed under the LGPL v2.1 or later, see the file COPYING.LIB in this tarball.
10 #if !defined(__ARC700__) && !defined(__ARCHS__)
11 #error "Neither ARC700 nor ARCHS is defined!"
17 #define SMALL 7 /* Must be at least 6 to deal with alignment/loop issues. */
38 .Laligned: ; This code address should be aligned for speed.
55 #endif /* __ARC700__ */
58 #ifdef DONT_USE_PREALLOC
59 #define PREWRITE(A,B) prefetchw [(A),(B)]
61 #define PREWRITE(A,B) prealloc [(A),(B)]
64 prefetchw [r0] ; Prefetch the write location
68 mov r3, r0 ; don't clobber ret val
71 brls.d.nt r2, 8, .Lsmallchunk
76 lpnz @.Laligndestination
82 ;;; Destination is aligned
96 ;;; Convert len to Dwords, unfold x8
97 lsr.f lp_count, lp_count, 6
100 PREWRITE(r3, 64) ;Prefetch the next write location
101 #if defined(__LL64__) || defined(__ARC_LL64__)
130 lsr.f lp_count, r2, 5 ;Last remaining max 124 bytes
133 prefetchw [r3, 32] ;Prefetch the next write location
134 #if defined(__LL64__) || defined(__ARC_LL64__)
151 and.f lp_count, r2, 0x1F ;Last remaining 31 bytes
159 #endif /* __ARCHS__ */
162 libc_hidden_def(memset)