1 # MIPS DSP ASE simulator testsuite utility functions.
2 # Copyright (C) 2005, 2007 Free Software Foundation, Inc.
3 # Contributed by MIPS Technologies, Inc. Written by Chao-ying Fu.
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 2, or (at your option)
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 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. */
21 # $4, $5, $6, $7, $ac0, $ac1, $ac2, $ac3 are used as temps by the macros
24 # If a != b, jump to _fail.
25 # Otherwise, fall through.
26 .macro dsp_assert a, b
34 # Set dsp control register <= crin
35 # Check if d == (inst ?, s, t)
36 # Check if crout == dsp control register
37 .macro dspck_dstio inst, d, s, t, crin, crout
50 # Set dsp control register <= crin
52 # Check if crout == dsp control register
53 .macro dspck_stio inst, s, t, crin, crout
64 # Set dsp control register <= crin
65 # Check if d == (inst ?, s, t)
66 .macro dspck_dsti inst, d, s, t, crin
76 # Set dsp control register <= crin
77 # Check if tou == (inst tin, s)
78 .macro dspck_tsi inst, tou, tin, s, crin
88 # Set dsp control register <= crin
89 # Check if d == (inst ?, imm)
90 # Check if crout == dsp control register
91 .macro dspck_dIio inst, d, imm, crin, crout
102 # Set dsp control register <= crin
103 # Check if d == (inst ?, s)
104 # Check if crout == dsp control register
105 .macro dspck_dsio inst, d, s, crin, crout
117 # Set dsp control register <= crin
118 # Check if d == (inst ?, t, sa)
119 # Check if crout == dsp control register
120 .macro dspck_dtsaio inst, d, t, sa, crin, crout
132 # Set dsp control register <= crin
133 # Check if d == (inst ?, t, sa)
134 .macro dspck_dtsai inst, d, t, sa, crin
143 # Set dsp control register <= crin
144 # Set $ac3 <= {hiin, loin}
146 # Check if {hiou, loou} == $ac3
147 # Check if (crout & 0x80000) == (dsp control register & 0x80000)
148 .macro dspck_astio inst, hiin, loin, hiou, loou, s, t, crin, crout
171 # Set dsp control register <= crin
172 # Set $ac1 <= {hi, lo}
173 # Check if t == (inst ? $ac1, sa)
174 # Check if crout == dsp control register
175 .macro dspck_atsaio inst, hi, lo, t, sa, crin, crout
190 # Set dsp control register <= crin
191 # Set $ac1 <= {hi, lo}
192 # Check if t == (inst ? $ac1, s)
193 # Check if crout == dsp control register
194 .macro dspck_atsio inst, hi, lo, t, s, crin, crout
210 # Set dsp control register <= (crin & crinmask)
211 # Set $ac2 <= {hi, lo}
212 # Check if t == (inst ? $ac2, size)
213 # Check if (crout & croutmask) == (dsp control register & croutmask)
214 .macro dspck_tasiimom inst, hi, lo, t, size, crin, crinmask, crout, croutmask
222 \inst $5, $ac2, \size
232 # Set dsp control register <= (crin & crinmask)
233 # Set $ac2 <= {hi, lo}
234 # Check if t == (inst ? $ac2, size)
235 .macro dspck_tasiim inst, hi, lo, t, size, crin, crinmask
243 \inst $5, $ac2, \size
248 # Set dsp control register <= (crin & crinmask)
249 # Set $ac2 <= {hi, lo}
250 # Check if t == (inst ? $ac2, s)
251 # Check if (crout & croutmask) == (dsp control register & croutmask)
252 .macro dspck_tasimom inst, hi, lo, t, s, crin, crinmask, crout, croutmask
271 # Set dsp control register <= (crin & crinmask)
272 # Set $ac2 <= {hi, lo}
273 # Check if t == (inst ? $ac2, s)
274 .macro dspck_tasim inst, hi, lo, t, s, crin, crinmask
288 # Set dsp control register <= crin
289 # Set $ac0 <= {hi, lo}
291 # Check if $ac0 == {hio, loo}
292 # Check if crout == dsp control register
293 .macro dspck_asaio inst, hi, lo, hio, loo, shift, crin, crout
312 # Set dsp control register <= crin
313 # Set $ac0 <= {hi, lo}
315 # Check if $ac0 == {hio, loo}
316 # Check if crout == dsp control register
317 .macro dspck_asio inst, hi, lo, hio, loo, s, crin, crout
337 # Set dsp control register <= crin
338 # Set $ac3 <= {hi, lo}
339 # Check if s == (inst ? $ac3)
340 # Check if $ac3 == {hio, loo}
341 # Check if crout == dsp control register
342 .macro dspck_saio inst, hi, lo, hio, loo, s, crin, crout
362 # Set dsp control register <= crin
364 # Check if crout == dsp control register
365 .macro dspck_wrdsp s, m, crin, crout
375 # Set dsp control register <= crin
376 # Check if d == (rddsp ?, m)
377 .macro dspck_rddsp d, m, crin
385 # Check if d == (inst i(b))
386 .macro dspck_load inst, d, i, b
394 # Set dsp control register <= crin
395 # Check if bposge32 is taken or not as expected in r
396 # (1 => taken, 0 => not taken)
397 .macro dspck_bposge32 crin, r