OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [gnu-src/] [gdb-6.8/] [sim/] [testsuite/] [sim/] [frv/] [csmulcc.cgs] - Blame information for rev 157

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 24 jeremybenn
# frv testcase for csmulcc $GRi,$GRj,$GRk,$CCi,$cond
2
# mach: all
3
 
4
        .include "testutils.inc"
5
 
6
        start
7
 
8
        .global csmulcc
9
csmulcc:
10
        set_spr_immed   0x1b1b,cccr
11
 
12
        ; Positive operands
13
        set_gr_immed    3,gr7           ; multiply small numbers
14
        set_gr_immed    2,gr8
15
        set_icc         0xc,0
16
        csmulcc         gr7,gr8,gr8,cc0,1
17
        test_icc        0 0 0 0 icc0
18
        test_gr_immed   0,gr8
19
        test_gr_immed   6,gr9
20
 
21
        set_gr_immed    1,gr7           ; multiply by 1
22
        set_gr_immed    2,gr8
23
        set_icc         0xd,0
24
        csmulcc         gr7,gr8,gr8,cc0,1
25
        test_icc        0 0 0 1 icc0
26
        test_gr_immed   0,gr8
27
        test_gr_immed   2,gr9
28
 
29
        set_gr_immed    2,gr7           ; multiply by 1
30
        set_gr_immed    1,gr8
31
        set_icc         0xe,0
32
        csmulcc         gr7,gr8,gr8,cc4,1
33
        test_icc        0 0 1 0 icc0
34
        test_gr_immed   0,gr8
35
        test_gr_immed   2,gr9
36
 
37
        set_gr_immed    0,gr7           ; multiply by 0
38
        set_gr_immed    2,gr8
39
        set_icc         0xb,0
40
        csmulcc         gr7,gr8,gr8,cc4,1
41
        test_icc        0 1 1 1 icc0
42
        test_gr_immed   0,gr8
43
        test_gr_immed   0,gr9
44
 
45
        set_gr_immed    2,gr7           ; multiply by 0
46
        set_gr_immed    0,gr8
47
        set_icc         0x8,0
48
        csmulcc         gr7,gr8,gr8,cc0,1
49
        test_icc        0 1 0 0 icc0
50
        test_gr_immed   0,gr8
51
        test_gr_immed   0,gr9
52
 
53
        set_gr_limmed   0x3fff,0xffff,gr7       ; 31 bit result
54
        set_gr_immed    2,gr8
55
        set_icc         0xd,0
56
        csmulcc         gr7,gr8,gr8,cc0,1
57
        test_icc        0 0 0 1 icc0
58
        test_gr_immed   0,gr8
59
        test_gr_limmed  0x7fff,0xfffe,gr9
60
 
61
        set_gr_limmed   0x4000,0x0000,gr7       ; 32 bit result
62
        set_gr_immed    2,gr8
63
        set_icc         0xe,0
64
        csmulcc         gr7,gr8,gr8,cc4,1
65
        test_icc        0 0 1 0 icc0
66
        test_gr_immed   0,gr8
67
        test_gr_limmed  0x8000,0x0000,gr9
68
 
69
        set_gr_limmed   0x4000,0x0000,gr7       ; 33 bit result
70
        set_gr_immed    4,gr8
71
        set_icc         0xf,0
72
        csmulcc         gr7,gr8,gr8,cc4,1
73
        test_icc        0 0 1 1 icc0
74
        test_gr_immed   1,gr8
75
        test_gr_limmed  0x0000,0x0000,gr9
76
 
77
        set_gr_limmed   0x7fff,0xffff,gr7       ; max positive result
78
        set_gr_limmed   0x7fff,0xffff,gr8
79
        set_icc         0xc,0
80
        csmulcc         gr7,gr8,gr8,cc0,1
81
        test_icc        0 0 0 0 icc0
82
        test_gr_limmed  0x3fff,0xffff,gr8
83
        test_gr_immed   0x00000001,gr9
84
 
85
        ; Mixed operands
86
        set_gr_immed    -3,gr7          ; multiply small numbers
87
        set_gr_immed    2,gr8
88
        set_icc         0x5,0
89
        csmulcc         gr7,gr8,gr8,cc0,1
90
        test_icc        1 0 0 1 icc0
91
        test_gr_immed   -1,gr8
92
        test_gr_immed   -6,gr9
93
 
94
        set_gr_immed    3,gr7           ; multiply small numbers
95
        set_gr_immed    -2,gr8
96
        set_icc         0x6,0
97
        csmulcc         gr7,gr8,gr8,cc4,1
98
        test_icc        1 0 1 0 icc0
99
        test_gr_immed   -1,gr8
100
        test_gr_immed   -6,gr9
101
 
102
        set_gr_immed    1,gr7           ; multiply by 1
103
        set_gr_immed    -2,gr8
104
        set_icc         0x7,0
105
        csmulcc         gr7,gr8,gr8,cc4,1
106
        test_icc        1 0 1 1 icc0
107
        test_gr_immed   -1,gr8
108
        test_gr_immed   -2,gr9
109
 
110
        set_gr_immed    -2,gr7          ; multiply by 1
111
        set_gr_immed    1,gr8
112
        set_icc         0x4,0
113
        csmulcc         gr7,gr8,gr8,cc0,1
114
        test_icc        1 0 0 0 icc0
115
        test_gr_immed   -1,gr8
116
        test_gr_immed   -2,gr9
117
 
118
        set_gr_immed    0,gr7           ; multiply by 0
119
        set_gr_immed    -2,gr8
120
        set_icc         0x9,0
121
        csmulcc         gr7,gr8,gr8,cc0,1
122
        test_icc        0 1 0 1 icc0
123
        test_gr_immed   0,gr8
124
        test_gr_immed   0,gr9
125
 
126
        set_gr_immed    -2,gr7          ; multiply by 0
127
        set_gr_immed    0,gr8
128
        set_icc         0xa,0
129
        csmulcc         gr7,gr8,gr8,cc4,1
130
        test_icc        0 1 1 0 icc0
131
        test_gr_immed   0,gr8
132
        test_gr_immed   0,gr9
133
 
134
        set_gr_limmed   0x2000,0x0001,gr7       ; 31 bit result
135
        set_gr_immed    -2,gr8
136
        set_icc         0x7,0
137
        csmulcc         gr7,gr8,gr8,cc4,1
138
        test_icc        1 0 1 1 icc0
139
        test_gr_limmed  0xffff,0xffff,gr8
140
        test_gr_limmed  0xbfff,0xfffe,gr9
141
 
142
        set_gr_limmed   0x4000,0x0000,gr7       ; 32 bit result
143
        set_gr_immed    -2,gr8
144
        set_icc         0x4,0
145
        csmulcc         gr7,gr8,gr8,cc0,1
146
        test_icc        1 0 0 0 icc0
147
        test_gr_limmed  0xffff,0xffff,gr8
148
        test_gr_limmed  0x8000,0x0000,gr9
149
 
150
        set_gr_limmed   0x4000,0x0001,gr7       ; 32 bit result
151
        set_gr_immed    -2,gr8
152
        set_icc         0x5,0
153
        csmulcc         gr7,gr8,gr8,cc0,1
154
        test_icc        1 0 0 1 icc0
155
        test_gr_limmed  0xffff,0xffff,gr8
156
        test_gr_limmed  0x7fff,0xfffe,gr9
157
 
158
        set_gr_limmed   0x4000,0x0000,gr7       ; 33 bit result
159
        set_gr_immed    -4,gr8
160
        set_icc         0x6,0
161
        csmulcc         gr7,gr8,gr8,cc4,1
162
        test_icc        1 0 1 0 icc0
163
        test_gr_limmed  0xffff,0xffff,gr8
164
        test_gr_limmed  0x0000,0x0000,gr9
165
 
166
        set_gr_limmed   0x7fff,0xffff,gr7       ; max negative result
167
        set_gr_limmed   0x8000,0x0000,gr8
168
        set_icc         0x7,0
169
        csmulcc         gr7,gr8,gr8,cc4,1
170
        test_icc        1 0 1 1 icc0
171
        test_gr_limmed  0xc000,0x0000,gr8
