1 /* This test program is part of GDB, the GNU debugger.
3 Copyright 2024 Free Software Foundation, Inc.
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 3 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>. */
21 char source
[40] __attribute__ ((aligned (8)))
22 = "This is a relatively long string...";
23 char a
[40] __attribute__ ((aligned (8)))
24 = "String to be overwritten with zeroes";
25 char b
[40] __attribute__ ((aligned (8)))
26 = "Another string to be memcopied...";
27 char c
[40] __attribute__ ((aligned (8)))
28 = "Another string to be memmoved...";
36 /* memset implemented in MOPS instructions. */
37 __asm__
volatile ("setp [%0]!, %1!, %2\n\t"
38 "setm [%0]!, %1!, %2\n\t"
39 "sete [%0]!, %1!, %2\n\t"
40 : "+&r"(p
), "+&r"(size
)
47 /* memmove implemented in MOPS instructions. */
48 __asm__
volatile ("cpyp [%0]!, [%1]!, %2!\n\t"
49 "cpym [%0]!, [%1]!, %2!\n\t"
50 "cpye [%0]!, [%1]!, %2!\n\t"
51 : "+&r" (p
), "+&r" (q
), "+&r" (size
)
57 /* memcpy implemented in MOPS instructions. */
58 __asm__
volatile ("cpyfp [%0]!, [%1]!, %2!\n\t"
59 "cpyfm [%0]!, [%1]!, %2!\n\t"
60 "cpyfe [%0]!, [%1]!, %2!\n\t"
61 : "+&r" (p
), "+&r" (q
), "+&r" (size
)