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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gdb-6.8/] [gdb/] [testsuite/] [gdb.disasm/] [hppa.exp] - Blame information for rev 157

Details | Compare with Previous | View Log

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

powered by: WebSVN 2.1.0

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