172
        test_gr_limmed  0x8000,0x0000,gr9
173
 
174
        ; Negative operands
175
        set_gr_immed    -3,gr7          ; multiply small numbers
176
        set_gr_immed    -2,gr8
177
        set_icc         0xc,0
178
        csmulcc         gr7,gr8,gr8,cc0,1
179
        test_icc        0 0 0 0 icc0
180
        test_gr_immed   0,gr8
181
        test_gr_immed   6,gr9
182
 
183
        set_gr_immed    -1,gr7          ; multiply by 1
184
        set_gr_immed    -2,gr8
185
        set_icc         0xd,0
186
        csmulcc         gr7,gr8,gr8,cc0,1
187
        test_icc        0 0 0 1 icc0
188
        test_gr_immed   0,gr8
189
        test_gr_immed   2,gr9
190
 
191
        set_gr_immed    -2,gr7          ; multiply by 1
192
        set_gr_immed    -1,gr8
193
        set_icc         0xe,0
194
        csmulcc         gr7,gr8,gr8,cc4,1
195
        test_icc        0 0 1 0 icc0
196
        test_gr_immed   0,gr8
197
        test_gr_immed   2,gr9
198
 
199
        set_gr_limmed   0xc000,0x0001,gr7       ; 31 bit result
200
        set_gr_immed    -2,gr8
201
        set_icc         0xf,0
202
        csmulcc         gr7,gr8,gr8,cc4,1
203
        test_icc        0 0 1 1 icc0
204
        test_gr_immed   0,gr8
205
        test_gr_limmed  0x7fff,0xfffe,gr9
206
 
207
        set_gr_limmed   0xc000,0x0000,gr7       ; 32 bit result
208
        set_gr_immed    -2,gr8
209
        set_icc         0xc,0
210
        csmulcc         gr7,gr8,gr8,cc0,1
211
        test_icc        0 0 0 0 icc0
212
        test_gr_immed   0,gr8
213
        test_gr_limmed  0x8000,0x0000,gr9
214
 
215
        set_gr_limmed   0xc000,0x0000,gr7       ; 33 bit result
216
        set_gr_immed    -4,gr8
217
        set_icc         0xd,0
218
        csmulcc         gr7,gr8,gr8,cc0,1
219
        test_icc        0 0 0 1 icc0
220
        test_gr_immed   1,gr8
221
        test_gr_immed   0x00000000,gr9
222
 
223
        set_gr_limmed   0x8000,0x0001,gr7       ; almost max positive result
224
        set_gr_limmed   0x8000,0x0001,gr8
225
        set_icc         0xe,0
226
        csmulcc         gr7,gr8,gr8,cc4,1
227
        test_icc        0 0 1 0 icc0
228
        test_gr_limmed  0x3fff,0xffff,gr8
229
        test_gr_immed   0x00000001,gr9
230
 
231
 
232
        set_gr_limmed   0x8000,0x0000,gr7       ; max positive result
233
        set_gr_limmed   0x8000,0x0000,gr8
234
        set_icc         0xf,0
235
        csmulcc         gr7,gr8,gr8,cc4,1
236
        test_icc        0 0 1 1 icc0
237
        test_gr_limmed  0x4000,0x0000,gr8
238
        test_gr_immed   0x00000000,gr9
239
 
240
        ; Positive operands
241
        set_gr_immed    3,gr7           ; multiply small numbers
242
        set_gr_immed    2,gr8
243
        set_icc         0x0,0
244
        csmulcc         gr7,gr8,gr8,cc0,0
245
        test_icc        0 0 0 0 icc0
246
        test_gr_immed   2,gr8
247
        test_gr_immed   0,gr9
248
 
249
        set_gr_immed    1,gr7           ; multiply by 1
250
        set_gr_immed    2,gr8
251
        set_icc         0x1,0
252
        csmulcc         gr7,gr8,gr8,cc0,0
253
        test_icc        0 0 0 1 icc0
254
        test_gr_immed   2,gr8
255
        test_gr_immed   0,gr9
256
 
257
        set_gr_immed    2,gr7           ; multiply by 1
258
        set_gr_immed    1,gr8
259
        set_icc         0x2,0
260
        csmulcc         gr7,gr8,gr8,cc4,0
261
        test_icc        0 0 1 0 icc0
262
        test_gr_immed   1,gr8
263
        test_gr_immed   0,gr9
264
 
265
        set_gr_immed    0,gr7           ; multiply by 0
266
        set_gr_immed    2,gr8
267
        set_icc         0x3,0
268
        csmulcc         gr7,gr8,gr8,cc4,0
269
        test_icc        0 0 1 1 icc0
270
        test_gr_immed   2,gr8
271
        test_gr_immed   0,gr9
272
 
273
        set_gr_immed    2,gr7           ; multiply by 0
274
        set_gr_immed    0,gr8
275
        set_icc         0x4,0
276
        csmulcc         gr7,gr8,gr8,cc0,0
277
        test_icc        0 1 0 0 icc0
278
        test_gr_immed   0,gr8
279
        test_gr_immed   0,gr9
280
 
281
        set_gr_limmed   0x3fff,0xffff,gr7       ; 31 bit result
282
        set_gr_immed    2,gr8
283
        set_icc         0x5,0
284
        csmulcc         gr7,gr8,gr8,cc0,0
285
        test_icc        0 1 0 1 icc0
286
        test_gr_immed   2,gr8
287
        test_gr_immed   0,gr9
288
 
289
        set_gr_limmed   0x4000,0x0000,gr7       ; 32 bit result
290
        set_gr_immed    2,gr8
291
        set_icc         0x6,0
292
        csmulcc         gr7,gr8,gr8,cc4,0
293
        test_icc        0 1 1 0 icc0
294
        test_gr_immed   2,gr8
295
        test_gr_immed   0,gr9
296
 
297
        set_gr_limmed   0x4000,0x0000,gr7       ; 33 bit result
298
        set_gr_immed    4,gr8
299
        set_icc         0x7,0
300
        csmulcc         gr7,gr8,gr8,cc4,0
301
        test_icc        0 1 1 1 icc0
302
        test_gr_immed   4,gr8
303
        test_gr_immed   0,gr9
304
 
305
        set_gr_limmed   0x7fff,0xffff,gr7       ; max positive result
306
        set_gr_limmed   0x7fff,0xffff,gr8
307
        set_icc         0x8,0
308
        csmulcc         gr7,gr8,gr8,cc0,0
309
        test_icc        1 0 0 0 icc0
310
        test_gr_limmed  0x7fff,0xffff,gr8
311
        test_gr_immed   0,gr9
312
 
313
        ; Mixed operands
314
        set_gr_immed    -3,gr7          ; multiply small numbers
315
        set_gr_immed    2,gr8
316
        set_icc         0x9,0
317
        csmulcc         gr7,gr8,gr8,cc0,0
318
        test_icc        1 0 0 1 icc0
319
        test_gr_immed   2,gr8
320
        test_gr_immed   0,gr9
321
 
322
        set_gr_immed    3,gr7           ; multiply small numbers
323
        set_gr_immed    -2,gr8
324
        set_icc         0xa,0
325
        csmulcc         gr7,gr8,gr8,cc4,0
326
        test_icc        1 0 1 0 icc0
327
        test_gr_immed   -2,gr8
328
        test_gr_immed   0,gr9
329
 
330
        set_gr_immed    1,gr7           ; multiply by 1
331
        set_gr_immed    -2,gr8
332
        set_icc         0xb,0
333
        csmulcc         gr7,gr8,gr8,cc4,0
334
        test_icc        1 0 1 1 icc0
335
        test_gr_immed   -2,gr8
336
        test_gr_immed   0,gr9
337
 
338
        set_gr_immed    -2,gr7          ; multiply by 1
339
        set_gr_immed    1,gr8
340
        set_icc         0xc,0
341
        csmulcc         gr7,gr8,gr8,cc0,0
342
        test_icc        1 1 0 0 icc0
343
        test_gr_immed   1,gr8
344
        test_gr_immed   0,gr9
345
 
346
        set_gr_immed    0,gr7           ; multiply by 0
347
        set_gr_immed    -2,gr8
348
        set_icc         0xd,0
