1 # MIPS simulator testsuite utility functions.
2 # Copyright (C) 2004-2016 Free Software Foundation, Inc.
3 # Contributed by Chris Demetriou of Broadcom Corporation.
5 # This file is part of the GNU simulators.
7 # This program is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 3 of the License, or
10 # (at your option) any later version.
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
17 # You should have received a copy of the GNU General Public License
18 # along with this program. If not, see <http://www.gnu.org/licenses/>. */
21 # $1, $4, $5, %6, are used as temps by the macros defined here.
38 # The MIPS simulator uses "break 0x3ff" as the code to exit,
39 # with the return value in $4 (a0).
74 # The MIPS simulator can use multiple different monitor types,
75 # so we hard-code the simulator "write" reserved instruction opcode,
76 # rather than jumping to a vector that invokes it. The operation
77 # expects RA to point to the location at which to continue
82 # Write opcode (reserved instruction). See sim_monitor and its
83 # callers in sim/mips/interp.c.
84 .word 0x00000039 | ((8 << 1) << 6)
108 .macro load32 reg, val
113 .macro load64 reg, val
118 .macro loadaddr reg, addr
123 .macro checkreg reg, expreg
127 beq \expreg, \reg, 901f
135 .macro check32 reg, val
144 .macro check64 reg, val