OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-stable/] [gdb-7.2/] [gdb/] [testsuite/] [gdb.disasm/] [hppa.exp] - Blame information for rev 861

Go to most recent revision | Details | Compare with Previous | View Log

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

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.