349
        csmulcc         gr7,gr8,gr8,cc0,0
350
        test_icc        1 1 0 1 icc0
351
        test_gr_immed   -2,gr8
352
        test_gr_immed   0,gr9
353
 
354
        set_gr_immed    -2,gr7          ; multiply by 0
355
        set_gr_immed    0,gr8
356
        set_icc         0xe,0
357
        csmulcc         gr7,gr8,gr8,cc4,0
358
        test_icc        1 1 1 0 icc0
359
        test_gr_immed   0,gr8
360
        test_gr_immed   0,gr9
361
 
362
        set_gr_limmed   0x2000,0x0001,gr7       ; 31 bit result
363
        set_gr_immed    -2,gr8
364
        set_icc         0xf,0
365
        csmulcc         gr7,gr8,gr8,cc4,0
366
        test_icc        1 1 1 1 icc0
367
        test_gr_immed   -2,gr8
368
        test_gr_immed   0,gr9
369
 
370
        set_gr_limmed   0x4000,0x0000,gr7       ; 32 bit result
371
        set_gr_immed    -2,gr8
372
        set_icc         0x0,0
373
        csmulcc         gr7,gr8,gr8,cc0,0
374
        test_icc        0 0 0 0 icc0
375
        test_gr_immed   -2,gr8
376
        test_gr_immed   0,gr9
377
 
378
        set_gr_limmed   0x4000,0x0001,gr7       ; 32 bit result
379
        set_gr_immed    -2,gr8
380
        set_icc         0x1,0
381
        csmulcc         gr7,gr8,gr8,cc0,0
382
        test_icc        0 0 0 1 icc0
383
        test_gr_immed   -2,gr8
384
        test_gr_immed   0,gr9
385
 
386
        set_gr_limmed   0x4000,0x0000,gr7       ; 33 bit result
387
        set_gr_immed    -4,gr8
388
        set_icc         0x2,0
389
        csmulcc         gr7,gr8,gr8,cc4,0
390
        test_icc        0 0 1 0 icc0
391
        test_gr_immed   -4,gr8
392
        test_gr_immed   0,gr9
393
 
394
        set_gr_limmed   0x7fff,0xffff,gr7       ; max negative result
395
        set_gr_limmed   0x8000,0x0000,gr8
396
        set_icc         0x3,0
397
        csmulcc         gr7,gr8,gr8,cc4,0
398
        test_icc        0 0 1 1 icc0
399
        test_gr_limmed  0x8000,0x0000,gr8
400
        test_gr_immed   0,gr9
401
 
402
        ; Negative operands
403
        set_gr_immed    -3,gr7          ; multiply small numbers
404
        set_gr_immed    -2,gr8
405
        set_icc         0x4,0
406
        csmulcc         gr7,gr8,gr8,cc0,0
407
        test_icc        0 1 0 0 icc0
408
        test_gr_immed   -2,gr8
409
        test_gr_immed   0,gr9
410
 
411
        set_gr_immed    -1,gr7          ; multiply by 1
412
        set_gr_immed    -2,gr8
413
        set_icc         0x5,0
414
        csmulcc         gr7,gr8,gr8,cc0,0
415
        test_icc        0 1 0 1 icc0
416
        test_gr_immed   -2,gr8
417
        test_gr_immed   0,gr9
418
 
419
        set_gr_immed    -2,gr7          ; multiply by 1
420
        set_gr_immed    -1,gr8
421
        set_icc         0x6,0
422
        csmulcc         gr7,gr8,gr8,cc4,0
423
        test_icc        0 1 1 0 icc0
424
        test_gr_immed   -1,gr8
425
        test_gr_immed   0,gr9
426
 
427
        set_gr_limmed   0xc000,0x0001,gr7       ; 31 bit result
428
        set_gr_immed    -2,gr8
429
        set_icc         0x7,0
430
        csmulcc         gr7,gr8,gr8,cc4,0
431
        test_icc        0 1 1 1 icc0
432
        test_gr_immed   -2,gr8
433
        test_gr_immed   0,gr9
434
 
435
        set_gr_limmed   0xc000,0x0000,gr7       ; 32 bit result
436
        set_gr_immed    -2,gr8
437
        set_icc         0x8,0
438
        csmulcc         gr7,gr8,gr8,cc0,0
439
        test_icc        1 0 0 0 icc0
440
        test_gr_immed   -2,gr8
441
        test_gr_immed   0,gr9
442
 
443
        set_gr_limmed   0xc000,0x0000,gr7       ; 33 bit result
444
        set_gr_immed    -4,gr8
445
        set_icc         0x9,0
446
        csmulcc         gr7,gr8,gr8,cc0,0
447
        test_icc        1 0 0 1 icc0
448
        test_gr_immed   -4,gr8
449
        test_gr_immed   0,gr9
450
 
451
        set_gr_limmed   0x8000,0x0001,gr7       ; almost max positive result
452
        set_gr_limmed   0x8000,0x0001,gr8
453
        set_icc         0xa,0
454
        csmulcc         gr7,gr8,gr8,cc4,0
455
        test_icc        1 0 1 0 icc0
456
        test_gr_limmed  0x8000,0x0001,gr8
457
        test_gr_immed   0,gr9
458
 
459
 
460
        set_gr_limmed   0x8000,0x0000,gr7       ; max positive result
461
        set_gr_limmed   0x8000,0x0000,gr8
462
        set_icc         0xb,0
463
        csmulcc         gr7,gr8,gr8,cc4,0
464
        test_icc        1 0 1 1 icc0
465
        test_gr_limmed  0x8000,0x0000,gr8
466
        test_gr_immed   0,gr9
467
 
468
        ; Positive operands
469
        set_gr_immed    3,gr7           ; multiply small numbers
470
        set_gr_immed    2,gr8
471
        set_icc         0xc,1
472
        csmulcc         gr7,gr8,gr8,cc1,0
473
        test_icc        0 0 0 0 icc1
474
        test_gr_immed   0,gr8
475
        test_gr_immed   6,gr9
476
 
477
        set_gr_immed    1,gr7           ; multiply by 1
478
        set_gr_immed    2,gr8
479
        set_icc         0xd,1
480
        csmulcc         gr7,gr8,gr8,cc1,0
481
        test_icc        0 0 0 1 icc1
482
        test_gr_immed   0,gr8
483
        test_gr_immed   2,gr9
484
 
485
        set_gr_immed    2,gr7           ; multiply by 1
486
        set_gr_immed    1,gr8
487
        set_icc         0xe,1
488
        csmulcc         gr7,gr8,gr8,cc5,0
489
        test_icc        0 0 1 0 icc1
490
        test_gr_immed   0,gr8
491
        test_gr_immed   2,gr9
492
 
493
        set_gr_immed    0,gr7           ; multiply by 0
494
        set_gr_immed    2,gr8
495
        set_icc         0xb,1
496
        csmulcc         gr7,gr8,gr8,cc5,0
497
        test_icc        0 1 1 1 icc1
498
        test_gr_immed   0,gr8
499
        test_gr_immed   0,gr9
500
 
501
        set_gr_immed    2,gr7           ; multiply by 0
502
        set_gr_immed    0,gr8
503
        set_icc         0x8,1
504
        csmulcc         gr7,gr8,gr8,cc1,0
505
        test_icc        0 1 0 0 icc1
506
        test_gr_immed   0,gr8
507
        test_gr_immed   0,gr9
508
 
509
        set_gr_limmed   0x3fff,0xffff,gr7       ; 31 bit result
510
        set_gr_immed    2,gr8
511
        set_icc         0xd,1
512
        csmulcc         gr7,gr8,gr8,cc1,0
513
        test_icc        0 0 0 1 icc1
514
        test_gr_immed   0,gr8
515
        test_gr_limmed  0x7fff,0xfffe,gr9
516
 
517
        set_gr_limmed   0x4000,0x0000,gr7       ; 32 bit result
518
        set_gr_immed    2,gr8
519
        set_icc         0xe,1
520
        csmulcc         gr7,gr8,gr8,cc5,0
521
        test_icc        0 0 1 0 icc1
522
        test_gr_immed   0,gr8
523
        test_gr_limmed  0x8000,0x0000,gr9
524
 
