针对2F 优化过的godson_memcpy.S: /* Copyright (C) 2002, 2003 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Hartvig Ekner , 2002. Ported to mips3 n32/n64 by Alexandre Oliva Optimized for godson2e by comcat
The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */
#include #include #include "regdef.h"
/* void *godson2e_memcpy(void *s1, const void *s2, size_t n); a0 <-- s1(dest);a1 <-- s2(src);a2 <-- n This could probably be optimized further. */
#if __BYTE_ORDER == __BIG_ENDIAN # define LDHI ldl /* high part is left in big-endian */ # define SDHI sdl /* high part is left in big-endian */ # define LDLO ldr /* low part is right in big-endian */ # define SDLO sdr /* low part is right in big-endian */ #else # define LDHI ldr /* high part is right in little-endian */ # define SDHI sdr /* high part is right in little-endian */ # define LDLO ldl /* low part is left in little-endian */ # define SDLO sdl /* low part is left in little-endian */ #endif