]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blob - sim/testsuite/sim/mips/utils-mdmx.inc
Copyright updates for 2007.
[thirdparty/binutils-gdb.git] / sim / testsuite / sim / mips / utils-mdmx.inc
1 # MIPS simulator testsuite MDMX utility functions.
2 # Copyright (C) 2004, 2007 Free Software Foundation, Inc.
3 # Contributed by Chris Demetriou of Broadcom Corporation.
4 #
5 # This file is part of the GNU simulators.
6 #
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 2, or (at your option)
10 # any later version.
11 #
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.
16 #
17 # You should have received a copy of the GNU General Public License along
18 # with this program; if not, write to the Free Software Foundation, Inc.,
19 # 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
20
21 .include "utils-fpu.inc"
22
23 ###
24 ### Shared macros
25 ###
26
27 # Enable MDMX: enable the FPU w/ FR=1, then set Status.MX
28 .macro enable_mdmx
29 enable_fpu 1
30 mfc0 $20, $12
31 or $20, $20, (1 << 24)
32 mtc0 $20, $12
33 .endm
34
35
36 ###
37 ### .OB-format macros
38 ###
39
40 .macro ld_ob r, v
41 .data
42 1: .dword \v
43 .previous
44 ldc1 \r, 1b
45 .endm
46
47 .macro ck_ob r, v
48 .data
49 1: .dword \v
50 .previous
51 dmfc1 $20, \r
52 ld $21, 1b
53 bne $20, $21, _fail
54 nop
55 .endm
56
57 .macro ld_acc_ob h, m, l
58 ld_ob $f20, \m
59 ld_ob $f21, \l
60 wacl.ob $f20, $f21
61 ld_ob $f20, \h
62 wach.ob $f20
63 .endm
64
65 .macro ck_acc_ob h, m, l
66 rach.ob $f20
67 ck_ob $f20, \h
68 racm.ob $f20
69 ck_ob $f20, \m
70 racl.ob $f20
71 ck_ob $f20, \l
72 .endm