525
        set_gr_limmed   0x4000,0x0000,gr7       ; 33 bit result
526
        set_gr_immed    4,gr8
527
        set_icc         0xf,1
528
        csmulcc         gr7,gr8,gr8,cc5,0
529
        test_icc        0 0 1 1 icc1
530
        test_gr_immed   1,gr8
531
        test_gr_limmed  0x0000,0x0000,gr9
532
 
533
        set_gr_limmed   0x7fff,0xffff,gr7       ; max positive result
534
        set_gr_limmed   0x7fff,0xffff,gr8
535
        set_icc         0xc,1
536
        csmulcc         gr7,gr8,gr8,cc1,0
537
        test_icc        0 0 0 0 icc1
538
        test_gr_limmed  0x3fff,0xffff,gr8
539
        test_gr_immed   0x00000001,gr9
540
 
541
        ; Mixed operands
542
        set_gr_immed    -3,gr7          ; multiply small numbers
543
        set_gr_immed    2,gr8
544
        set_icc         0x5,1
545
        csmulcc         gr7,gr8,gr8,cc1,0
546
        test_icc        1 0 0 1 icc1
547
        test_gr_immed   -1,gr8
548
        test_gr_immed   -6,gr9
549
 
550
        set_gr_immed    3,gr7           ; multiply small numbers
551
        set_gr_immed    -2,gr8
552
        set_icc         0x6,1
553
        csmulcc         gr7,gr8,gr8,cc5,0
554
        test_icc        1 0 1 0 icc1
555
        test_gr_immed   -1,gr8
556
        test_gr_immed   -6,gr9
557
 
558
        set_gr_immed    1,gr7           ; multiply by 1
559
        set_gr_immed    -2,gr8
560
        set_icc         0x7,1
561
        csmulcc         gr7,gr8,gr8,cc5,0
562
        test_icc        1 0 1 1 icc1
563
        test_gr_immed   -1,gr8
564
        test_gr_immed   -2,gr9
565
 
566
        set_gr_immed    -2,gr7          ; multiply by 1
567
        set_gr_immed    1,gr8
568
        set_icc         0x4,1
569
        csmulcc         gr7,gr8,gr8,cc1,0
570
        test_icc        1 0 0 0 icc1
571
        test_gr_immed   -1,gr8
572
        test_gr_immed   -2,gr9
573
 
574
        set_gr_immed    0,gr7           ; multiply by 0
575
        set_gr_immed    -2,gr8
576
        set_icc         0x9,1
577
        csmulcc         gr7,gr8,gr8,cc1,0
578
        test_icc        0 1 0 1 icc1
579
        test_gr_immed   0,gr8
580
        test_gr_immed   0,gr9
581
 
582
        set_gr_immed    -2,gr7          ; multiply by 0
583
        set_gr_immed    0,gr8
584
        set_icc         0xa,1
585
        csmulcc         gr7,gr8,gr8,cc5,0
586
        test_icc        0 1 1 0 icc1
587
        test_gr_immed   0,gr8
588
        test_gr_immed   0,gr9
589
 
590
        set_gr_limmed   0x2000,0x0001,gr7       ; 31 bit result
591
        set_gr_immed    -2,gr8
592
        set_icc         0x7,1
593
        csmulcc         gr7,gr8,gr8,cc5,0
594
        test_icc        1 0 1 1 icc1
595
        test_gr_limmed  0xffff,0xffff,gr8
596
        test_gr_limmed  0xbfff,0xfffe,gr9
597
 
598
        set_gr_limmed   0x4000,0x0000,gr7       ; 32 bit result
599
        set_gr_immed    -2,gr8
600
        set_icc         0x4,1
601
        csmulcc         gr7,gr8,gr8,cc1,0
602
        test_icc        1 0 0 0 icc1
603
        test_gr_limmed  0xffff,0xffff,gr8
604
        test_gr_limmed  0x8000,0x0000,gr9
605
 
606
        set_gr_limmed   0x4000,0x0001,gr7       ; 32 bit result
607
        set_gr_immed    -2,gr8
608
        set_icc         0x5,1
609
        csmulcc         gr7,gr8,gr8,cc1,0
610
        test_icc        1 0 0 1 icc1
611
        test_gr_limmed  0xffff,0xffff,gr8
612
        test_gr_limmed  0x7fff,0xfffe,gr9
613
 
614
        set_gr_limmed   0x4000,0x0000,gr7       ; 33 bit result
615
        set_gr_immed    -4,gr8
616
        set_icc         0x6,1
617
        csmulcc         gr7,gr8,gr8,cc5,0
618
        test_icc        1 0 1 0 icc1
619
        test_gr_limmed  0xffff,0xffff,gr8
620
        test_gr_limmed  0x0000,0x0000,gr9
621
 
622
        set_gr_limmed   0x7fff,0xffff,gr7       ; max negative result
623
        set_gr_limmed   0x8000,0x0000,gr8
624
        set_icc         0x7,1
625
        csmulcc         gr7,gr8,gr8,cc5,0
626
        test_icc        1 0 1 1 icc1
627
        test_gr_limmed  0xc000,0x0000,gr8
628
        test_gr_limmed  0x8000,0x0000,gr9
629
 
630
        ; Negative operands
631
        set_gr_immed    -3,gr7          ; multiply small numbers
632
        set_gr_immed    -2,gr8
633
        set_icc         0xc,1
634
        csmulcc         gr7,gr8,gr8,cc1,0
635
        test_icc        0 0 0 0 icc1
636
        test_gr_immed   0,gr8
637
        test_gr_immed   6,gr9
638
 
639
        set_gr_immed    -1,gr7          ; multiply by 1
640
        set_gr_immed    -2,gr8
641
        set_icc         0xd,1
642
        csmulcc         gr7,gr8,gr8,cc1,0
643
        test_icc        0 0 0 1 icc1
644
        test_gr_immed   0,gr8
645
        test_gr_immed   2,gr9
646
 
647
        set_gr_immed    -2,gr7          ; multiply by 1
648
        set_gr_immed    -1,gr8
649
        set_icc         0xe,1
650
        csmulcc         gr7,gr8,gr8,cc5,0
651
        test_icc        0 0 1 0 icc1
652
        test_gr_immed   0,gr8
653
        test_gr_immed   2,gr9
654
 
655
        set_gr_limmed   0xc000,0x0001,gr7       ; 31 bit result
656
        set_gr_immed    -2,gr8
657
        set_icc         0xf,1
658
        csmulcc         gr7,gr8,gr8,cc5,0
659
        test_icc        0 0 1 1 icc1
660
        test_gr_immed   0,gr8
661
        test_gr_limmed  0x7fff,0xfffe,gr9
662
 
663
        set_gr_limmed   0xc000,0x0000,gr7       ; 32 bit result
664
        set_gr_immed    -2,gr8
665
        set_icc         0xc,1
666
        csmulcc         gr7,gr8,gr8,cc1,0
667
        test_icc        0 0 0 0 icc1
668
        test_gr_immed   0,gr8
669
        test_gr_limmed  0x8000,0x0000,gr9
670
 
671
        set_gr_limmed   0xc000,0x0000,gr7       ; 33 bit result
672
        set_gr_immed    -4,gr8
673
        set_icc         0xd,1
674
        csmulcc         gr7,gr8,gr8,cc1,0
675
        test_icc        0 0 0 1 icc1
676
        test_gr_immed   1,gr8
677
        test_gr_immed   0x00000000,gr9
678
 
679
        set_gr_limmed   0x8000,0x0001,gr7       ; almost max positive result
680
        set_gr_limmed   0x8000,0x0001,gr8
681
        set_icc         0xe,1
682
        csmulcc         gr7,gr8,gr8,cc5,0
683
        test_icc        0 0 1 0 icc1
684
        test_gr_limmed  0x3fff,0xffff,gr8
685
        test_gr_immed   0x00000001,gr9
686
 
687
 
688
        set_gr_limmed   0x8000,0x0000,gr7       ; max positive result
689
        set_gr_limmed   0x8000,0x0000,gr8
690
        set_icc         0xf,1
691
        csmulcc         gr7,gr8,gr8,cc5,0
692
        test_icc        0 0 1 1 icc1
