]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blob - gdb/testsuite/gdb.disasm/hppa.exp
Copyright updates for 2007.
[thirdparty/binutils-gdb.git] / gdb / testsuite / gdb.disasm / hppa.exp
1
2 # Copyright 1992, 1993, 1994, 1995, 1996, 1997, 2007
3 # Free Software Foundation, Inc.
4
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 2 of the License, or
8 # (at your option) any later version.
9 #
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
14 #
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software
17 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18
19 # Please email any bugs, comments, and/or additions to this file to:
20 # bug-gdb@prep.ai.mit.edu
21
22 # This file was written by Jeff Law. (law@cs.utah.edu)
23
24 if $tracelevel then {
25 strace $tracelevel
26 }
27
28 if ![istarget "hppa*-*-*"] {
29 verbose "Tests ignored for all but hppa based targets."
30 return
31 }
32
33
34 set prms_id 0
35 set bug_id 0
36
37 set testfile "hppa"
38 set srcfile ${srcdir}/${subdir}/${testfile}.s
39 set binfile ${objdir}/${subdir}/${testfile}
40 set comp_output [gdb_compile "${srcfile}" "${binfile}" executable ""];
41 if { $comp_output != "" } {
42 if [ regexp "Opcode not defined - DIAG" $comp_output] {
43 warning "HP assembler in use--skipping disasm tests"
44 return
45 } else {
46 perror "Couldn't compile ${srcfile}"
47 return -1
48 }
49 }
50
51 proc all_integer_memory_tests { } {
52 global gdb_prompt
53 global hex
54 global decimal
55
56 send_gdb "x/8i integer_memory_tests\n"
57 gdb_expect {
58 -re "
59 .*ldw 0\\(sr0,r4\\),r26.*
60 .*ldh 0\\(sr0,r4\\),r26.*
61 .*ldb 0\\(sr0,r4\\),r26.*
62 .*stw r26,0\\(sr0,r4\\).*
63 .*sth r26,0\\(sr0,r4\\).*
64 .*stb r26,0\\(sr0,r4\\).*
65 .*ldwm 0\\(sr0,r4\\),r26.*
66 .*stwm r26,0\\(sr0,r4\\).*
67 .*$gdb_prompt $" { pass "integer_memory_tests" }
68 -re "$gdb_prompt $" { fail "integer_memory_tests" }
69 timeout { fail "(timeout) integer memory_tests" }
70 }
71
72 send_gdb "x/20i integer_indexing_load\n"
73 gdb_expect {
74 -re "
75 .*ldwx r5\\(sr0,r4\\),r26.*
76 .*ldwx,s r5\\(sr0,r4\\),r26.*
77 .*ldwx,m r5\\(sr0,r4\\),r26.*
78 .*ldwx,sm r5\\(sr0,r4\\),r26.*
79 .*ldhx r5\\(sr0,r4\\),r26.*
80 .*ldhx,s r5\\(sr0,r4\\),r26.*
81 .*ldhx,m r5\\(sr0,r4\\),r26.*
82 .*ldhx,sm r5\\(sr0,r4\\),r26.*
83 .*ldbx r5\\(sr0,r4\\),r26.*
84 .*ldbx,s r5\\(sr0,r4\\),r26.*
85 .*ldbx,m r5\\(sr0,r4\\),r26.*
86 .*ldbx,sm r5\\(sr0,r4\\),r26.*
87 .*ldwax r5\\(r4\\),r26.*
88 .*ldwax,s r5\\(r4\\),r26.*
89 .*ldwax,m r5\\(r4\\),r26.*
90 .*ldwax,sm r5\\(r4\\),r26.*
91 .*ldcwx r5\\(sr0,r4\\),r26.*
92 .*ldcwx,s r5\\(sr0,r4\\),r26.*
93 .*ldcwx,m r5\\(sr0,r4\\),r26.*
94 .*ldcwx,sm r5\\(sr0,r4\\),r26.*
95 .*$gdb_prompt $" { pass "integer_indexing_load" }
96 -re "$gdb_prompt $" { fail "integer_indexing_load" }
97 timeout { fail "(timeout) integer_indexing" }
98 }
99
100 send_gdb "x/15i integer_load_short_memory\n"
101 gdb_expect {
102 -re "
103 .*ldws 0\\(sr0,r4\\),r26.*
104 .*ldws,mb 0\\(sr0,r4\\),r26.*
105 .*ldws,ma 0\\(sr0,r4\\),r26.*
106 .*ldhs 0\\(sr0,r4\\),r26.*
107 .*ldhs,mb 0\\(sr0,r4\\),r26.*
108 .*ldhs,ma 0\\(sr0,r4\\),r26.*
109 .*ldbs 0\\(sr0,r4\\),r26.*
110 .*ldbs,mb 0\\(sr0,r4\\),r26.*
111 .*ldbs,ma 0\\(sr0,r4\\),r26.*
112 .*ldwas 0\\(r4\\),r26.*
113 .*ldwas,mb 0\\(r4\\),r26.*
114 .*ldwas,ma 0\\(r4\\),r26.*
115 .*ldcws 0\\(sr0,r4\\),r26.*
116 .*ldcws,mb 0\\(sr0,r4\\),r26.*
117 .*ldcws,ma 0\\(sr0,r4\\),r26.*
118 .*$gdb_prompt $" { pass "integer_load_short_memory" }
119 -re "$gdb_prompt $" { fail "integer_load_short_memory" }
120 timeout { fail "(timeout) integer_load_short_memory " }
121 }
122
123
124 send_gdb "x/17i integer_store_short_memory\n"
125 gdb_expect {
126 -re "
127 .*stws r26,0\\(sr0,r4\\).*
128 .*stws,mb r26,0\\(sr0,r4\\).*
129 .*stws,ma r26,0\\(sr0,r4\\).*
130 .*sths r26,0\\(sr0,r4\\).*
131 .*sths,mb r26,0\\(sr0,r4\\).*
132 .*sths,ma r26,0\\(sr0,r4\\).*
133 .*stbs r26,0\\(sr0,r4\\).*
134 .*stbs,mb r26,0\\(sr0,r4\\).*
135 .*stbs,ma r26,0\\(sr0,r4\\).*
136 .*stwas r26,0\\(r4\\).*
137 .*stwas,mb r26,0\\(r4\\).*
138 .*stwas,ma r26,0\\(r4\\).*
139 .*stbys r26,0\\(sr0,r4\\).*
140 .*stbys r26,0\\(sr0,r4\\).*
141 .*stbys,e r26,0\\(sr0,r4\\).*
142 .*stbys,b,m r26,0\\(sr0,r4\\).*
143 .*stbys,e,m r26,0\\(sr0,r4\\).*
144 .*$gdb_prompt $" { pass "integer_store_short_memory" }
145 -re "$gdb_prompt $" { fail "integer_store_short_memory" }
146 timeout { fail "(timeout) integer_short_memory " }
147 }
148 }
149
150 proc all_immediate_tests { } {
151 global gdb_prompt
152 global hex
153 global decimal
154
155 send_gdb "x/3i immediate_tests\n"
156 gdb_expect {
157 -re "
158 .*ldo 5\\(r26\\),r26.*
159 .*ldil -21524800,r26.*
160 .*addil -21524800,r5.*
161 .*$gdb_prompt $" { pass "immedate_tests" }
162 -re "$gdb_prompt $" { fail "immedate_tests" }
163 timeout { fail "(timeout) immedate_tests " }
164 }
165 }
166
167 proc all_branch_tests { } {
168 global gdb_prompt
169 global hex
170 global decimal
171
172 send_gdb "x/10i branch_tests_1\n"
173 gdb_expect {
174 -re "
175 .*bl.*,rp.*
176 .*bl,n.*,rp.*
177 .*b.*
178 .*b,n.*
179 .*gate.*,rp.*
180 .*gate,n.*,rp.*
181 .*blr r4,rp.*
182 .*blr,n r4,rp.*
183 .*blr r4,r0.*
184 .*blr,n r4,r0.*
185 .*$gdb_prompt $" { pass "branch_tests_1" }
186 -re "$gdb_prompt $" { fail "branch_tests_1" }
187 timeout { fail "(timeout) branch_tests_1" }
188 }
189
190 send_gdb "x/6i branch_tests_2\n"
191 gdb_expect {
192 -re "
193 .*bv r0\\(rp\\).*
194 .*bv,n r0\\(rp\\).*
195 .*be 1234\\(sr1,rp\\).*
196 .*be,n 1234\\(sr1,rp\\).*
197 .*ble 1234\\(sr1,rp\\).*
198 .*ble,n 1234\\(sr1,rp\\).*
199 .*$gdb_prompt $" { pass "branch_tests_2" }
200 -re "$gdb_prompt $" { fail "branch_tests_2" }
201 timeout { fail "(timeout) branch_tests_2" }
202 }
203
204
205 send_gdb "x/8i movb_tests\n"
206 gdb_expect {
207 -re "
208 .*movb r4,r26,.* <movb_tests>.*
209 .*movb,= r4,r26,.* <movb_tests>.*
210 .*movb,< r4,r26,.* <movb_tests>.*
211 .*movb,od r4,r26,.* <movb_tests>.*
212 .*movb,tr r4,r26,.* <movb_tests>.*
213 .*movb,<> r4,r26,.* <movb_tests>.*
214 .*movb,>= r4,r26,.* <movb_tests>.*
215 .*movb,ev r4,r26,.* <movb_tests>.*
216 .*$gdb_prompt $" { pass "movb_tests" }
217 -re "$gdb_prompt $" { fail "movb_tests" }
218 timeout { fail "(timeout) movb_tests " }
219 }
220
221 send_gdb "x/8i movb_nullified_tests\n"
222 gdb_expect {
223 -re "
224 .*movb,n.*r4,r26,.* <movb_tests>.*
225 .*movb,=,n.*r4,r26,.* <movb_tests>.*
226 .*movb,<,n.*r4,r26,.* <movb_tests>.*
227 .*movb,od,n.*r4,r26,.* <movb_tests>.*
228 .*movb,tr,n.*r4,r26,.* <movb_tests>.*
229 .*movb,<>,n.*r4,r26,.* <movb_tests>.*
230 .*movb,>=,n.*r4,r26,.* <movb_tests>.*
231 .*movb,ev,n.*r4,r26,.* <movb_tests>.*
232 .*$gdb_prompt $" { pass "movb_nullified_tests" }
233 -re "$gdb_prompt $" { fail "movb_nullified_tests" }
234 timeout { fail "(timeout) movb_nullified_tests " }
235 }
236
237 send_gdb "x/8i movib_tests\n"
238 gdb_expect {
239 -re "
240 .*movib 5,r26,.* <movib_tests>.*
241 .*movib,= 5,r26,.* <movib_tests>.*
242 .*movib,< 5,r26,.* <movib_tests>.*
243 .*movib,od 5,r26,.* <movib_tests>.*
244 .*movib,tr 5,r26,.* <movib_tests>.*
245 .*movib,<> 5,r26,.* <movib_tests>.*
246 .*movib,>= 5,r26,.* <movib_tests>.*
247 .*movib,ev 5,r26,.* <movib_tests>.*
248 .*$gdb_prompt $" { pass "movib_tests" }
249 -re "$gdb_prompt $" { fail "movib_tests" }
250 timeout { fail "(timeout) movib_tests " }
251 }
252
253 send_gdb "x/8i movib_nullified_tests\n"
254 gdb_expect {
255 -re "
256 .*movib,n.*5,r26,.* <movib_tests>.*
257 .*movib,=,n.*5,r26,.* <movib_tests>.*
258 .*movib,<,n.*5,r26,.* <movib_tests>.*
259 .*movib,od,n.*5,r26,.* <movib_tests>.*
260 .*movib,tr,n.*5,r26,.* <movib_tests>.*
261 .*movib,<>,n.*5,r26,.* <movib_tests>.*
262 .*movib,>=,n.*5,r26,.* <movib_tests>.*
263 .*movib,ev,n.*5,r26,.* <movib_tests>.*
264 .*$gdb_prompt $" { pass "movib_nullified_tests" }
265 -re "$gdb_prompt $" { fail "movib_nullified_tests" }
266 timeout { fail "(timeout) movib_nullified_tests " }
267 }
268
269 send_gdb "x/8i comb_tests_1\n"
270 gdb_expect {
271 -re "
272 .*comb r0,r4,.* <comb_tests_1>.*
273 .*comb,= r0,r4,.* <comb_tests_1>.*
274 .*comb,< r0,r4,.* <comb_tests_1>.*
275 .*comb,<= r0,r4,.* <comb_tests_1>.*
276 .*comb,<< r0,r4,.* <comb_tests_1>.*
277 .*comb,<<= r0,r4,.* <comb_tests_1>.*
278 .*comb,sv r0,r4,.* <comb_tests_1>.*
279 .*comb,od r0,r4,.* <comb_tests_1>.*
280 .*$gdb_prompt $" { pass "comb_tests_1" }
281 -re "$gdb_prompt $" { fail "comb_tests_1" }
282 timeout { fail "(timeout) comb_tests_1" }
283 }
284
285 send_gdb "x/8i comb_tests_2\n"
286 gdb_expect {
287 -re "
288 .*combf r0,r4,.* <comb_tests_2>.*
289 .*combf,= r0,r4,.* <comb_tests_2>.*
290 .*combf,< r0,r4,.* <comb_tests_2>.*
291 .*combf,<= r0,r4,.* <comb_tests_2>.*
292 .*combf,<< r0,r4,.* <comb_tests_2>.*
293 .*combf,<<= r0,r4,.* <comb_tests_2>.*
294 .*combf,sv r0,r4,.* <comb_tests_2>.*
295 .*combf,od r0,r4,.* <comb_tests_2>.*
296 .*$gdb_prompt $" { pass "comb_tests_2" }
297 -re "$gdb_prompt $" { fail "comb_tests_2" }
298 timeout { fail "(timeout) comb_tests_2" }
299 }
300
301 send_gdb "x/8i comb_nullified_tests_1\n"
302 gdb_expect {
303 -re "
304 .*comb,n r0,r4,.* <comb_tests_1>.*
305 .*comb,=,n r0,r4,.* <comb_tests_1>.*
306 .*comb,<,n r0,r4,.* <comb_tests_1>.*
307 .*comb,<=,n r0,r4,.* <comb_tests_1>.*
308 .*comb,<<,n r0,r4,.* <comb_tests_1>.*
309 .*comb,<<=,n r0,r4,.* <comb_tests_1>.*
310 .*comb,sv,n r0,r4,.* <comb_tests_1>.*
311 .*comb,od,n r0,r4,.* <comb_tests_1>.*
312 .*$gdb_prompt $" { pass "comb_nullified_tests_1" }
313 -re "$gdb_prompt $" { fail "comb_nullified_tests_1" }
314 timeout { fail "(timeout) comb_nullified_tests_1" }
315 }
316
317 send_gdb "x/8i comb_nullified_tests_2\n"
318 gdb_expect {
319 -re "
320 .*combf,n r0,r4,.* <comb_tests_2>.*
321 .*combf,=,n r0,r4,.* <comb_tests_2>.*
322 .*combf,<,n r0,r4,.* <comb_tests_2>.*
323 .*combf,<=,n r0,r4,.* <comb_tests_2>.*
324 .*combf,<<,n r0,r4,.* <comb_tests_2>.*
325 .*combf,<<=,n r0,r4,.* <comb_tests_2>.*
326 .*combf,sv,n r0,r4,.* <comb_tests_2>.*
327 .*combf,od,n r0,r4,.* <comb_tests_2>.*
328 .*$gdb_prompt $" { pass "comb_nullified_tests_2" }
329 -re "$gdb_prompt $" { fail "comb_nullified_tests_2" }
330 timeout { fail "(timeout) comb_nullified_tests_2" }
331 }
332
333 send_gdb "x/8i comib_tests_1\n"
334 gdb_expect {
335 -re "
336 .*comib 0,r4,.* <comib_tests_1>.*
337 .*comib,= 0,r4,.* <comib_tests_1>.*
338 .*comib,< 0,r4,.* <comib_tests_1>.*
339 .*comib,<= 0,r4,.* <comib_tests_1>.*
340 .*comib,<< 0,r4,.* <comib_tests_1>.*
341 .*comib,<<= 0,r4,.* <comib_tests_1>.*
342 .*comib,sv 0,r4,.* <comib_tests_1>.*
343 .*comib,od 0,r4,.* <comib_tests_1>.*
344 .*$gdb_prompt $" { pass "comib_tests_1" }
345 -re "$gdb_prompt $" { fail "comib_tests_1" }
346 timeout { fail "(timeout) comib_tests_1" }
347 }
348
349 send_gdb "x/8i comib_tests_2\n"
350 gdb_expect {
351 -re "
352 .*comibf 0,r4,.* <comib_tests_2>.*
353 .*comibf,= 0,r4,.* <comib_tests_2>.*
354 .*comibf,< 0,r4,.* <comib_tests_2>.*
355 .*comibf,<= 0,r4,.* <comib_tests_2>.*
356 .*comibf,<< 0,r4,.* <comib_tests_2>.*
357 .*comibf,<<= 0,r4,.* <comib_tests_2>.*
358 .*comibf,sv 0,r4,.* <comib_tests_2>.*
359 .*comibf,od 0,r4,.* <comib_tests_2>.*
360 .*$gdb_prompt $" { pass "comib_tests_2" }
361 -re "$gdb_prompt $" { fail "comib_tests_2" }
362 timeout { fail "(timeout) comib_tests_2" }
363 }
364
365 send_gdb "x/8i comib_nullified_tests_1\n"
366 gdb_expect {
367 -re "
368 .*comib,n 0,r4,.* <comib_tests_1>.*
369 .*comib,=,n 0,r4,.* <comib_tests_1>.*
370 .*comib,<,n 0,r4,.* <comib_tests_1>.*
371 .*comib,<=,n 0,r4,.* <comib_tests_1>.*
372 .*comib,<<,n 0,r4,.* <comib_tests_1>.*
373 .*comib,<<=,n 0,r4,.* <comib_tests_1>.*
374 .*comib,sv,n 0,r4,.* <comib_tests_1>.*
375 .*comib,od,n 0,r4,.* <comib_tests_1>.*
376 .*$gdb_prompt $" { pass "comib_nullified_tests_1" }
377 -re "$gdb_prompt $" { fail "comib_nullified_tests_1" }
378 timeout { fail "(timeout) comib_nullified_tests_1" }
379 }
380
381 send_gdb "x/8i comib_nullified_tests_2\n"
382 gdb_expect {
383 -re "
384 .*comibf,n 0,r4,.* <comib_tests_2>.*
385 .*comibf,=,n 0,r4,.* <comib_tests_2>.*
386 .*comibf,<,n 0,r4,.* <comib_tests_2>.*
387 .*comibf,<=,n 0,r4,.* <comib_tests_2>.*
388 .*comibf,<<,n 0,r4,.* <comib_tests_2>.*
389 .*comibf,<<=,n 0,r4,.* <comib_tests_2>.*
390 .*comibf,sv,n 0,r4,.* <comib_tests_2>.*
391 .*comibf,od,n 0,r4,.* <comib_tests_2>.*
392 .*$gdb_prompt $" { pass "comib_nullified_tests_2" }
393 -re "$gdb_prompt $" { fail "comib_nullified_tests_2" }
394 timeout { fail "(timeout) comib_nullified_tests_2" }
395 }
396
397 send_gdb "x/8i addb_tests_1\n"
398 gdb_expect {
399 -re "
400 .*addb r1,r4,.* <addb_tests_1>.*
401 .*addb,= r1,r4,.* <addb_tests_1>.*
402 .*addb,< r1,r4,.* <addb_tests_1>.*
403 .*addb,<= r1,r4,.* <addb_tests_1>.*
404 .*addb,nuv r1,r4,.* <addb_tests_1>.*
405 .*addb,znv r1,r4,.* <addb_tests_1>.*
406 .*addb,sv r1,r4,.* <addb_tests_1>.*
407 .*addb,od r1,r4,.* <addb_tests_1>.*
408 .*$gdb_prompt $" { pass "addb_tests_1" }
409 -re "$gdb_prompt $" { fail "addb_tests_1" }
410 timeout { fail "(timeout) addb_tests_1" }
411 }
412
413 send_gdb "x/8i addb_tests_2\n"
414 gdb_expect {
415 -re "
416 .*addbf r1,r4,.* <addb_tests_2>.*
417 .*addbf,= r1,r4,.* <addb_tests_2>.*
418 .*addbf,< r1,r4,.* <addb_tests_2>.*
419 .*addbf,<= r1,r4,.* <addb_tests_2>.*
420 .*addbf,nuv r1,r4,.* <addb_tests_2>.*
421 .*addbf,znv r1,r4,.* <addb_tests_2>.*
422 .*addbf,sv r1,r4,.* <addb_tests_2>.*
423 .*addbf,od r1,r4,.* <addb_tests_2>.*
424 .*$gdb_prompt $" { pass "addb_tests_2" }
425 -re "$gdb_prompt $" { fail "addb_tests_2" }
426 timeout { fail "(timeout) addb_tests_2" }
427 }
428
429 send_gdb "x/8i addb_nullified_tests_1\n"
430 gdb_expect {
431 -re "
432 .*addb,n r1,r4,.* <addb_tests_1>.*
433 .*addb,=,n r1,r4,.* <addb_tests_1>.*
434 .*addb,<,n r1,r4,.* <addb_tests_1>.*
435 .*addb,<=,n r1,r4,.* <addb_tests_1>.*
436 .*addb,nuv,n r1,r4,.* <addb_tests_1>.*
437 .*addb,znv,n r1,r4,.* <addb_tests_1>.*
438 .*addb,sv,n r1,r4,.* <addb_tests_1>.*
439 .*addb,od,n r1,r4,.* <addb_tests_1>.*
440 .*$gdb_prompt $" { pass "addb_nullified_tests_1" }
441 -re "$gdb_prompt $" { fail "addb_nullified_tests_1" }
442 timeout { fail "(timeout) addb_nullified_tests_1" }
443 }
444
445 send_gdb "x/8i addb_nullified_tests_2\n"
446 gdb_expect {
447 -re "
448 .*addbf,n r1,r4,.* <addb_tests_2>.*
449 .*addbf,=,n r1,r4,.* <addb_tests_2>.*
450 .*addbf,<,n r1,r4,.* <addb_tests_2>.*
451 .*addbf,<=,n r1,r4,.* <addb_tests_2>.*
452 .*addbf,nuv,n r1,r4,.* <addb_tests_2>.*
453 .*addbf,znv,n r1,r4,.* <addb_tests_2>.*
454 .*addbf,sv,n r1,r4,.* <addb_tests_2>.*
455 .*addbf,od,n r1,r4,.* <addb_tests_2>.*
456 .*$gdb_prompt $" { pass "addb_nullified_tests_2" }
457 -re "$gdb_prompt $" { fail "addb_nullified_tests_2" }
458 timeout { fail "(timeout) addb_nullified_tests_2" }
459 }
460
461 send_gdb "x/8i addib_tests_1\n"
462 gdb_expect {
463 -re "
464 .*addib -1,r4,.* <addib_tests_1>.*
465 .*addib,= -1,r4,.* <addib_tests_1>.*
466 .*addib,< -1,r4,.* <addib_tests_1>.*
467 .*addib,<= -1,r4,.* <addib_tests_1>.*
468 .*addib,nuv -1,r4,.* <addib_tests_1>.*
469 .*addib,znv -1,r4,.* <addib_tests_1>.*
470 .*addib,sv -1,r4,.* <addib_tests_1>.*
471 .*addib,od -1,r4,.* <addib_tests_1>.*
472 .*$gdb_prompt $" { pass "addib_tests_1" }
473 -re "$gdb_prompt $" { fail "addib_tests_1" }
474 timeout { fail "(timeout) addib_tests_1" }
475 }
476
477 send_gdb "x/8i addib_tests_2\n"
478 gdb_expect {
479 -re "
480 .*addibf -1,r4,.* <addib_tests_2>.*
481 .*addibf,= -1,r4,.* <addib_tests_2>.*
482 .*addibf,< -1,r4,.* <addib_tests_2>.*
483 .*addibf,<= -1,r4,.* <addib_tests_2>.*
484 .*addibf,nuv -1,r4,.* <addib_tests_2>.*
485 .*addibf,znv -1,r4,.* <addib_tests_2>.*
486 .*addibf,sv -1,r4,.* <addib_tests_2>.*
487 .*addibf,od -1,r4,.* <addib_tests_2>.*
488 .*$gdb_prompt $" { pass "addib_tests_2" }
489 -re "$gdb_prompt $" { fail "addib_tests_2" }
490 timeout { fail "(timeout) addib_tests_2" }
491 }
492
493 send_gdb "x/8i addib_nullified_tests_1\n"
494 gdb_expect {
495 -re "
496 .*addib,n -1,r4,.* <addib_tests_1>.*
497 .*addib,=,n -1,r4,.* <addib_tests_1>.*
498 .*addib,<,n -1,r4,.* <addib_tests_1>.*
499 .*addib,<=,n -1,r4,.* <addib_tests_1>.*
500 .*addib,nuv,n -1,r4,.* <addib_tests_1>.*
501 .*addib,znv,n -1,r4,.* <addib_tests_1>.*
502 .*addib,sv,n -1,r4,.* <addib_tests_1>.*
503 .*addib,od,n -1,r4,.* <addib_tests_1>.*
504 .*$gdb_prompt $" { pass "addb_nullified_tests_1" }
505 -re "$gdb_prompt $" { fail "addb_nullified_tests_1" }
506 timeout { fail "(timeout) addb_nullified_tests_1" }
507 }
508
509 send_gdb "x/8i addib_nullified_tests_2\n"
510 gdb_expect {
511 -re "
512 .*addibf,n -1,r4,.* <addib_tests_2>.*
513 .*addibf,=,n -1,r4,.* <addib_tests_2>.*
514 .*addibf,<,n -1,r4,.* <addib_tests_2>.*
515 .*addibf,<=,n -1,r4,.* <addib_tests_2>.*
516 .*addibf,nuv,n -1,r4,.* <addib_tests_2>.*
517 .*addibf,znv,n -1,r4,.* <addib_tests_2>.*
518 .*addibf,sv,n -1,r4,.* <addib_tests_2>.*
519 .*addibf,od,n -1,r4,.* <addib_tests_2>.*
520 .*$gdb_prompt $" { pass "addb_nullified_tests_2" }
521 -re "$gdb_prompt $" { fail "addb_nullified_tests_2" }
522 timeout { fail "(timeout) addb_nullified_tests_2" }
523 }
524
525 send_gdb "x/8i bb_tests\n"
526 gdb_expect {
527 -re "
528 .*bvb,< r4,.* <bb_tests>.*
529 .*bvb,>= r4,.* <bb_tests>.*
530 .*bvb,<,n r4,.* <bb_tests>.*
531 .*bvb,>=,n r4,.* <bb_tests>.*
532 .*bb,< r4,5,.* <bb_tests>.*
533 .*bb,>= r4,5,.* <bb_tests>.*
534 .*bb,<,n r4,5,.* <bb_tests>.*
535 .*bb,>=,n r4,5,.* <bb_tests>.*
536 .*$gdb_prompt $" { pass "bb_tests" }
537 -re "$gdb_prompt $" { fail "bb_tests" }
538 timeout { fail "(timeout) bb_tests " }
539 }
540 }
541
542 proc all_integer_computational_tests { } {
543 global gdb_prompt
544 global hex
545 global decimal
546
547 set add_insns [list {add} {addl} {addo} {addc} {addco} \
548 {sh1add} {sh1addl} {sh1addo} \
549 {sh2add} {sh2addl} {sh2addo} \
550 {sh3add} {sh3addl} {sh3addo} ]
551
552 foreach i $add_insns {
553 send_gdb "x/16i $i"; send_gdb "_tests\n"
554 gdb_expect {
555 -re "
556 .*$i r4,r5,r6.*
557 .*$i,= r4,r5,r6.*
558 .*$i,< r4,r5,r6.*
559 .*$i,<= r4,r5,r6.*
560 .*$i,nuv r4,r5,r6.*
561 .*$i,znv r4,r5,r6.*
562 .*$i,sv r4,r5,r6.*
563 .*$i,od r4,r5,r6.*
564 .*$i,tr r4,r5,r6.*
565 .*$i,<> r4,r5,r6.*
566 .*$i,>= r4,r5,r6.*
567 .*$i,> r4,r5,r6.*
568 .*$i,uv r4,r5,r6.*
569 .*$i,vnz r4,r5,r6.*
570 .*$i,nsv r4,r5,r6.*
571 .*$i,ev r4,r5,r6.*
572 .*$gdb_prompt $" { pass "$i tests" }
573 -re "$gdb_prompt $" { fail "$i tests" }
574 timeout { fail "(timeout) $i tests" }
575 }
576 }
577
578 set sub_insns [list {sub} {subo} {subb} {subbo} {subt} {subto} \
579 {ds} {comclr} ]
580
581 foreach i $sub_insns {
582 send_gdb "x/16i $i"; send_gdb "_tests\n"
583 gdb_expect {
584 -re "
585 .*$i r4,r5,r6.*
586 .*$i,= r4,r5,r6.*
587 .*$i,< r4,r5,r6.*
588 .*$i,<= r4,r5,r6.*
589 .*$i,<< r4,r5,r6.*
590 .*$i,<<= r4,r5,r6.*
591 .*$i,sv r4,r5,r6.*
592 .*$i,od r4,r5,r6.*
593 .*$i,tr r4,r5,r6.*
594 .*$i,<> r4,r5,r6.*
595 .*$i,>= r4,r5,r6.*
596 .*$i,> r4,r5,r6.*
597 .*$i,>>= r4,r5,r6.*
598 .*$i,>> r4,r5,r6.*
599 .*$i,nsv r4,r5,r6.*
600 .*$i,ev r4,r5,r6.*
601 .*$gdb_prompt $" { pass "$i tests" }
602 -re "$gdb_prompt $" { fail "$i tests" }
603 timeout { fail "(timeout) $i tests" }
604 }
605 }
606
607 set logical_insns [list {or} {xor} {and} {andcm} ]
608
609 foreach i $logical_insns {
610 send_gdb "x/10i $i"; send_gdb "_tests\n"
611 gdb_expect {
612 -re "
613 .*$i r4,r5,r6.*
614 .*$i,= r4,r5,r6.*
615 .*$i,< r4,r5,r6.*
616 .*$i,<= r4,r5,r6.*
617 .*$i,od r4,r5,r6.*
618 .*$i,tr r4,r5,r6.*
619 .*$i,<> r4,r5,r6.*
620 .*$i,>= r4,r5,r6.*
621 .*$i,> r4,r5,r6.*
622 .*$i,ev r4,r5,r6.*
623 .*$gdb_prompt $" { pass "$i tests" }
624 -re "$gdb_prompt $" { fail "$i tests" }
625 timeout { fail "(timeout) $i tests" }
626 }
627 }
628
629 set unit_insns1 [list {uxor} {uaddcm} {uaddcmt} ]
630
631 foreach i $unit_insns1 {
632 send_gdb "x/12i $i"; send_gdb "_tests\n"
633 gdb_expect {
634 -re "
635 .*$i r4,r5,r6.*
636 .*$i,sbz r4,r5,r6.*
637 .*$i,shz r4,r5,r6.*
638 .*$i,sdc r4,r5,r6.*
639 .*$i,sbc r4,r5,r6.*
640 .*$i,shc r4,r5,r6.*
641 .*$i,tr r4,r5,r6.*
642 .*$i,nbz r4,r5,r6.*
643 .*$i,nhz r4,r5,r6.*
644 .*$i,ndc r4,r5,r6.*
645 .*$i,nbc r4,r5,r6.*
646 .*$i,nhc r4,r5,r6.*
647 .*$gdb_prompt $" { pass "$i tests" }
648 -re "$gdb_prompt $" { fail "$i tests" }
649 timeout { fail "(timeout) $i tests" }
650 }
651 }
652
653 set unit_insns2 [list {dcor} {idcor} ]
654
655 foreach i $unit_insns2 {
656 send_gdb "x/12i $i"; send_gdb "_tests\n"
657 gdb_expect {
658 -re "
659 .*$i r4,r5.*
660 .*$i,sbz r4,r5.*
661 .*$i,shz r4,r5.*
662 .*$i,sdc r4,r5.*
663 .*$i,sbc r4,r5.*
664 .*$i,shc r4,r5.*
665 .*$i,tr r4,r5.*
666 .*$i,nbz r4,r5.*
667 .*$i,nhz r4,r5.*
668 .*$i,ndc r4,r5.*
669 .*$i,nbc r4,r5.*
670 .*$i,nhc r4,r5.*
671 .*$gdb_prompt $" { pass "$i tests" }
672 -re "$gdb_prompt $" { fail "$i tests" }
673 timeout { fail "(timeout) $i tests" }
674 }
675 }
676
677 set addi_insns [list {addi} {addio} {addit} {addito} ]
678
679 foreach i $addi_insns {
680 send_gdb "x/16i $i"; send_gdb "_tests\n"
681 gdb_expect {
682 -re "
683 .*$i 7b,r5,r6.*
684 .*$i,= 7b,r5,r6.*
685 .*$i,< 7b,r5,r6.*
686 .*$i,<= 7b,r5,r6.*
687 .*$i,nuv 7b,r5,r6.*
688 .*$i,znv 7b,r5,r6.*
689 .*$i,sv 7b,r5,r6.*
690 .*$i,od 7b,r5,r6.*
691 .*$i,tr 7b,r5,r6.*
692 .*$i,<> 7b,r5,r6.*
693 .*$i,>= 7b,r5,r6.*
694 .*$i,> 7b,r5,r6.*
695 .*$i,uv 7b,r5,r6.*
696 .*$i,vnz 7b,r5,r6.*
697 .*$i,nsv 7b,r5,r6.*
698 .*$i,ev 7b,r5,r6.*
699 .*$gdb_prompt $" { pass "$i tests" }
700 -re "$gdb_prompt $" { fail "$i tests" }
701 timeout { fail "(timeout) $i tests" }
702 }
703 }
704
705 set subi_insns [list {subi} {subio} {comiclr} ]
706
707 foreach i $subi_insns {
708 send_gdb "x/16i $i"; send_gdb "_tests\n"
709 gdb_expect {
710 -re "
711 .*$i 7b,r5,r6.*
712 .*$i,= 7b,r5,r6.*
713 .*$i,< 7b,r5,r6.*
714 .*$i,<= 7b,r5,r6.*
715 .*$i,<< 7b,r5,r6.*
716 .*$i,<<= 7b,r5,r6.*
717 .*$i,sv 7b,r5,r6.*
718 .*$i,od 7b,r5,r6.*
719 .*$i,tr 7b,r5,r6.*
720 .*$i,<> 7b,r5,r6.*
721 .*$i,>= 7b,r5,r6.*
722 .*$i,> 7b,r5,r6.*
723 .*$i,>>= 7b,r5,r6.*
724 .*$i,>> 7b,r5,r6.*
725 .*$i,nsv 7b,r5,r6.*
726 .*$i,ev 7b,r5,r6.*
727 .*$gdb_prompt $" { pass "$i tests" }
728 -re "$gdb_prompt $" { fail "$i tests" }
729 timeout { fail "(timeout) $i tests" }
730 }
731 }
732
733 send_gdb "x/8i vshd_tests\n"
734 gdb_expect {
735 -re "
736 .*vshd r4,r5,r6.*
737 .*vshd,= r4,r5,r6.*
738 .*vshd,< r4,r5,r6.*
739 .*vshd,od r4,r5,r6.*
740 .*vshd,tr r4,r5,r6.*
741 .*vshd,<> r4,r5,r6.*
742 .*vshd,>= r4,r5,r6.*
743 .*vshd,ev r4,r5,r6.*
744 .*$gdb_prompt $" { pass "vshd tests" }
745 -re "$gdb_prompt $" { fail "vshd tests" }
746 timeout { fail "(timeout) "vshd tests" }
747 }
748
749 send_gdb "x/8i shd_tests\n"
750 gdb_expect {
751 -re "
752 .*shd r4,r5,5,r6.*
753 .*shd,= r4,r5,5,r6.*
754 .*shd,< r4,r5,5,r6.*
755 .*shd,od r4,r5,5,r6.*
756 .*shd,tr r4,r5,5,r6.*
757 .*shd,<> r4,r5,5,r6.*
758 .*shd,>= r4,r5,5,r6.*
759 .*shd,ev r4,r5,5,r6.*
760 .*$gdb_prompt $" { pass "shd tests" }
761 -re "$gdb_prompt $" { fail "shd tests" }
762 timeout { fail "(timeout) "shd tests" }
763 }
764
765 set extract_insns1 [list {extru} {extrs} {zdep} {dep} ]
766
767 foreach i $extract_insns1 {
768 send_gdb "x/8i $i"; send_gdb "_tests\n"
769 gdb_expect {
770 -re "
771 .*$i r4,5,10,r6.*
772 .*$i,= r4,5,10,r6.*
773 .*$i,< r4,5,10,r6.*
774 .*$i,od r4,5,10,r6.*
775 .*$i,tr r4,5,10,r6.*
776 .*$i,<> r4,5,10,r6.*
777 .*$i,>= r4,5,10,r6.*
778 .*$i,ev r4,5,10,r6.*
779 .*$gdb_prompt $" { pass "$i tests" }
780 -re "$gdb_prompt $" { fail "$i tests" }
781 timeout { fail "(timeout) $i tests" }
782 }
783 }
784
785 set extract_insns2 [list {vextru} {vextrs} {zvdep} {vdep} ]
786
787 foreach i $extract_insns2 {
788 send_gdb "x/8i $i"; send_gdb "_tests\n"
789 gdb_expect {
790 -re "
791 .*$i r4,5,r6.*
792 .*$i,= r4,5,r6.*
793 .*$i,< r4,5,r6.*
794 .*$i,od r4,5,r6.*
795 .*$i,tr r4,5,r6.*
796 .*$i,<> r4,5,r6.*
797 .*$i,>= r4,5,r6.*
798 .*$i,ev r4,5,r6.*
799 .*$gdb_prompt $" { pass "$i tests" }
800 -re "$gdb_prompt $" { fail "$i tests" }
801 timeout { fail "(timeout) $i tests" }
802 }
803 }
804
805 set extract_insns3 [list {vdepi} {zvdepi} ]
806
807 foreach i $extract_insns3 {
808 send_gdb "x/8i $i"; send_gdb "_tests\n"
809 gdb_expect {
810 -re "
811 .*$i -1,5,r6.*
812 .*$i,= -1,5,r6.*
813 .*$i,< -1,5,r6.*
814 .*$i,od -1,5,r6.*
815 .*$i,tr -1,5,r6.*
816 .*$i,<> -1,5,r6.*
817 .*$i,>= -1,5,r6.*
818 .*$i,ev -1,5,r6.*
819 .*$gdb_prompt $" { pass "$i tests" }
820 -re "$gdb_prompt $" { fail "$i tests" }
821 timeout { fail "(timeout) $i tests" }
822 }
823 }
824
825 set extract_insns4 [list {depi} {zdepi} ]
826
827 foreach i $extract_insns4 {
828 send_gdb "x/8i $i"; send_gdb "_tests\n"
829 gdb_expect {
830 -re "
831 .*$i -1,4,10,r6.*
832 .*$i,= -1,4,10,r6.*
833 .*$i,< -1,4,10,r6.*
834 .*$i,od -1,4,10,r6.*
835 .*$i,tr -1,4,10,r6.*
836 .*$i,<> -1,4,10,r6.*
837 .*$i,>= -1,4,10,r6.*
838 .*$i,ev -1,4,10,r6.*
839 .*$gdb_prompt $" { pass "$i tests" }
840 -re "$gdb_prompt $" { fail "$i tests" }
841 timeout { fail "(timeout) $i tests" }
842 }
843 }
844 }
845
846 proc all_system_control_tests { } {
847 global gdb_prompt
848 global hex
849 global decimal
850
851 send_gdb "x/14i system_control_tests\n"
852 gdb_expect {
853 -re "
854 .*break 5,c.*
855 .*rfi.*
856 .*rfir.*
857 .*ssm 5,r4.*
858 .*rsm 5,r4.*
859 .*mtsm r4.*
860 .*ldsid \\(sr0,r5\\),r4.*
861 .*mtsp r4,sr0.*
862 .*mtctl r4,ccr.*
863 .*mfsp sr0,r4.*
864 .*mfctl ccr,r4.*
865 .*sync.*
866 .*syncdma.*
867 .*diag 4d2.*
868 .*$gdb_prompt $" { pass "system_constrol_tests" }
869 -re "$gdb_prompt $" { fail "system_control_tests" }
870 timeout { file "(timeout) system_control_tests" }
871 }
872
873 send_gdb "x/4i probe_tests\n"
874 gdb_expect {
875 -re "
876 .*prober \\(sr0,r5\\),r6,r7.*
877 .*proberi \\(sr0,r5\\),1,r7.*
878 .*probew \\(sr0,r5\\),r6,r7.*
879 .*probewi \\(sr0,r5\\),1,r7.*
880 .*$gdb_prompt $" { pass "probe_tests" }
881 -re "$gdb_prompt $" { fail "probe_tests" }
882 timeout { file "(timeout) probe_tests" }
883 }
884
885 # lci uses the same bit pattern as lha, so accept lha.
886 send_gdb "x/5i lpa_tests\n"
887 gdb_expect {
888 -re "
889 .*lpa r4\\(sr0,r5\\),r6.*
890 .*lpa,m r4\\(sr0,r5\\),r6.*
891 .*lha r4\\(sr0,r5\\),r6.*
892 .*lha,m r4\\(sr0,r5\\),r6.*
893 .*lha r4\\(sr0,r5\\),r6.*
894 .*$gdb_prompt $" { pass "lpa_tests" }
895 -re "$gdb_prompt $" { fail "lpa_tests" }
896 timeout { file "(timeout) lpa_tests" }
897 }
898
899 send_gdb "x/18i purge_tests\n"
900 gdb_expect {
901 -re "
902 .*pdtlb r4\\(sr0,r5\\).*
903 .*pdtlb,m r4\\(sr0,r5\\).*
904 .*pitlb r4\\(sr0,r5\\).*
905 .*pitlb,m r4\\(sr0,r5\\).*
906 .*pdtlbe r4\\(sr0,r5\\).*
907 .*pdtlbe,m r4\\(sr0,r5\\).*
908 .*pitlbe r4\\(sr0,r5\\).*
909 .*pitlbe,m r4\\(sr0,r5\\).*
910 .*pdc r4\\(sr0,r5\\).*
911 .*pdc,m r4\\(sr0,r5\\).*
912 .*fdc r4\\(sr0,r5\\).*
913 .*fdc,m r4\\(sr0,r5\\).*
914 .*fic r4\\(sr0,r5\\).*
915 .*fic,m r4\\(sr0,r5\\).*
916 .*fdce r4\\(sr0,r5\\).*
917 .*fdce,m r4\\(sr0,r5\\).*
918 .*fice r4\\(sr0,r5\\).*
919 .*fice,m r4\\(sr0,r5\\).*
920 .*$gdb_prompt $" { pass "purge_tests" }
921 -re "$gdb_prompt $" { fail "purge_tests" }
922 timeout { file "(timeout) purge_tests" }
923 }
924
925 send_gdb "x/4i insert_tests\n"
926 gdb_expect {
927 -re "
928 .*idtlba r4,\\(sr0,r5\\).*
929 .*iitlba r4,\\(sr0,r5\\).*
930 .*idtlbp r4,\\(sr0,r5\\).*
931 .*iitlbp r4,\\(sr0,r5\\).*
932 .*$gdb_prompt $" { pass "insert_tests" }
933 -re "$gdb_prompt $" { fail "insert_tests" }
934 timeout { file "(timeout) insert_tests" }
935 }
936
937 }
938
939 proc all_fpu_memory_tests { } {
940 global gdb_prompt
941 global hex
942 global decimal
943
944 send_gdb "x/20i fpu_memory_indexing_tests\n"
945 gdb_expect {
946 -re "
947 .*fldwx r4\\(sr0,r5\\),fr6.*
948 .*fldwx,s r4\\(sr0,r5\\),fr6.*
949 .*fldwx,m r4\\(sr0,r5\\),fr6.*
950 .*fldwx,sm r4\\(sr0,r5\\),fr6.*
951 .*flddx r4\\(sr0,r5\\),fr6.*
952 .*flddx,s r4\\(sr0,r5\\),fr6.*
953 .*flddx,m r4\\(sr0,r5\\),fr6.*
954 .*flddx,sm r4\\(sr0,r5\\),fr6.*
955 .*fstwx fr6,r4\\(sr0,r5\\).*
956 .*fstwx,s fr6,r4\\(sr0,r5\\).*
957 .*fstwx,m fr6,r4\\(sr0,r5\\).*
958 .*fstwx,sm fr6,r4\\(sr0,r5\\).*
959 .*fstdx fr6,r4\\(sr0,r5\\).*
960 .*fstdx,s fr6,r4\\(sr0,r5\\).*
961 .*fstdx,m fr6,r4\\(sr0,r5\\).*
962 .*fstdx,sm fr6,r4\\(sr0,r5\\).*
963 .*fstqx fr6,r4\\(sr0,r5\\).*
964 .*fstqx,s fr6,r4\\(sr0,r5\\).*
965 .*fstqx,m fr6,r4\\(sr0,r5\\).*
966 .*fstqx,sm fr6,r4\\(sr0,r5\\).*
967 .*$gdb_prompt $" { pass "fpu_memory_indexing_tests" }
968 -re "$gdb_prompt $" { fail "fpu_memory_indexing_tests" }
969 timeout { file "(timeout) fpu_memory_indexing_tests" }
970 }
971
972 send_gdb "x/15i fpu_short_memory_tests\n"
973 gdb_expect {
974 -re "
975 .*fldws 0\\(sr0,r5\\),fr6.*
976 .*fldws,mb 0\\(sr0,r5\\),fr6.*
977 .*fldws,ma 0\\(sr0,r5\\),fr6.*
978 .*fldds 0\\(sr0,r5\\),fr6.*
979 .*fldds,mb 0\\(sr0,r5\\),fr6.*
980 .*fldds,ma 0\\(sr0,r5\\),fr6.*
981 .*fstws fr6,0\\(sr0,r5\\).*
982 .*fstws,mb fr6,0\\(sr0,r5\\).*
983 .*fstws,ma fr6,0\\(sr0,r5\\).*
984 .*fstds fr6,0\\(sr0,r5\\).*
985 .*fstds,mb fr6,0\\(sr0,r5\\).*
986 .*fstds,ma fr6,0\\(sr0,r5\\).*
987 .*fstqs fr6,0\\(sr0,r5\\).*
988 .*fstqs,mb fr6,0\\(sr0,r5\\).*
989 .*fstqs,ma fr6,0\\(sr0,r5\\).*
990 .*$gdb_prompt $" { pass "fpu_short_memory_tests" }
991 -re "$gdb_prompt $" { fail "fpu_short_memory_tests" }
992 timeout { file "(timeout) fpu_short_memory_tests" }
993 }
994
995 }
996
997 proc all_fpu_computational_tests { } {
998 global gdb_prompt
999 global hex
1000 global decimal
1001
1002 send_gdb "x/1i fpu_misc_tests\n"
1003 gdb_expect {
1004 -re "
1005 .*ftest.*
1006 .*$gdb_prompt $" { pass "fpu_misc_tests" }
1007 -re "$gdb_prompt $" { fail "fpu_misc_tests" }
1008 timeout { file "(timeout) fpu_misc_tests" }
1009 }
1010
1011 set fpu_two_op_insns [list {fcpy} {fabs} {fsqrt} {frnd} ]
1012
1013 foreach i $fpu_two_op_insns {
1014 send_gdb "x/5i $i"; send_gdb "_tests\n"
1015 gdb_expect {
1016 -re "
1017 .*$i,sgl fr5,fr10.*
1018 .*$i,dbl fr5,fr10.*
1019 .*$i,quad fr5,fr10.*
1020 .*$i,sgl fr20,fr24.*
1021 .*$i,dbl fr20,fr24.*
1022 .*$gdb_prompt $" { pass "$i tests" }
1023 -re "$gdb_prompt $" { fail "$i tests" }
1024 timeout { fail "(timeout) $i tests" }
1025 }
1026 }
1027
1028 set fpu_conversions [list {fcnvff} {fcnvxf} {fcnvfx} {fcnvfxt} ]
1029
1030 foreach i $fpu_conversions {
1031 send_gdb "x/18i $i"; send_gdb "_tests\n"
1032 gdb_expect {
1033 -re "
1034 .*$i,sgl,sgl fr5,fr10.*
1035 .*$i,sgl,dbl fr5,fr10.*
1036 .*$i,sgl,quad fr5,fr10.*
1037 .*$i,dbl,sgl fr5,fr10.*
1038 .*$i,dbl,dbl fr5,fr10.*
1039 .*$i,dbl,quad fr5,fr10.*
1040 .*$i,quad,sgl fr5,fr10.*
1041 .*$i,quad,dbl fr5,fr10.*
1042 .*$i,quad,quad fr5,fr10.*
1043 .*$i,sgl,sgl fr20,fr24.*
1044 .*$i,sgl,dbl fr20,fr24.*
1045 .*$i,sgl,quad fr20,fr24.*
1046 .*$i,dbl,sgl fr20,fr24.*
1047 .*$i,dbl,dbl fr20,fr24.*
1048 .*$i,dbl,quad fr20,fr24.*
1049 .*$i,quad,sgl fr20,fr24.*
1050 .*$i,quad,dbl fr20,fr24.*
1051 .*$i,quad,quad fr20,fr24.*
1052 .*$gdb_prompt $" { pass "$i tests" }
1053 -re "$gdb_prompt $" { fail "$i tests" }
1054 timeout { fail "(timeout) $i tests" }
1055 }
1056 }
1057
1058 set fpu_three_op_insns [list {fadd} {fsub} {fmpy} {fdiv} {frem} ]
1059
1060 foreach i $fpu_three_op_insns {
1061 send_gdb "x/6i $i"; send_gdb "_tests\n"
1062 gdb_expect {
1063 -re "
1064 .*$i,sgl fr4,fr8,fr12.*
1065 .*$i,dbl fr4,fr8,fr12.*
1066 .*$i,quad fr4,fr8,fr12.*
1067 .*$i,sgl fr20,fr24,fr28.*
1068 .*$i,dbl fr20,fr24,fr28.*
1069 .*$i,quad fr20,fr24,fr28.*
1070 .*$gdb_prompt $" { pass "$i tests" }
1071 -re "$gdb_prompt $" { fail "$i tests" }
1072 timeout { fail "(timeout) $i tests" }
1073 }
1074 }
1075
1076 send_gdb "x/4i fmpy_addsub_tests\n"
1077 gdb_expect {
1078 -re "
1079 .*fmpyadd,sgl fr16,fr17,fr18,fr19,fr20.*
1080 .*fmpyadd,dbl fr16,fr17,fr18,fr19,fr20.*
1081 .*fmpysub,sgl fr16,fr17,fr18,fr19,fr20.*
1082 .*fmpysub,dbl fr16,fr17,fr18,fr19,fr20.*
1083 .*$gdb_prompt $" { pass "fmpy_addsub_tests" }
1084 -re "$gdb_prompt $" { fail "fmpy_addsub_tests" }
1085 timeout { fail "(timeout) fmpy_addsub_tests" }
1086 }
1087
1088 send_gdb "x/i xmpyu_tests\n"
1089 gdb_expect {
1090 -re "
1091 .*xmpyu fr4,fr5,fr6.*
1092 .*$gdb_prompt $" {pass "xmpyu_tests" }
1093 -re "$gdb_prompt $" {fail "xmpyu_tests" }
1094 timeout { fail "(timeout) xmpyu_tests" }
1095 }
1096
1097 }
1098
1099 proc all_fpu_comparison_tests { } {
1100 global gdb_prompt
1101 global hex
1102 global decimal
1103
1104 set fpu_comparison_formats [list {sgl} {dbl} {quad} ]
1105
1106 foreach i $fpu_comparison_formats {
1107 send_gdb "x/8i fcmp_$i"; send_gdb "_tests_1\n"
1108 gdb_expect {
1109 -re "
1110 .*fcmp,$i,false\\? fr4,fr5.*
1111 .*fcmp,$i,false fr4,fr5.*
1112 .*fcmp,$i,\\? fr4,fr5.*
1113 .*fcmp,$i,!<=> fr4,fr5.*
1114 .*fcmp,$i,= fr4,fr5.*
1115 .*fcmp,$i,=t fr4,fr5.*
1116 .*fcmp,$i,\\?= fr4,fr5.*
1117 .*fcmp,$i,!<> fr4,fr5.*
1118 .*$gdb_prompt $" { pass "$i tests (part1) " }
1119 -re "$gdb_prompt $" { fail "fcmp_$i tests (part1) " }
1120 timeout { fail "(timeout) fcmp_$i tests (part1) " }
1121 }
1122
1123 send_gdb "x/8i fcmp_$i"; send_gdb "_tests_2\n"
1124 gdb_expect {
1125 -re "
1126 .*fcmp,$i,!\\?>= fr4,fr5.*
1127 .*fcmp,$i,< fr4,fr5.*
1128 .*fcmp,$i,\\?< fr4,fr5.*
1129 .*fcmp,$i,!>= fr4,fr5.*
1130 .*fcmp,$i,!\\?> fr4,fr5.*
1131 .*fcmp,$i,<= fr4,fr5.*
1132 .*fcmp,$i,\\?<= fr4,fr5.*
1133 .*fcmp,$i,!> fr4,fr5.*
1134 .*$gdb_prompt $" { pass "$i tests (part2) " }
1135 -re "$gdb_prompt $" { fail "fcmp_$i tests (part2) " }
1136 timeout { fail "(timeout) fcmp_$i tests (part2) " }
1137 }
1138
1139 send_gdb "x/8i fcmp_$i"; send_gdb "_tests_3\n"
1140 gdb_expect {
1141 -re "
1142 .*fcmp,$i,!\\?<= fr4,fr5.*
1143 .*fcmp,$i,> fr4,fr5.*
1144 .*fcmp,$i,\\?> fr4,fr5.*
1145 .*fcmp,$i,!<= fr4,fr5.*
1146 .*fcmp,$i,!\\?< fr4,fr5.*
1147 .*fcmp,$i,>= fr4,fr5.*
1148 .*fcmp,$i,\\?>= fr4,fr5.*
1149 .*fcmp,$i,!< fr4,fr5.*
1150 .*$gdb_prompt $" { pass "$i tests (part3) " }
1151 -re "$gdb_prompt $" { fail "fcmp_$i tests (part3) " }
1152 timeout { fail "(timeout) fcmp_$i tests (part3) " }
1153 }
1154
1155 send_gdb "x/8i fcmp_$i"; send_gdb "_tests_4\n"
1156 gdb_expect {
1157 -re "
1158 .*fcmp,$i,!\\?= fr4,fr5.*
1159 .*fcmp,$i,<> fr4,fr5.*
1160 .*fcmp,$i,!= fr4,fr5.*
1161 .*fcmp,$i,!=t fr4,fr5.*
1162 .*fcmp,$i,!\\? fr4,fr5.*
1163 .*fcmp,$i,<=> fr4,fr5.*
1164 .*fcmp,$i,true\\? fr4,fr5.*
1165 .*fcmp,$i,true fr4,fr5.*
1166 .*$gdb_prompt $" { pass "$i tests (part4) " }
1167 -re "$gdb_prompt $" { fail "fcmp_$i tests (part4) " }
1168 timeout { fail "(timeout) fcmp_$i tests (part4) " }
1169 }
1170 }
1171 }
1172
1173 proc all_special_tests { } {
1174 global gdb_prompt
1175 global hex
1176 global decimal
1177
1178 send_gdb "x/4i special_tests\n"
1179 gdb_expect {
1180 -re "
1181 .*gfw r4\\(sr0,r5\\).*
1182 .*gfw,m r4\\(sr0,r5\\).*
1183 .*gfr r4\\(sr0,r5\\).*
1184 .*gfr,m r4\\(sr0,r5\\).*
1185 .*$gdb_prompt $" { pass "special tests" }
1186 -re "$gdb_prompt $" { fail "special tests" }
1187 timeout { fail "(timeout) special tests " }
1188 }
1189
1190 }
1191
1192 proc all_sfu_tests { } {
1193 global gdb_prompt
1194 global hex
1195 global decimal
1196
1197 send_gdb "x/16i sfu_tests\n"
1198 gdb_expect {
1199 -re "
1200 .*spop0,4,5.*
1201 .*spop0,4,73.*
1202 .*spop0,4,5,n.*
1203 .*spop0,4,73,n.*
1204 .*spop1,4,5 r5.*
1205 .*spop1,4,73 r5.*
1206 .*spop1,4,5,n r5.*
1207 .*spop1,4,73,n r5.*
1208 .*spop2,4,5 r5.*
1209 .*spop2,4,73 r5.*
1210 .*spop2,4,5,n r5.*
1211 .*spop2,4,73,n r5.*
1212 .*spop3,4,5 r5,r6.*
1213 .*spop3,4,73 r5,r6.*
1214 .*spop3,4,5,n r5,r6.*
1215 .*spop3,4,73,n r5,r6.*
1216 .*$gdb_prompt $" { pass "sfu tests" }
1217 -re "$gdb_prompt $" { fail "sfu tests" }
1218 timeout { fail "(timeout) sfu tests " }
1219 }
1220 }
1221
1222 proc all_copr_tests { } {
1223 global gdb_prompt
1224 global hex
1225 global decimal
1226
1227 send_gdb "x/4i copr_tests\n"
1228 gdb_expect {
1229 -re "
1230 .*copr,4,5.*
1231 .*copr,4,73.*
1232 .*copr,4,5,n.*
1233 .*copr,4,73,n.*
1234 .*$gdb_prompt $" { pass "copr tests" }
1235 -re "$gdb_prompt $" { fail "copr tests" }
1236 timeout { fail "(timeout) copr tests " }
1237 }
1238 }
1239
1240 proc all_copr_mem_tests { } {
1241 global gdb_prompt
1242 global hex
1243 global decimal
1244
1245 send_gdb "x/8i copr_indexing_load\n"
1246 gdb_expect {
1247 -re "
1248 .*cldwx,4 r5\\(sr0,r4\\),r26.*
1249 .*cldwx,4,s r5\\(sr0,r4\\),r26.*
1250 .*cldwx,4,m r5\\(sr0,r4\\),r26.*
1251 .*cldwx,4,sm r5\\(sr0,r4\\),r26.*
1252 .*clddx,4 r5\\(sr0,r4\\),r26.*
1253 .*clddx,4,s r5\\(sr0,r4\\),r26.*
1254 .*clddx,4,m r5\\(sr0,r4\\),r26.*
1255 .*clddx,4,sm r5\\(sr0,r4\\),r26.*
1256 .*$gdb_prompt $" { pass "copr indexed load tests" }
1257 -re "$gdb_prompt $" { fail "copr indexed load tests" }
1258 timeout { fail "(timeout) copr indexed load tests " }
1259 }
1260
1261 send_gdb "x/8i copr_indexing_store\n"
1262 gdb_expect {
1263 -re "
1264 .*cstwx,4 r26,r5\\(sr0,r4\\).*
1265 .*cstwx,4,s r26,r5\\(sr0,r4\\).*
1266 .*cstwx,4,m r26,r5\\(sr0,r4\\).*
1267 .*cstwx,4,sm r26,r5\\(sr0,r4\\).*
1268 .*cstdx,4 r26,r5\\(sr0,r4\\).*
1269 .*cstdx,4,s r26,r5\\(sr0,r4\\).*
1270 .*cstdx,4,m r26,r5\\(sr0,r4\\).*
1271 .*cstdx,4,sm r26,r5\\(sr0,r4\\).*
1272 .*$gdb_prompt $" { pass "copr indexed store tests" }
1273 -re "$gdb_prompt $" { fail "copr indexed store tests" }
1274 timeout { fail "(timeout) copr indexed load tests " }
1275 }
1276
1277 send_gdb "x/12i copr_short_memory\n"
1278 gdb_expect {
1279 -re "
1280 .*cldws,4 0\\(sr0,r4\\),r26.*
1281 .*cldws,4,mb 0\\(sr0,r4\\),r26.*
1282 .*cldws,4,ma 0\\(sr0,r4\\),r26.*
1283 .*cldds,4 0\\(sr0,r4\\),r26.*
1284 .*cldds,4,mb 0\\(sr0,r4\\),r26.*
1285 .*cldds,4,ma 0\\(sr0,r4\\),r26.*
1286 .*cstws,4 r26,0\\(sr0,r4\\).*
1287 .*cstws,4,mb r26,0\\(sr0,r4\\).*
1288 .*cstws,4,ma r26,0\\(sr0,r4\\).*
1289 .*cstds,4 r26,0\\(sr0,r4\\).*
1290 .*cstds,4,mb r26,0\\(sr0,r4\\).*
1291 .*cstds,4,ma r26,0\\(sr0,r4\\).*
1292 .*$gdb_prompt $" { pass "copr short memory tests" }
1293 -re "$gdb_prompt $" { fail "copr short memory tests" }
1294 timeout { fail "(timeout) copr short memory tests " }
1295 }
1296 }
1297
1298 proc fmemLRbug_tests { } {
1299 global gdb_prompt
1300 global hex
1301 global decimal
1302
1303 send_gdb "x/12i fmemLRbug_tests_1\n"
1304 gdb_expect {
1305 -re "
1306 .*fstws fr6R,0\\(sr0,r26\\).*
1307 .*fstws fr6,4\\(sr0,r26\\).*
1308 .*fstws fr6,8\\(sr0,r26\\).*
1309 .*fstds fr6,0\\(sr0,r26\\).*
1310 .*fstds fr6,4\\(sr0,r26\\).*
1311 .*fstds fr6,8\\(sr0,r26\\).*
1312 .*fldws 0\\(sr0,r26\\),fr6R.*
1313 .*fldws 4\\(sr0,r26\\),fr6.*
1314 .*fldws 8\\(sr0,r26\\),fr6.*
1315 .*fldds 0\\(sr0,r26\\),fr6.*
1316 .*fldds 4\\(sr0,r26\\),fr6.*
1317 .*fldds 8\\(sr0,r26\\),fr6.*
1318 .*$gdb_prompt $" { pass "fmem LR register selector tests (part1)" }
1319 -re "$gdb_prompt $" { fail "fmem LR register selector tests (part1)" }
1320 timeout { fail "(timeout) fmem LR register selector tests (part1)" }
1321 }
1322
1323 send_gdb "x/12i fmemLRbug_tests_2\n"
1324 gdb_expect {
1325 -re "
1326 .*fstws fr6R,0\\(sr0,r26\\).*
1327 .*fstws fr6,4\\(sr0,r26\\).*
1328 .*fstws fr6,8\\(sr0,r26\\).*
1329 .*fstds fr6,0\\(sr0,r26\\).*
1330 .*fstds fr6,4\\(sr0,r26\\).*
1331 .*fstds fr6,8\\(sr0,r26\\).*
1332 .*fldws 0\\(sr0,r26\\),fr6R.*
1333 .*fldws 4\\(sr0,r26\\),fr6.*
1334 .*fldws 8\\(sr0,r26\\),fr6.*
1335 .*fldds 0\\(sr0,r26\\),fr6.*
1336 .*fldds 4\\(sr0,r26\\),fr6.*
1337 .*fldds 8\\(sr0,r26\\),fr6.*
1338 .*$gdb_prompt $" { pass "fmem LR register selector tests (part2)" }
1339 -re "$gdb_prompt $" { fail "fmem LR register selector tests (part2)" }
1340 timeout { fail "(timeout) fmem LR register selector tests (part2)" }
1341 }
1342
1343 send_gdb "x/12i fmemLRbug_tests_3\n"
1344 gdb_expect {
1345 -re "
1346 .*fstwx fr6R,r25\\(sr0,r26\\).*
1347 .*fstwx fr6,r25\\(sr0,r26\\).*
1348 .*fstwx fr6,r25\\(sr0,r26\\).*
1349 .*fstdx fr6,r25\\(sr0,r26\\).*
1350 .*fstdx fr6,r25\\(sr0,r26\\).*
1351 .*fstdx fr6,r25\\(sr0,r26\\).*
1352 .*fldwx r25\\(sr0,r26\\),fr6R.*
1353 .*fldwx r25\\(sr0,r26\\),fr6.*
1354 .*fldwx r25\\(sr0,r26\\),fr6.*
1355 .*flddx r25\\(sr0,r26\\),fr6.*
1356 .*flddx r25\\(sr0,r26\\),fr6.*
1357 .*flddx r25\\(sr0,r26\\),fr6.*
1358 .*$gdb_prompt $" { pass "fmem LR register selector tests (part3)" }
1359 -re "$gdb_prompt $" { fail "fmem LR register selector tests (part3)" }
1360 timeout { fail "(timeout) fmem LR register selector tests (part3)" }
1361 }
1362
1363 send_gdb "x/12i fmemLRbug_tests_4\n"
1364 gdb_expect {
1365 -re "
1366 .*fstwx fr6R,r25\\(sr0,r26\\).*
1367 .*fstwx fr6,r25\\(sr0,r26\\).*
1368 .*fstwx fr6,r25\\(sr0,r26\\).*
1369 .*fstdx fr6,r25\\(sr0,r26\\).*
1370 .*fstdx fr6,r25\\(sr0,r26\\).*
1371 .*fstdx fr6,r25\\(sr0,r26\\).*
1372 .*fldwx r25\\(sr0,r26\\),fr6R.*
1373 .*fldwx r25\\(sr0,r26\\),fr6.*
1374 .*fldwx r25\\(sr0,r26\\),fr6.*
1375 .*flddx r25\\(sr0,r26\\),fr6.*
1376 .*flddx r25\\(sr0,r26\\),fr6.*
1377 .*flddx r25\\(sr0,r26\\),fr6.*
1378 .*$gdb_prompt $" { pass "fmem LR register selector tests (part4)" }
1379 -re "$gdb_prompt $" { fail "fmem LR register selector tests (part4)" }
1380 timeout { fail "(timeout) fmem LR register selector tests (part4)" }
1381 }
1382 }
1383
1384 # Start with a fresh gdb.
1385
1386 gdb_exit
1387 gdb_start
1388 gdb_reinitialize_dir $srcdir/$subdir
1389 gdb_load $binfile
1390
1391 all_integer_memory_tests
1392 all_immediate_tests
1393 all_branch_tests
1394 all_integer_computational_tests
1395 all_system_control_tests
1396 all_fpu_memory_tests
1397 all_fpu_computational_tests
1398 all_fpu_comparison_tests
1399 all_special_tests
1400 all_sfu_tests
1401 all_copr_tests
1402 all_copr_mem_tests
1403
1404 # Regression test for a bug Tege found.
1405 fmemLRbug_tests