Home | History | Annotate | Line # | Download | only in mips
      1      1.1  christos # MIPS simulator testsuite MDMX utility functions.
      2  1.1.1.3  christos # Copyright (C) 2004-2025 Free Software Foundation, Inc.
      3      1.1  christos # Contributed by Chris Demetriou of Broadcom Corporation.
      4      1.1  christos #
      5      1.1  christos # This file is part of the GNU simulators.
      6      1.1  christos #
      7      1.1  christos # This program is free software; you can redistribute it and/or modify
      8      1.1  christos # it under the terms of the GNU General Public License as published by
      9      1.1  christos # the Free Software Foundation; either version 3 of the License, or
     10      1.1  christos # (at your option) any later version.
     11      1.1  christos #
     12      1.1  christos # This program is distributed in the hope that it will be useful,
     13      1.1  christos # but WITHOUT ANY WARRANTY; without even the implied warranty of
     14      1.1  christos # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     15      1.1  christos # GNU General Public License for more details.
     16      1.1  christos #
     17      1.1  christos # You should have received a copy of the GNU General Public License
     18      1.1  christos # along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
     19      1.1  christos 
     20      1.1  christos 	.include "utils-fpu.inc"
     21      1.1  christos 
     22      1.1  christos 	###
     23      1.1  christos 	### Shared macros
     24      1.1  christos 	###
     25      1.1  christos 
     26      1.1  christos 	# Enable MDMX: enable the FPU w/ FR=1, then set Status.MX
     27      1.1  christos 	.macro	enable_mdmx
     28      1.1  christos 	enable_fpu 1
     29      1.1  christos 	mfc0	$20, $12
     30      1.1  christos 	or	$20, $20, (1 << 24)
     31      1.1  christos 	mtc0	$20, $12
     32      1.1  christos 	.endm
     33      1.1  christos 
     34      1.1  christos 
     35      1.1  christos 	###
     36      1.1  christos 	### .OB-format macros
     37      1.1  christos 	###
     38      1.1  christos 
     39      1.1  christos 	.macro ld_ob r, v
     40      1.1  christos 	.data
     41      1.1  christos 1:	.dword	\v
     42      1.1  christos 	.previous
     43      1.1  christos 	ldc1	\r, 1b
     44      1.1  christos 	.endm
     45      1.1  christos 
     46      1.1  christos 	.macro ck_ob r, v
     47      1.1  christos 	.data
     48      1.1  christos 1:	.dword	\v
     49      1.1  christos 	.previous
     50      1.1  christos 	dmfc1	$20, \r
     51      1.1  christos 	ld	$21, 1b
     52      1.1  christos 	bne	$20, $21, _fail
     53      1.1  christos 	 nop
     54      1.1  christos 	.endm
     55      1.1  christos 
     56      1.1  christos 	.macro ld_acc_ob h, m, l
     57      1.1  christos 	ld_ob	$f20, \m
     58      1.1  christos 	ld_ob	$f21, \l
     59      1.1  christos 	wacl.ob	$f20, $f21
     60      1.1  christos 	ld_ob	$f20, \h
     61      1.1  christos 	wach.ob	$f20
     62      1.1  christos 	.endm
     63      1.1  christos 
     64      1.1  christos 	.macro ck_acc_ob h, m, l
     65      1.1  christos 	rach.ob	$f20
     66      1.1  christos 	ck_ob	$f20, \h
     67      1.1  christos 	racm.ob	$f20
     68      1.1  christos 	ck_ob	$f20, \m
     69      1.1  christos 	racl.ob	$f20
     70      1.1  christos 	ck_ob	$f20, \l
     71      1.1  christos 	.endm
     72