693
        test_gr_limmed  0x4000,0x0000,gr8
694
        test_gr_immed   0x00000000,gr9
695
 
696
        ; Positive operands
697
        set_gr_immed    3,gr7           ; multiply small numbers
698
        set_gr_immed    2,gr8
699
        set_icc         0x0,1
700
        csmulcc         gr7,gr8,gr8,cc1,1
701
        test_icc        0 0 0 0 icc1
702
        test_gr_immed   2,gr8
703
        test_gr_immed   0,gr9
704
 
705
        set_gr_immed    1,gr7           ; multiply by 1
706
        set_gr_immed    2,gr8
707
        set_icc         0x1,1
708
        csmulcc         gr7,gr8,gr8,cc1,1
709
        test_icc        0 0 0 1 icc1
710
        test_gr_immed   2,gr8
711
        test_gr_immed   0,gr9
712
 
713
        set_gr_immed    2,gr7           ; multiply by 1
714
        set_gr_immed    1,gr8
715
        set_icc         0x2,1
716
        csmulcc         gr7,gr8,gr8,cc5,1
717
        test_icc        0 0 1 0 icc1
718
        test_gr_immed   1,gr8
719
        test_gr_immed   0,gr9
720
 
721
        set_gr_immed    0,gr7           ; multiply by 0
722
        set_gr_immed    2,gr8
723
        set_icc         0x3,1
724
        csmulcc         gr7,gr8,gr8,cc5,1
725
        test_icc        0 0 1 1 icc1
726
        test_gr_immed   2,gr8
727
        test_gr_immed   0,gr9
728
 
729
        set_gr_immed    2,gr7           ; multiply by 0
730
        set_gr_immed    0,gr8
731
        set_icc         0x4,1
732
        csmulcc         gr7,gr8,gr8,cc1,1
733
        test_icc        0 1 0 0 icc1
734
        test_gr_immed   0,gr8
735
        test_gr_immed   0,gr9
736
 
737
        set_gr_limmed   0x3fff,0xffff,gr7       ; 31 bit result
738
        set_gr_immed    2,gr8
739
        set_icc         0x5,1
740
        csmulcc         gr7,gr8,gr8,cc1,1
741
        test_icc        0 1 0 1 icc1
742
        test_gr_immed   2,gr8
743
        test_gr_immed   0,gr9
744
 
745
        set_gr_limmed   0x4000,0x0000,gr7       ; 32 bit result
746
        set_gr_immed    2,gr8
747
        set_icc         0x6,1
748
        csmulcc         gr7,gr8,gr8,cc5,1
749
        test_icc        0 1 1 0 icc1
750
        test_gr_immed   2,gr8
751
        test_gr_immed   0,gr9
752
 
753
        set_gr_limmed   0x4000,0x0000,gr7       ; 33 bit result
754
        set_gr_immed    4,gr8
755
        set_icc         0x7,1
756
        csmulcc         gr7,gr8,gr8,cc5,1
757
        test_icc        0 1 1 1 icc1
758
        test_gr_immed   4,gr8
759
        test_gr_immed   0,gr9
760
 
761
        set_gr_limmed   0x7fff,0xffff,gr7       ; max positive result
762
        set_gr_limmed   0x7fff,0xffff,gr8
763
        set_icc         0x8,1
764
        csmulcc         gr7,gr8,gr8,cc1,1
765
        test_icc        1 0 0 0 icc1
766
        test_gr_limmed  0x7fff,0xffff,gr8
767
        test_gr_immed   0,gr9
768
 
769
        ; Mixed operands
770
        set_gr_immed    -3,gr7          ; multiply small numbers
771
        set_gr_immed    2,gr8
772
        set_icc         0x9,1
773
        csmulcc         gr7,gr8,gr8,cc1,1
774
        test_icc        1 0 0 1 icc1
775
        test_gr_immed   2,gr8
776
        test_gr_immed   0,gr9
777
 
778
        set_gr_immed    3,gr7           ; multiply small numbers
779
        set_gr_immed    -2,gr8
780
        set_icc         0xa,1
781
        csmulcc         gr7,gr8,gr8,cc5,1
782
        test_icc        1 0 1 0 icc1
783
        test_gr_immed   -2,gr8
784
        test_gr_immed   0,gr9
785
 
786
        set_gr_immed    1,gr7           ; multiply by 1
787
        set_gr_immed    -2,gr8
788
        set_icc         0xb,1
789
        csmulcc         gr7,gr8,gr8,cc5,1
790
        test_icc        1 0 1 1 icc1
791
        test_gr_immed   -2,gr8
792
        test_gr_immed   0,gr9
793
 
794
        set_gr_immed    -2,gr7          ; multiply by 1
795
        set_gr_immed    1,gr8
796
        set_icc         0xc,1
797
        csmulcc         gr7,gr8,gr8,cc1,1
798
        test_icc        1 1 0 0 icc1
799
        test_gr_immed   1,gr8
800
        test_gr_immed   0,gr9
801
 
802
        set_gr_immed    0,gr7           ; multiply by 0
803
        set_gr_immed    -2,gr8
804
        set_icc         0xd,1
805
        csmulcc         gr7,gr8,gr8,cc1,1
806
        test_icc        1 1 0 1 icc1
807
        test_gr_immed   -2,gr8
808
        test_gr_immed   0,gr9
809
 
810
        set_gr_immed    -2,gr7          ; multiply by 0
811
        set_gr_immed    0,gr8
812
        set_icc         0xe,1
813
        csmulcc         gr7,gr8,gr8,cc5,1
814
        test_icc        1 1 1 0 icc1
815
        test_gr_immed   0,gr8
816
        test_gr_immed   0,gr9
817
 
818
        set_gr_limmed   0x2000,0x0001,gr7       ; 31 bit result
819
        set_gr_immed    -2,gr8
820
        set_icc         0xf,1
821
        csmulcc         gr7,gr8,gr8,cc5,1
822
        test_icc        1 1 1 1 icc1
823
        test_gr_immed   -2,gr8
824
        test_gr_immed   0,gr9
825
 
826
        set_gr_limmed   0x4000,0x0000,gr7       ; 32 bit result
827
        set_gr_immed    -2,gr8
828
        set_icc         0x0,1
829
        csmulcc         gr7,gr8,gr8,cc1,1
830
        test_icc        0 0 0 0 icc1
831
        test_gr_immed   -2,gr8
832
        test_gr_immed   0,gr9
833
 
834
        set_gr_limmed   0x4000,0x0001,gr7       ; 32 bit result
835
        set_gr_immed    -2,gr8
836
        set_icc         0x1,1
837
        csmulcc         gr7,gr8,gr8,cc1,1
838
        test_icc        0 0 0 1 icc1
839
        test_gr_immed   -2,gr8
840
        test_gr_immed   0,gr9
841
 
842
        set_gr_limmed   0x4000,0x0000,gr7       ; 33 bit result
843
        set_gr_immed    -4,gr8
844
        set_icc         0x2,1
845
        csmulcc         gr7,gr8,gr8,cc5,1
846
        test_icc        0 0 1 0 icc1
847
        test_gr_immed   -4,gr8
848
        test_gr_immed   0,gr9
849
 
850
        set_gr_limmed   0x7fff,0xffff,gr7       ; max negative result
851
        set_gr_limmed   0x8000,0x0000,gr8
852
        set_icc         0x3,1
853
        csmulcc         gr7,gr8,gr8,cc5,1
854
        test_icc        0 0 1 1 icc1
855
        test_gr_limmed  0x8000,0x0000,gr8
856
        test_gr_immed   0,gr9
857
 
858
        ; Negative operands
859
        set_gr_immed    -3,gr7          ; multiply small numbers
860
        set_gr_immed    -2,gr8
861
        set_icc         0x4,1
862
        csmulcc         gr7,gr8,gr8,cc1,1
863
        test_icc        0 1 0 0 icc1
864
        test_gr_immed   -2,gr8
865
        test_gr_immed   0,gr9
866
 
867
        set_gr_immed    -1,gr7          ; multiply by 1
868
        set_gr_immed    -2,gr8
869
        set_icc         0x5,1
870
        csmulcc         gr7,gr8,gr8,cc1,1
871
        test_icc        0 1 0 1 icc1
