1 # MIPS DSP ASE simulator testsuite utility functions.
2 # Copyright (C) 2005-2021 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 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/>. */
20 # $4, $5, $6, $7, $ac0, $ac1, $ac2, $ac3 are used as temps by the macros
23 # If a != b, jump to _fail.
24 # Otherwise, fall through.
25 .macro dsp_assert a, b
33 # Set dsp control register <= crin
34 # Check if d == (inst ?, s, t)
35 # Check if crout == dsp control register
36 .macro dspck_dstio inst, d, s, t, crin, crout
49 # Set dsp control register <= crin
51 # Check if crout == dsp control register
52 .macro dspck_stio inst, s, t, crin, crout
63 # Set dsp control register <= crin
64 # Check if d == (inst ?, s, t)
65 .macro dspck_dsti inst, d, s, t, crin
75 # Set dsp control register <= crin
76 # Check if tou == (inst tin, s)
77 .macro dspck_tsi inst, tou, tin, s, crin
87 # Set dsp control register <= crin
88 # Check if d == (inst ?, imm)
89 # Check if crout == dsp control register
90 .macro dspck_dIio inst, d, imm, crin, crout
101 # Set dsp control register <= crin
102 # Check if d == (inst ?, s)
103 # Check if crout == dsp control register
104 .macro dspck_dsio inst, d, s, crin, crout
116 # Set dsp control register <= crin
117 # Check if d == (inst ?, t, sa)
118 # Check if crout == dsp control register
119 .macro dspck_dtsaio inst, d, t, sa, crin, crout
131 # Set dsp control register <= crin
132 # Check if d == (inst ?, t, sa)
133 .macro dspck_dtsai inst, d, t, sa, crin
142 # Set dsp control register <= crin
143 # Set $ac3 <= {hiin, loin}
145 # Check if {hiou, loou} == $ac3
146 # Check if (crout & 0x80000) == (dsp control register & 0x80000)
147 .macro dspck_astio inst, hiin, loin, hiou, loou, s, t, crin, crout
170 # Set dsp control register <= crin
171 # Set $ac1 <= {hi, lo}
172 # Check if t == (inst ? $ac1, sa)
173 # Check if crout == dsp control register
174 .macro dspck_atsaio inst, hi, lo, t, sa, crin, crout
189 # Set dsp control register <= crin
190 # Set acc <= {hiin, loin}
192 # Check if {hiou, loou} == acc
193 # Check if (crout & 0x80000) == (dsp control register & 0x80000)
194 .macro dspckacc_astio inst, acc, hiin, loin, hiou, loou, s, t, crin, crout
217 # Set dsp control register <= crin
218 # Set $ac1 <= {hi, lo}
219 # Check if t == (inst ? $ac1, s)
220 # Check if crout == dsp control register
221 .macro dspck_atsio inst, hi, lo, t, s, crin, crout
237 # Set dsp control register <= (crin & crinmask)
238 # Set $ac2 <= {hi, lo}
239 # Check if t == (inst ? $ac2, size)
240 # Check if (crout & croutmask) == (dsp control register & croutmask)
241 .macro dspck_tasiimom inst, hi, lo, t, size, crin, crinmask, crout, croutmask
249 \inst $5, $ac2, \size
259 # Set dsp control register <= (crin & crinmask)
260 # Set $ac2 <= {hi, lo}
261 # Check if t == (inst ? $ac2, size)
262 .macro dspck_tasiim inst, hi, lo, t, size, crin, crinmask
270 \inst $5, $ac2, \size
275 # Set dsp control register <= (crin & crinmask)
276 # Set $ac2 <= {hi, lo}
277 # Check if t == (inst ? $ac2, s)
278 # Check if (crout & croutmask) == (dsp control register & croutmask)
279 .macro dspck_tasimom inst, hi, lo, t, s, crin, crinmask, crout, croutmask
298 # Set dsp control register <= (crin & crinmask)
299 # Set $ac2 <= {hi, lo}
300 # Check if t == (inst ? $ac2, s)
301 .macro dspck_tasim inst, hi, lo, t, s, crin, crinmask
315 # Set dsp control register <= crin
316 # Set $ac0 <= {hi, lo}
318 # Check if $ac0 == {hio, loo}
319 # Check if crout == dsp control register
320 .macro dspck_asaio inst, hi, lo, hio, loo, shift, crin, crout
339 # Set dsp control register <= crin
340 # Set $ac0 <= {hi, lo}
342 # Check if $ac0 == {hio, loo}
343 # Check if crout == dsp control register
344 .macro dspck_asio inst, hi, lo, hio, loo, s, crin, crout
364 # Set dsp control register <= crin
365 # Set $ac3 <= {hi, lo}
366 # Check if s == (inst ? $ac3)
367 # Check if $ac3 == {hio, loo}
368 # Check if crout == dsp control register
369 .macro dspck_saio inst, hi, lo, hio, loo, s, crin, crout
389 # Set dsp control register <= crin
391 # Check if crout == dsp control register
392 .macro dspck_wrdsp s, m, crin, crout
402 # Set dsp control register <= crin
403 # Check if d == (rddsp ?, m)
404 .macro dspck_rddsp d, m, crin
412 # Check if d == (inst i(b))
413 .macro dspck_load inst, d, i, b
421 # Set dsp control register <= crin
422 # Check if bposge32 is taken or not as expected in r
423 # (1 => taken, 0 => not taken)
424 .macro dspck_bposge32 crin, r
436 # Check if tou == (inst tin, s)
437 .macro dspck_tsimm inst, tou, tin, s, sa