/*1* arch/alpha/lib/ev67-strcat.S2* 21264 version contributed by Rick Gorton <[email protected]>3*4* Append a null-terminated string from SRC to DST.5*6* Much of the information about 21264 scheduling/coding comes from:7* Compiler Writer's Guide for the Alpha 212648* abbreviated as 'CWG' in other comments here9* ftp.digital.com/pub/Digital/info/semiconductor/literature/dsc-library.html10* Scheduling notation:11* E - either cluster12* U - upper subcluster; U0 - subcluster U0; U1 - subcluster U113* L - lower subcluster; L0 - subcluster L0; L1 - subcluster L114* Try not to change the actual algorithm if possible for consistency.15* Commentary: It seems bogus to walk the input string twice - once16* to determine the length, and then again while doing the copy.17* A significant (future) enhancement would be to only read the input18* string once.19*/202122.text2324.align 425.globl strcat26.ent strcat27strcat:28.frame $30, 0, $2629.prologue 03031mov $16, $0 # E : set up return value32/* Find the end of the string. */33ldq_u $1, 0($16) # L : load first quadword (a0 may be misaligned)34lda $2, -1 # E :35insqh $2, $16, $2 # U :3637andnot $16, 7, $16 # E :38or $2, $1, $1 # E :39cmpbge $31, $1, $2 # E : bits set iff byte == 040bne $2, $found # U :4142$loop: ldq $1, 8($16) # L :43addq $16, 8, $16 # E :44cmpbge $31, $1, $2 # E :45beq $2, $loop # U :4647$found: cttz $2, $3 # U0 :48addq $16, $3, $16 # E :49/* Now do the append. */50mov $26, $23 # E :51br __stxcpy # L0 :5253.end strcat545556