872
        test_gr_immed   -2,gr8
873
        test_gr_immed   0,gr9
874
 
875
        set_gr_immed    -2,gr7          ; multiply by 1
876
        set_gr_immed    -1,gr8
877
        set_icc         0x6,1
878
        csmulcc         gr7,gr8,gr8,cc5,1
879
        test_icc        0 1 1 0 icc1
880
        test_gr_immed   -1,gr8
881
        test_gr_immed   0,gr9
882
 
883
        set_gr_limmed   0xc000,0x0001,gr7       ; 31 bit result
884
        set_gr_immed    -2,gr8
885
        set_icc         0x7,1
886
        csmulcc         gr7,gr8,gr8,cc5,1
887
        test_icc        0 1 1 1 icc1
888
        test_gr_immed   -2,gr8
889
        test_gr_immed   0,gr9
890
 
891
        set_gr_limmed   0xc000,0x0000,gr7       ; 32 bit result
892
        set_gr_immed    -2,gr8
893
        set_icc         0x8,1
894
        csmulcc         gr7,gr8,gr8,cc1,1
895
        test_icc        1 0 0 0 icc1
896
        test_gr_immed   -2,gr8
897
        test_gr_immed   0,gr9
898
 
899
        set_gr_limmed   0xc000,0x0000,gr7       ; 33 bit result
900
        set_gr_immed    -4,gr8
901
        set_icc         0x9,1
902
        csmulcc         gr7,gr8,gr8,cc1,1
903
        test_icc        1 0 0 1 icc1
904
        test_gr_immed   -4,gr8
905
        test_gr_immed   0,gr9
906
 
907
        set_gr_limmed   0x8000,0x0001,gr7       ; almost max positive result
908
        set_gr_limmed   0x8000,0x0001,gr8
909
        set_icc         0xa,1
910
        csmulcc         gr7,gr8,gr8,cc5,1
911
        test_icc        1 0 1 0 icc1
912
        test_gr_limmed  0x8000,0x0001,gr8
913
        test_gr_immed   0,gr9
914
 
915
 
916
        set_gr_limmed   0x8000,0x0000,gr7       ; max positive result
917
        set_gr_limmed   0x8000,0x0000,gr8
918
        set_icc         0xb,1
919
        csmulcc         gr7,gr8,gr8,cc5,1
920
        test_icc        1 0 1 1 icc1
921
        test_gr_limmed  0x8000,0x0000,gr8
922
        test_gr_immed   0,gr9
923
 
924
        ; Positive operands
925
        set_gr_immed    3,gr7           ; multiply small numbers
926
        set_gr_immed    2,gr8
927
        set_icc         0x0,2
928
        csmulcc         gr7,gr8,gr8,cc2,0
929
        test_icc        0 0 0 0 icc2
930
        test_gr_immed   2,gr8
931
        test_gr_immed   0,gr9
932
 
933
        set_gr_immed    1,gr7           ; multiply by 1
934
        set_gr_immed    2,gr8
935
        set_icc         0x1,2
936
        csmulcc         gr7,gr8,gr8,cc2,1
937
        test_icc        0 0 0 1 icc2
938
        test_gr_immed   2,gr8
939
        test_gr_immed   0,gr9
940
 
941
        set_gr_immed    2,gr7           ; multiply by 1
942
        set_gr_immed    1,gr8
943
        set_icc         0x2,2
944
        csmulcc         gr7,gr8,gr8,cc6,0
945
        test_icc        0 0 1 0 icc2
946
        test_gr_immed   1,gr8
947
        test_gr_immed   0,gr9
948
 
949
        set_gr_immed    0,gr7           ; multiply by 0
950
        set_gr_immed    2,gr8
951
        set_icc         0x3,2
952
        csmulcc         gr7,gr8,gr8,cc6,1
953
        test_icc        0 0 1 1 icc2
954
        test_gr_immed   2,gr8
955
        test_gr_immed   0,gr9
956
 
957
        set_gr_immed    2,gr7           ; multiply by 0
958
        set_gr_immed    0,gr8
959
        set_icc         0x4,2
960
        csmulcc         gr7,gr8,gr8,cc2,0
961
        test_icc        0 1 0 0 icc2
962
        test_gr_immed   0,gr8
963
        test_gr_immed   0,gr9
964
 
965
        set_gr_limmed   0x3fff,0xffff,gr7       ; 31 bit result
966
        set_gr_immed    2,gr8
967
        set_icc         0x5,2
968
        csmulcc         gr7,gr8,gr8,cc2,1
969
        test_icc        0 1 0 1 icc2
970
        test_gr_immed   2,gr8
971
        test_gr_immed   0,gr9
972
 
973
        set_gr_limmed   0x4000,0x0000,gr7       ; 32 bit result
974
        set_gr_immed    2,gr8
975
        set_icc         0x6,2
976
        csmulcc         gr7,gr8,gr8,cc6,1
977
        test_icc        0 1 1 0 icc2
978
        test_gr_immed   2,gr8
979
        test_gr_immed   0,gr9
980
 
981
        set_gr_limmed   0x4000,0x0000,gr7       ; 33 bit result
982
        set_gr_immed    4,gr8
983
        set_icc         0x7,2
984
        csmulcc         gr7,gr8,gr8,cc6,0
985
        test_icc        0 1 1 1 icc2
986
        test_gr_immed   4,gr8
987
        test_gr_immed   0,gr9
988
 
989
        set_gr_limmed   0x7fff,0xffff,gr7       ; max positive result
990
        set_gr_limmed   0x7fff,0xffff,gr8
991
        set_icc         0x8,2
992
        csmulcc         gr7,gr8,gr8,cc2,1
993
        test_icc        1 0 0 0 icc2
994
        test_gr_limmed  0x7fff,0xffff,gr8
995
        test_gr_immed   0,gr9
996
 
997
        ; Mixed operands
998
        set_gr_immed    -3,gr7          ; multiply small numbers
999
        set_gr_immed    2,gr8
1000
        set_icc         0x9,2
1001
        csmulcc         gr7,gr8,gr8,cc2,0
1002
        test_icc        1 0 0 1 icc2
1003
        test_gr_immed   2,gr8
1004
        test_gr_immed   0,gr9
1005
 
1006
        set_gr_immed    3,gr7           ; multiply small numbers
1007
        set_gr_immed    -2,gr8
1008
        set_icc         0xa,2
1009
        csmulcc         gr7,gr8,gr8,cc6,1
1010
        test_icc        1 0 1 0 icc2
1011
        test_gr_immed   -2,gr8
1012
        test_gr_immed   0,gr9
1013
 
1014
        set_gr_immed    1,gr7           ; multiply by 1
1015
        set_gr_immed    -2,gr8
1016
        set_icc         0xb,2
1017
        csmulcc         gr7,gr8,gr8,cc6,0
1018
        test_icc        1 0 1 1 icc2
1019
        test_gr_immed   -2,gr8
1020
        test_gr_immed   0,gr9
1021
 
1022
        set_gr_immed    -2,gr7          ; multiply by 1
1023
        set_gr_immed    1,gr8
1024
        set_icc         0xc,2
1025
        csmulcc         gr7,gr8,gr8,cc2,1
1026
        test_icc        1 1 0 0 icc2
1027
        test_gr_immed   1,gr8
1028
        test_gr_immed   0,gr9
1029
 
1030
        set_gr_immed    0,gr7           ; multiply by 0
1031
        set_gr_immed    -2,gr8
1032
        set_icc         0xd,2
1033
        csmulcc         gr7,gr8,gr8,cc2,0
1034
        test_icc        1 1 0 1 icc2
1035
        test_gr_immed   -2,gr8
1036
        test_gr_immed   0,gr9
1037
 
1038
        set_gr_immed    -2,gr7          ; multiply by 0
1039
        set_gr_immed    0,gr8
1040
        set_icc         0xe,2
1041
        csmulcc         gr7,gr8,gr8,cc6,1
1042
        test_icc        1 1 1 0 icc2
1043
        test_gr_immed   0,gr8
1044
        test_gr_immed   0,gr9
1045
 
1046
        set_gr_limmed   0x2000,0x0001,gr7       ; 31 bit result
