1 /* Copyright (C) 1991 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.
4 The GNU C Library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public License as
6 published by the Free Software Foundation; either version 2 of the
7 License, or (at your option) any later version.
9 The GNU C Library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
14 You should have received a copy of the GNU Library General Public
15 License along with the GNU C Library; see the file COPYING.LIB. If
16 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
17 Cambridge, MA 02139, USA. */
19 #include <sysdeps/generic/memcopy.h>
25 #define BYTE_COPY_FWD(dst_bp, src_bp, nbytes) \
28 size_t __nbytes = nbytes; \
29 asm volatile("mtspr 1,%2\n" \
31 "stsx 6,0,%0" : /* No outputs. */ : \
32 "b" (dst_bp), "b" (src_bp), "r" (__nbytes) : \
33 "6", "7", "8", "9", "10", "11", "12", "13"); \
39 #define BYTE_COPY_BWD(dst_ep, src_ep, nbytes) \
42 size_t __nbytes = (nbytes); \
45 asm volatile("mtspr 1,%2\n" \
47 "stsx 6,0,%0" : /* No outputs. */ : \
48 "b" (dst_ep), "b" (src_ep), "r" (__nbytes) : \
49 "6", "7", "8", "9", "10", "11", "12", "13"); \
53 #define WORD_COPY_FWD(dst_bp, src_bp, nbytes_left, nbytes) \
56 size_t __nblocks = (nbytes) / 32; \
58 asm volatile("mtctr %4\n" \
64 "=b" (dst_bp), "=b" (src_bp) : \
65 "0" (dst_bp), "1" (src_bp), "r" (__nblocks) : \
66 "6", "7", "8", "9", "10", "11", "12", "13"); \
67 (nbytes_left) = (nbytes) % 32; \
71 #define WORD_COPY_BWD(dst_ep, src_ep, nbytes_left, nbytes) \
74 size_t __nblocks = (nbytes) / 32; \
76 asm volatile("mtctr %4\n" \
82 "=b" (dst_ep), "=b" (src_ep) : \
83 "0" (dst_ep), "1" (src_ep), "r" (__nblocks) : \
84 "6", "7", "8", "9", "10", "11", "12", "13"); \
85 (nbytes_left) = (nbytes) % 32; \