Lines Matching +full:0 +full:- +full:7 +full:a +full:- +full:e
1 /* SPDX-License-Identifier: GPL-2.0 */
3 * arch/alpha/lib/ev6-stxcpy.S
4 * 21264 version contributed by Rick Gorton <rick.gorton@alpha-processor.com>
6 * Copy a null-terminated string from SRC to DST.
21 * Furthermore, v0, a3-a5, t11, and t12 are untouched.
26 * ftp.digital.com/pub/Digital/info/semiconductor/literature/dsc-library.html
28 * E - either cluster
29 * U - upper subcluster; U0 - subcluster U0; U1 - subcluster U1
30 * L - lower subcluster; L0 - subcluster L0; L1 - subcluster L1
41 /* There is a problem with either gdb (as of 4.16) or gas (as of 2.7) that
42 doesn't like putting the entry point for a procedure somewhere in the
50 .frame sp, 0, t9
51 .prologue 0
57 /* Create the 1st output word and detect 0's in the 1st input word. */
58 lda t2, -1 # E : build a mask against false zero
61 ornot t1, t2, t2 # E : (stall)
64 cmpbge zero, t2, t8 # E : bits set iff null found
65 or t0, t3, t1 # E : (stall)
70 t1 == a source word not containing a null. */
74 stq_u t1, 0(a0) # L :
75 addq a0, 8, a0 # E :
79 ldq_u t1, 0(a1) # L : Latency=3
80 addq a1, 8, a1 # E :
81 cmpbge zero, t1, t8 # E : (3 cycle stall)
89 negq t8, t6 # E : find low bit set
90 and t8, t6, t12 # E : (stall)
91 /* For the sake of the cache, don't read a destination word
93 and t12, 0x80, t6 # E : (stall)
96 /* We're doing a partial word store and so need to combine
98 ldq_u t0, 0(a0) # L : Latency=3
99 subq t12, 1, t6 # E :
101 or t12, t6, t8 # E : (stall)
103 zap t0, t8, t0 # E : clear dst bytes <= null
104 or t0, t1, t1 # E : (stall)
108 1: stq_u t1, 0(a0) # L :
119 .frame sp, 0, t9
120 .prologue 0
122 /* Are source and destination co-aligned? */
123 xor a0, a1, t0 # E :
124 unop # E :
125 and t0, 7, t0 # E : (stall)
128 /* We are co-aligned; take care of a partial first word. */
129 ldq_u t1, 0(a1) # L : load first src word
130 and a0, 7, t0 # E : take care not to load a word ...
131 addq a1, 8, a1 # E :
134 ldq_u t0, 0(a0) # L :
140 /* The source and destination are not co-aligned. Align the destination
142 causing a SEGV. */
147 full source word. We can still find a zero at the end of it
151 t0 == the first dest word, for masking back in, if needed else 0
153 t6 == bytemask that is -1 in dest word bytes */
156 addq a1, 8, a1 # E :
161 or t1, t4, t1 # E :
163 or t0, t1, t1 # E : (stall on t1)
165 or t1, t6, t6 # E :
166 cmpbge zero, t6, t8 # E : (stall)
167 lda t6, -1 # E : for masking just below
171 or t6, t2, t2 # E : already extracted before (stall)
172 cmpbge zero, t2, t8 # E : testing eos (stall)
178 stq_u t1, 0(a0) # L : store first output word
179 addq a0, 8, a0 # E :
180 extql t2, a1, t0 # U : position ho-bits of lo word
181 ldq_u t2, 8(a1) # U : read next high-order source word
183 addq a1, 8, a1 # E :
184 cmpbge zero, t2, t8 # E : (stall for t2)
185 nop # E :
190 This has, unfortunately, effectively pulled half of a loop
196 t0 == the shifted high-order bits from the previous source word
199 We further know that t2 does not contain a null terminator. */
204 addq a1, 8, a1 # E : (stall)
206 addq a0, 8, a0 # E :
208 or t0, t1, t1 # E : current dst word now complete
209 ldq_u t2, 0(a1) # L : Latency=3 load high word for next time
210 stq_u t1, -8(a0) # L : save the current word (stall)
211 mov t3, t0 # E :
213 cmpbge zero, t2, t8 # E : test new word for eos
218 /* We've found a zero somewhere in the source word we just read.
224 t0 == the shifted high-order bits from the previous source word
228 or t0, t1, t1 # E : first (partial) source word complete (stall)
229 cmpbge zero, t1, t8 # E : is the null in this first bit? (stall)
233 stq_u t1, 0(a0) # L : the null was in the high-order bits
234 addq a0, 8, a0 # E :
236 cmpbge zero, t1, t8 # E : (stall)
238 /* Take care of a final (probably partial) result word.
243 negq t8, t6 # E : isolate low bit set
244 and t6, t8, t12 # E : (stall)
245 and t12, 0x80, t6 # E : avoid dest word load if we can (stall)
248 ldq_u t0, 0(a0) # E :
249 subq t12, 1, t6 # E :
250 or t6, t12, t8 # E : (stall)
254 or t0, t1, t1 # E : (stall)
258 1: stq_u t1, 0(a0) # L :
267 ldq_u t1, 0(a1) # L : load first source word
268 and a0, 7, t4 # E : find dest misalignment
269 and a1, 7, t5 # E : find src misalignment
270 /* Conditionally load the first destination word and a bytemask
271 with 0xff indicating that the destination byte is sacrosanct. */
272 mov zero, t0 # E :
274 mov zero, t6 # E :
276 ldq_u t0, 0(a0) # L :
277 lda t6, -1 # E :
284 subq a1, t4, a1 # E : sub dest misalignment from src addr
287 cmplt t4, t5, t12 # E :
289 lda t2, -1 # E : mask out leading garbage in source
292 ornot t1, t2, t3 # E : (stall)
293 cmpbge zero, t3, t8 # E : is there a zero? (stall)
296 /* At this point we've found a zero in the first partial word of
301 ldq_u t0, 0(a0) # L :
302 negq t8, t6 # E : build bitmask of bytes <= zero
303 and t6, t8, t12 # E : (stall)
304 and a1, 7, t5 # E :
306 subq t12, 1, t6 # E :
307 or t6, t12, t8 # E : (stall)
311 and t1, t2, t1 # E : to source validity mask
317 stq_u t1, 0(a0) # .. e0 : (stall)