1047
        set_gr_immed    -2,gr8
1048
        set_icc         0xf,2
1049
        csmulcc         gr7,gr8,gr8,cc6,0
1050
        test_icc        1 1 1 1 icc2
1051
        test_gr_immed   -2,gr8
1052
        test_gr_immed   0,gr9
1053
 
1054
        set_gr_limmed   0x4000,0x0000,gr7       ; 32 bit result
1055
        set_gr_immed    -2,gr8
1056
        set_icc         0x0,2
1057
        csmulcc         gr7,gr8,gr8,cc2,1
1058
        test_icc        0 0 0 0 icc2
1059
        test_gr_immed   -2,gr8
1060
        test_gr_immed   0,gr9
1061
 
1062
        set_gr_limmed   0x4000,0x0001,gr7       ; 32 bit result
1063
        set_gr_immed    -2,gr8
1064
        set_icc         0x1,2
1065
        csmulcc         gr7,gr8,gr8,cc2,0
1066
        test_icc        0 0 0 1 icc2
1067
        test_gr_immed   -2,gr8
1068
        test_gr_immed   0,gr9
1069
 
1070
        set_gr_limmed   0x4000,0x0000,gr7       ; 33 bit result
1071
        set_gr_immed    -4,gr8
1072
        set_icc         0x2,2
1073
        csmulcc         gr7,gr8,gr8,cc6,1
1074
        test_icc        0 0 1 0 icc2
1075
        test_gr_immed   -4,gr8
1076
        test_gr_immed   0,gr9
1077
 
1078
        set_gr_limmed   0x7fff,0xffff,gr7       ; max negative result
1079
        set_gr_limmed   0x8000,0x0000,gr8
1080
        set_icc         0x3,2
1081
        csmulcc         gr7,gr8,gr8,cc6,0
1082
        test_icc        0 0 1 1 icc2
1083
        test_gr_limmed  0x8000,0x0000,gr8
1084
        test_gr_immed   0,gr9
1085
 
1086
        ; Negative operands
1087
        set_gr_immed    -3,gr7          ; multiply small numbers
1088
        set_gr_immed    -2,gr8
1089
        set_icc         0x4,2
1090
        csmulcc         gr7,gr8,gr8,cc2,1
1091
        test_icc        0 1 0 0 icc2
1092
        test_gr_immed   -2,gr8
1093
        test_gr_immed   0,gr9
1094
 
1095
        set_gr_immed    -1,gr7          ; multiply by 1
1096
        set_gr_immed    -2,gr8
1097
        set_icc         0x5,2
1098
        csmulcc         gr7,gr8,gr8,cc2,0
1099
        test_icc        0 1 0 1 icc2
1100
        test_gr_immed   -2,gr8
1101
        test_gr_immed   0,gr9
1102
 
1103
        set_gr_immed    -2,gr7          ; multiply by 1
1104
        set_gr_immed    -1,gr8
1105
        set_icc         0x6,2
1106
        csmulcc         gr7,gr8,gr8,cc6,1
1107
        test_icc        0 1 1 0 icc2
1108
        test_gr_immed   -1,gr8
1109
        test_gr_immed   0,gr9
1110
 
1111
        set_gr_limmed   0xc000,0x0001,gr7       ; 31 bit result
1112
        set_gr_immed    -2,gr8
1113
        set_icc         0x7,2
1114
        csmulcc         gr7,gr8,gr8,cc6,0
1115
        test_icc        0 1 1 1 icc2
1116
        test_gr_immed   -2,gr8
1117
        test_gr_immed   0,gr9
1118
 
1119
        set_gr_limmed   0xc000,0x0000,gr7       ; 32 bit result
1120
        set_gr_immed    -2,gr8
1121
        set_icc         0x8,2
1122
        csmulcc         gr7,gr8,gr8,cc2,1
1123
        test_icc        1 0 0 0 icc2
1124
        test_gr_immed   -2,gr8
1125
        test_gr_immed   0,gr9
1126
 
1127
        set_gr_limmed   0xc000,0x0000,gr7       ; 33 bit result
1128
        set_gr_immed    -4,gr8
1129
        set_icc         0x9,2
1130
        csmulcc         gr7,gr8,gr8,cc2,0
1131
        test_icc        1 0 0 1 icc2
1132
        test_gr_immed   -4,gr8
1133
        test_gr_immed   0,gr9
1134
 
1135
        set_gr_limmed   0x8000,0x0001,gr7       ; almost max positive result
1136
        set_gr_limmed   0x8000,0x0001,gr8
1137
        set_icc         0xa,2
1138
        csmulcc         gr7,gr8,gr8,cc6,1
1139
        test_icc        1 0 1 0 icc2
1140
        test_gr_limmed  0x8000,0x0001,gr8
1141
        test_gr_immed   0,gr9
1142
 
1143
 
1144
        set_gr_limmed   0x8000,0x0000,gr7       ; max positive result
1145
        set_gr_limmed   0x8000,0x0000,gr8
1146
        set_icc         0xb,2
1147
        csmulcc         gr7,gr8,gr8,cc6,0
1148
        test_icc        1 0 1 1 icc2
1149
        test_gr_limmed  0x8000,0x0000,gr8
1150
        test_gr_immed   0,gr9
1151
 
1152
        ; Positive operands
1153
        set_gr_immed    3,gr7           ; multiply small numbers
1154
        set_gr_immed    2,gr8
1155
        set_icc         0x0,3
1156
        csmulcc         gr7,gr8,gr8,cc3,0
1157
        test_icc        0 0 0 0 icc3
1158
        test_gr_immed   2,gr8
1159
        test_gr_immed   0,gr9
1160
 
1161
        set_gr_immed    1,gr7           ; multiply by 1
1162
        set_gr_immed    2,gr8
1163
        set_icc         0x1,3
1164
        csmulcc         gr7,gr8,gr8,cc3,1
1165
        test_icc        0 0 0 1 icc3
1166
        test_gr_immed   2,gr8
1167
        test_gr_immed   0,gr9
1168
 
1169
        set_gr_immed    2,gr7           ; multiply by 1
1170
        set_gr_immed    1,gr8
1171
        set_icc         0x2,3
1172
        csmulcc         gr7,gr8,gr8,cc7,0
1173
        test_icc        0 0 1 0 icc3
1174
        test_gr_immed   1,gr8
1175
        test_gr_immed   0,gr9
1176
 
1177
        set_gr_immed    0,gr7           ; multiply by 0
1178
        set_gr_immed    2,gr8
1179
        set_icc         0x3,3
1180
        csmulcc         gr7,gr8,gr8,cc7,1
1181
        test_icc        0 0 1 1 icc3
1182
        test_gr_immed   2,gr8
1183
        test_gr_immed   0,gr9
1184
 
1185
        set_gr_immed    2,gr7           ; multiply by 0
1186
        set_gr_immed    0,gr8
1187
        set_icc         0x4,3
1188
        csmulcc         gr7,gr8,gr8,cc3,0
1189
        test_icc        0 1 0 0 icc3
1190
        test_gr_immed   0,gr8
1191
        test_gr_immed   0,gr9
1192
 
1193
        set_gr_limmed   0x3fff,0xffff,gr7       ; 31 bit result
1194
        set_gr_immed    2,gr8
1195
        set_icc         0x5,3
1196
        csmulcc         gr7,gr8,gr8,cc3,1
1197
        test_icc        0 1 0 1 icc3
1198
        test_gr_immed   2,gr8
1199
        test_gr_immed   0,gr9
1200
 
1201
        set_gr_limmed   0x4000,0x0000,gr7       ; 32 bit result
1202
        set_gr_immed    2,gr8
1203
        set_icc         0x6,3
1204
        csmulcc         gr7,gr8,gr8,cc7,1
1205
        test_icc        0 1 1 0 icc3
1206
        test_gr_immed   2,gr8
1207
        test_gr_immed   0,gr9
1208
 
1209
        set_gr_limmed   0x4000,0x0000,gr7       ; 33 bit result
1210
        set_gr_immed    4,gr8
1211
        set_icc         0x7,3
1212
        csmulcc         gr7,gr8,gr8,cc7,0
1213
        test_icc        0 1 1 1 icc3
