1 /* GENmemcpy.S: Generic sparc64 memcpy.
3 * Copyright (C) 2007 David S. Miller (davem@davemloft.net)
7 #define GLOBAL_SPARE %g7
9 #define GLOBAL_SPARE %g5
21 #define EX_RETVAL(x) x
25 #define LOAD(type,addr,dest) type [addr], dest
29 #define STORE(type,src,addr) type src, [addr]
33 #define FUNC_NAME GENmemcpy
44 .register %g2,#scratch
45 .register %g3,#scratch
51 .type FUNC_NAME,#function
52 FUNC_NAME: /* %o0=dst, %o1=src, %o2=len */
76 EX_LD(LOAD(ldub, %o1, %g1))
77 EX_ST(STORE(stb, %g1, %o0))
84 1: subcc %g1, 0x8, %g1
85 EX_LD(LOAD(ldx, %o1, %g2))
86 EX_ST(STORE(stx, %g2, %o0))
96 80: /* 0 < len <= 16 */
103 EX_LD(LOAD(lduw, %o1, %g1))
104 EX_ST(STORE(stw, %g1, %o1 + %o3))
109 mov EX_RETVAL(GLOBAL_SPARE), %o0
114 EX_LD(LOAD(ldub, %o1, %g1))
115 EX_ST(STORE(stb, %g1, %o1 + %o3))
119 mov EX_RETVAL(GLOBAL_SPARE), %o0
121 .size FUNC_NAME, .-FUNC_NAME