1214
        test_gr_immed   4,gr8
1215
        test_gr_immed   0,gr9
1216
 
1217
        set_gr_limmed   0x7fff,0xffff,gr7       ; max positive result
1218
        set_gr_limmed   0x7fff,0xffff,gr8
1219
        set_icc         0x8,3
1220
        csmulcc         gr7,gr8,gr8,cc3,1
1221
        test_icc        1 0 0 0 icc3
1222
        test_gr_limmed  0x7fff,0xffff,gr8
1223
        test_gr_immed   0,gr9
1224
 
1225
        ; Mixed operands
1226
        set_gr_immed    -3,gr7          ; multiply small numbers
1227
        set_gr_immed    2,gr8
1228
        set_icc         0x9,3
1229
        csmulcc         gr7,gr8,gr8,cc3,0
1230
        test_icc        1 0 0 1 icc3
1231
        test_gr_immed   2,gr8
1232
        test_gr_immed   0,gr9
1233
 
1234
        set_gr_immed    3,gr7           ; multiply small numbers
1235
        set_gr_immed    -2,gr8
1236
        set_icc         0xa,3
1237
        csmulcc         gr7,gr8,gr8,cc7,1
1238
        test_icc        1 0 1 0 icc3
1239
        test_gr_immed   -2,gr8
1240
        test_gr_immed   0,gr9
1241
 
1242
        set_gr_immed    1,gr7           ; multiply by 1
1243
        set_gr_immed    -2,gr8
1244
        set_icc         0xb,3
1245
        csmulcc         gr7,gr8,gr8,cc7,0
1246
        test_icc        1 0 1 1 icc3
1247
        test_gr_immed   -2,gr8
1248
        test_gr_immed   0,gr9
1249
 
1250
        set_gr_immed    -2,gr7          ; multiply by 1
1251
        set_gr_immed    1,gr8
1252
        set_icc         0xc,3
1253
        csmulcc         gr7,gr8,gr8,cc3,1
1254
        test_icc        1 1 0 0 icc3
1255
        test_gr_immed   1,gr8
1256
        test_gr_immed   0,gr9
1257
 
1258
        set_gr_immed    0,gr7           ; multiply by 0
1259
        set_gr_immed    -2,gr8
1260
        set_icc         0xd,3
1261
        csmulcc         gr7,gr8,gr8,cc3,0
1262
        test_icc        1 1 0 1 icc3
1263
        test_gr_immed   -2,gr8
1264
        test_gr_immed   0,gr9
1265
 
1266
        set_gr_immed    -2,gr7          ; multiply by 0
1267
        set_gr_immed    0,gr8
1268
        set_icc         0xe,3
1269
        csmulcc         gr7,gr8,gr8,cc7,1
1270
        test_icc        1 1 1 0 icc3
1271
        test_gr_immed   0,gr8
1272
        test_gr_immed   0,gr9
1273
 
1274
        set_gr_limmed   0x2000,0x0001,gr7       ; 31 bit result
1275
        set_gr_immed    -2,gr8
1276
        set_icc         0xf,3
1277
        csmulcc         gr7,gr8,gr8,cc7,0
1278
        test_icc        1 1 1 1 icc3
1279
        test_gr_immed   -2,gr8
1280
        test_gr_immed   0,gr9
1281
 
1282
        set_gr_limmed   0x4000,0x0000,gr7       ; 32 bit result
1283
        set_gr_immed    -2,gr8
1284
        set_icc         0x0,3
1285
        csmulcc         gr7,gr8,gr8,cc3,1
1286
        test_icc        0 0 0 0 icc3
1287
        test_gr_immed   -2,gr8
1288
        test_gr_immed   0,gr9
1289
 
1290
        set_gr_limmed   0x4000,0x0001,gr7       ; 32 bit result
1291
        set_gr_immed    -2,gr8
1292
        set_icc         0x1,3
1293
        csmulcc         gr7,gr8,gr8,cc3,0
1294
        test_icc        0 0 0 1 icc3
1295
        test_gr_immed   -2,gr8
1296
        test_gr_immed   0,gr9
1297
 
1298
        set_gr_limmed   0x4000,0x0000,gr7       ; 33 bit result
1299
        set_gr_immed    -4,gr8
1300
        set_icc         0x2,3
1301
        csmulcc         gr7,gr8,gr8,cc7,1
1302
        test_icc        0 0 1 0 icc3
1303
        test_gr_immed   -4,gr8
1304
        test_gr_immed   0,gr9
1305
 
1306
        set_gr_limmed   0x7fff,0xffff,gr7       ; max negative result
1307
        set_gr_limmed   0x8000,0x0000,gr8
1308
        set_icc         0x3,3
1309
        csmulcc         gr7,gr8,gr8,cc7,0
1310
        test_icc        0 0 1 1 icc3
1311
        test_gr_limmed  0x8000,0x0000,gr8
1312
        test_gr_immed   0,gr9
1313
 
1314
        ; Negative operands
1315
        set_gr_immed    -3,gr7          ; multiply small numbers
1316
        set_gr_immed    -2,gr8
1317
        set_icc         0x4,3
1318
        csmulcc         gr7,gr8,gr8,cc3,1
1319
        test_icc        0 1 0 0 icc3
1320
        test_gr_immed   -2,gr8
1321
        test_gr_immed   0,gr9
1322
 
1323
        set_gr_immed    -1,gr7          ; multiply by 1
1324
        set_gr_immed    -2,gr8
1325
        set_icc         0x5,3
1326
        csmulcc         gr7,gr8,gr8,cc3,0
1327
        test_icc        0 1 0 1 icc3
1328
        test_gr_immed   -2,gr8
1329
        test_gr_immed   0,gr9
1330
 
1331
        set_gr_immed    -2,gr7          ; multiply by 1
1332
        set_gr_immed    -1,gr8
1333
        set_icc         0x6,3
1334
        csmulcc         gr7,gr8,gr8,cc7,1
1335
        test_icc        0 1 1 0 icc3
1336
        test_gr_immed   -1,gr8
1337
        test_gr_immed   0,gr9
1338
 
1339
        set_gr_limmed   0xc000,0x0001,gr7       ; 31 bit result
1340
        set_gr_immed    -2,gr8
1341
        set_icc         0x7,3
1342
        csmulcc         gr7,gr8,gr8,cc7,0
1343
        test_icc        0 1 1 1 icc3
1344
        test_gr_immed   -2,gr8
1345
        test_gr_immed   0,gr9
1346
 
1347
        set_gr_limmed   0xc000,0x0000,gr7       ; 32 bit result
1348
        set_gr_immed    -2,gr8
1349
        set_icc         0x8,3
1350
        csmulcc         gr7,gr8,gr8,cc3,1
1351
        test_icc        1 0 0 0 icc3
1352
        test_gr_immed   -2,gr8
1353
        test_gr_immed   0,gr9
1354
 
1355
        set_gr_limmed   0xc000,0x0000,gr7       ; 33 bit result
1356
        set_gr_immed    -4,gr8
1357
        set_icc         0x9,3
1358
        csmulcc         gr7,gr8,gr8,cc3,0
1359
        test_icc        1 0 0 1 icc3
1360
        test_gr_immed   -4,gr8
1361
        test_gr_immed   0,gr9
1362
 
1363
        set_gr_limmed   0x8000,0x0001,gr7       ; almost max positive result
1364
        set_gr_limmed   0x8000,0x0001,gr8
1365
        set_icc         0xa,3
1366
        csmulcc         gr7,gr8,gr8,cc7,1
1367
        test_icc        1 0 1 0 icc3
1368
        test_gr_limmed  0x8000,0x0001,gr8
1369
        test_gr_immed   0,gr9
1370
 
1371
 
1372
        set_gr_limmed   0x8000,0x0000,gr7       ; max positive result
1373
        set_gr_limmed   0x8000,0x0000,gr8
1374
        set_icc         0xb,3
1375
        csmulcc         gr7,gr8,gr8,cc7,0
1376
        test_icc        1 0 1 1 icc3
1377
        test_gr_limmed  0x8000,0x0000,gr8
1378
        test_gr_immed   0,gr9
1379
 
1380
        pass

powered by: WebSVN 2.1.0

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