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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gdb-7.2/] [sim/] [testsuite/] [sim/] [frv/] [csmul.cgs] - Blame information for rev 373

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

Line No. Rev Author Line
1 330 jeremybenn
# frv testcase for csmul $GRi,$GRj,$GRk,$CCi,$cond
2
# mach: all
3
 
4
        .include "testutils.inc"
5
 
6
        start
7
 
8
        .global csmul
9
csmul:
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
        csmul           gr7,gr8,gr8,cc4,1
16
        test_gr_immed   0,gr8
17
        test_gr_immed   6,gr9
18
 
19
        set_gr_immed    1,gr7           ; multiply by 1
20
        set_gr_immed    2,gr8
21
        csmul           gr7,gr8,gr8,cc4,1
22
        test_gr_immed   0,gr8
23
        test_gr_immed   2,gr9
24
 
25
        set_gr_immed    2,gr7           ; multiply by 1
26
        set_gr_immed    1,gr8
27
        csmul           gr7,gr8,gr8,cc4,1
28
        test_gr_immed   0,gr8
29
        test_gr_immed   2,gr9
30
 
31
        set_gr_immed    0,gr7           ; multiply by 0
32
        set_gr_immed    2,gr8
33
        csmul           gr7,gr8,gr8,cc4,1
34
        test_gr_immed   0,gr8
35
        test_gr_immed   0,gr9
36
 
37
        set_gr_immed    2,gr7           ; multiply by 0
38
        set_gr_immed    0,gr8
39
        csmul           gr7,gr8,gr8,cc4,1
40
        test_gr_immed   0,gr8
41
        test_gr_immed   0,gr9
42
 
43
        set_gr_limmed   0x3fff,0xffff,gr7       ; 31 bit result
44
        set_gr_immed    2,gr8
45
        csmul           gr7,gr8,gr8,cc4,1
46
        test_gr_immed   0,gr8
47
        test_gr_limmed  0x7fff,0xfffe,gr9
48
 
49
        set_gr_limmed   0x4000,0x0000,gr7       ; 32 bit result
50
        set_gr_immed    2,gr8
51
        csmul           gr7,gr8,gr8,cc4,1
52
        test_gr_immed   0,gr8
53
        test_gr_limmed  0x8000,0x0000,gr9
54
 
55
        set_gr_limmed   0x4000,0x0000,gr7       ; 33 bit result
56
        set_gr_immed    4,gr8
57
        csmul           gr7,gr8,gr8,cc4,1
58
        test_gr_immed   1,gr8
59
        test_gr_limmed  0x0000,0x0000,gr9
60
 
61
        set_gr_limmed   0x7fff,0xffff,gr7       ; max positive result
62
        set_gr_limmed   0x7fff,0xffff,gr8
63
        csmul           gr7,gr8,gr8,cc4,1
64
        test_gr_limmed  0x3fff,0xffff,gr8
65
        test_gr_immed   0x00000001,gr9
66
 
67
        ; Mixed operands
68
        set_gr_immed    -3,gr7          ; multiply small numbers
69
        set_gr_immed    2,gr8
70
        csmul           gr7,gr8,gr8,cc4,1
71
        test_gr_immed   -1,gr8
72
        test_gr_immed   -6,gr9
73
 
74
        set_gr_immed    3,gr7           ; multiply small numbers
75
        set_gr_immed    -2,gr8
76
        csmul           gr7,gr8,gr8,cc4,1
77
        test_gr_immed   -1,gr8
78
        test_gr_immed   -6,gr9
79
 
80
        set_gr_immed    1,gr7           ; multiply by 1
81
        set_gr_immed    -2,gr8
82
        csmul           gr7,gr8,gr8,cc4,1
83
        test_gr_immed   -1,gr8
84
        test_gr_immed   -2,gr9
85
 
86
        set_gr_immed    -2,gr7          ; multiply by 1
87
        set_gr_immed    1,gr8
88
        csmul           gr7,gr8,gr8,cc4,1
89
        test_gr_immed   -1,gr8
90
        test_gr_immed   -2,gr9
91
 
92
        set_gr_immed    0,gr7           ; multiply by 0
93
        set_gr_immed    -2,gr8
94
        csmul           gr7,gr8,gr8,cc4,1
95
        test_gr_immed   0,gr8
96
        test_gr_immed   0,gr9
97
 
98
        set_gr_immed    -2,gr7          ; multiply by 0
99
        set_gr_immed    0,gr8
100
        csmul           gr7,gr8,gr8,cc4,1
101
        test_gr_immed   0,gr8
102
        test_gr_immed   0,gr9
103
 
104
        set_gr_limmed   0x2000,0x0001,gr7       ; 31 bit result
105
        set_gr_immed    -2,gr8
106
        csmul           gr7,gr8,gr8,cc4,1
107
        test_gr_limmed  0xffff,0xffff,gr8
108
        test_gr_limmed  0xbfff,0xfffe,gr9
109
 
110
        set_gr_limmed   0x4000,0x0000,gr7       ; 32 bit result
111
        set_gr_immed    -2,gr8
112
        csmul           gr7,gr8,gr8,cc4,1
113
        test_gr_limmed  0xffff,0xffff,gr8
114
        test_gr_limmed  0x8000,0x0000,gr9
115
 
116
        set_gr_limmed   0x4000,0x0001,gr7       ; 32 bit result
117
        set_gr_immed    -2,gr8
118
        csmul           gr7,gr8,gr8,cc4,1
119
        test_gr_limmed  0xffff,0xffff,gr8
120
        test_gr_limmed  0x7fff,0xfffe,gr9
121
 
122
        set_gr_limmed   0x4000,0x0000,gr7       ; 33 bit result
123
        set_gr_immed    -4,gr8
124
        csmul           gr7,gr8,gr8,cc4,1
125
        test_gr_limmed  0xffff,0xffff,gr8
126
        test_gr_limmed  0x0000,0x0000,gr9
127
 
128
        set_gr_limmed   0x7fff,0xffff,gr7       ; max negative result
129
        set_gr_limmed   0x8000,0x0000,gr8
130
        csmul           gr7,gr8,gr8,cc4,1
131
        test_gr_limmed  0xc000,0x0000,gr8
132
        test_gr_limmed  0x8000,0x0000,gr9
133
 
134
        ; Negative operands
135
        set_gr_immed    -3,gr7          ; multiply small numbers
136
        set_gr_immed    -2,gr8
137
        csmul           gr7,gr8,gr8,cc4,1
138
        test_gr_immed   0,gr8
139
        test_gr_immed   6,gr9
140
 
141
        set_gr_immed    -1,gr7          ; multiply by 1
142
        set_gr_immed    -2,gr8
143
        csmul           gr7,gr8,gr8,cc4,1
144
        test_gr_immed   0,gr8
145
        test_gr_immed   2,gr9
146
 
147
        set_gr_immed    -2,gr7          ; multiply by 1
148
        set_gr_immed    -1,gr8
149
        csmul           gr7,gr8,gr8,cc4,1
150
        test_gr_immed   0,gr8
151
        test_gr_immed   2,gr9
152
 
153
        set_gr_limmed   0xc000,0x0001,gr7       ; 31 bit result
154
        set_gr_immed    -2,gr8
155
        csmul           gr7,gr8,gr8,cc4,1
156
        test_gr_immed   0,gr8
157
        test_gr_limmed  0x7fff,0xfffe,gr9
158
 
159
        set_gr_limmed   0xc000,0x0000,gr7       ; 32 bit result
160
        set_gr_immed    -2,gr8
161
        csmul           gr7,gr8,gr8,cc4,1
162
        test_gr_immed   0,gr8
163
        test_gr_limmed  0x8000,0x0000,gr9
164
 
165
        set_gr_limmed   0xc000,0x0000,gr7       ; 33 bit result
166
        set_gr_immed    -4,gr8
167
        csmul           gr7,gr8,gr8,cc4,1
168
        test_gr_immed   1,gr8
169
        test_gr_immed   0x00000000,gr9
170
 
171
        set_gr_limmed   0x8000,0x0001,gr7       ; almost max positive result
172
        set_gr_limmed   0x8000,0x0001,gr8
173
        csmul           gr7,gr8,gr8,cc4,1
174
        test_gr_limmed  0x3fff,0xffff,gr8
175
        test_gr_immed   0x00000001,gr9
176
 
177
 
178
        set_gr_limmed   0x8000,0x0000,gr7       ; max positive result
179
        set_gr_limmed   0x8000,0x0000,gr8
180
        csmul           gr7,gr8,gr8,cc4,1
181
        test_gr_limmed  0x4000,0x0000,gr8
182
        test_gr_immed   0x00000000,gr9
183
 
184
        ; Positive operands
185
        set_gr_immed    3,gr7           ; multiply small numbers
186
        set_gr_immed    2,gr8
187
        csmul           gr7,gr8,gr8,cc5,0
188
        test_gr_immed   0,gr8
189
        test_gr_immed   6,gr9
190
 
191
        set_gr_immed    1,gr7           ; multiply by 1
192
        set_gr_immed    2,gr8
193
        csmul           gr7,gr8,gr8,cc5,0
194
        test_gr_immed   0,gr8
195
        test_gr_immed   2,gr9
196
 
197
        set_gr_immed    2,gr7           ; multiply by 1
198
        set_gr_immed    1,gr8
199
        csmul           gr7,gr8,gr8,cc5,0
200
        test_gr_immed   0,gr8
201
        test_gr_immed   2,gr9
202
 
203
        set_gr_immed    0,gr7           ; multiply by 0
204
        set_gr_immed    2,gr8
205
        csmul           gr7,gr8,gr8,cc5,0
206
        test_gr_immed   0,gr8
207
        test_gr_immed   0,gr9
208
 
209
        set_gr_immed    2,gr7           ; multiply by 0
210
        set_gr_immed    0,gr8
211
        csmul           gr7,gr8,gr8,cc5,0
212
        test_gr_immed   0,gr8
213
        test_gr_immed   0,gr9
214
 
215
        set_gr_limmed   0x3fff,0xffff,gr7       ; 31 bit result
216
        set_gr_immed    2,gr8
217
        csmul           gr7,gr8,gr8,cc5,0
218
        test_gr_immed   0,gr8
219
        test_gr_limmed  0x7fff,0xfffe,gr9
220
 
221
        set_gr_limmed   0x4000,0x0000,gr7       ; 32 bit result
222
        set_gr_immed    2,gr8
223
        csmul           gr7,gr8,gr8,cc5,0
224
        test_gr_immed   0,gr8
225
        test_gr_limmed  0x8000,0x0000,gr9
226
 
227
        set_gr_limmed   0x4000,0x0000,gr7       ; 33 bit result
228
        set_gr_immed    4,gr8
229
        csmul           gr7,gr8,gr8,cc5,0
230
        test_gr_immed   1,gr8
231
        test_gr_limmed  0x0000,0x0000,gr9
232
 
233
        set_gr_limmed   0x7fff,0xffff,gr7       ; max positive result
234
        set_gr_limmed   0x7fff,0xffff,gr8
235
        csmul           gr7,gr8,gr8,cc5,0
236
        test_gr_limmed  0x3fff,0xffff,gr8
237
        test_gr_immed   0x00000001,gr9
238
 
239
        ; Mixed operands
240
        set_gr_immed    -3,gr7          ; multiply small numbers
241
        set_gr_immed    2,gr8
242
        csmul           gr7,gr8,gr8,cc5,0
243
        test_gr_immed   -1,gr8
244
        test_gr_immed   -6,gr9
245
 
246
        set_gr_immed    3,gr7           ; multiply small numbers
247
        set_gr_immed    -2,gr8
248
        csmul           gr7,gr8,gr8,cc5,0
249
        test_gr_immed   -1,gr8
250
        test_gr_immed   -6,gr9
251
 
252
        set_gr_immed    1,gr7           ; multiply by 1
253
        set_gr_immed    -2,gr8
254
        csmul           gr7,gr8,gr8,cc5,0
255
        test_gr_immed   -1,gr8
256
        test_gr_immed   -2,gr9
257
 
258
        set_gr_immed    -2,gr7          ; multiply by 1
259
        set_gr_immed    1,gr8
260
        csmul           gr7,gr8,gr8,cc5,0
261
        test_gr_immed   -1,gr8
262
        test_gr_immed   -2,gr9
263
 
264
        set_gr_immed    0,gr7           ; multiply by 0
265
        set_gr_immed    -2,gr8
266
        csmul           gr7,gr8,gr8,cc5,0
267
        test_gr_immed   0,gr8
268
        test_gr_immed   0,gr9
269
 
270
        set_gr_immed    -2,gr7          ; multiply by 0
271
        set_gr_immed    0,gr8
272
        csmul           gr7,gr8,gr8,cc5,0
273
        test_gr_immed   0,gr8
274
        test_gr_immed   0,gr9
275
 
276
        set_gr_limmed   0x2000,0x0001,gr7       ; 31 bit result
277
        set_gr_immed    -2,gr8
278
        csmul           gr7,gr8,gr8,cc5,0
279
        test_gr_limmed  0xffff,0xffff,gr8
280
        test_gr_limmed  0xbfff,0xfffe,gr9
281
 
282
        set_gr_limmed   0x4000,0x0000,gr7       ; 32 bit result
283
        set_gr_immed    -2,gr8
284
        csmul           gr7,gr8,gr8,cc5,0
285
        test_gr_limmed  0xffff,0xffff,gr8
286
        test_gr_limmed  0x8000,0x0000,gr9
287
 
288
        set_gr_limmed   0x4000,0x0001,gr7       ; 32 bit result
289
        set_gr_immed    -2,gr8
290
        csmul           gr7,gr8,gr8,cc5,0
291
        test_gr_limmed  0xffff,0xffff,gr8
292
        test_gr_limmed  0x7fff,0xfffe,gr9
293
 
294
        set_gr_limmed   0x4000,0x0000,gr7       ; 33 bit result
295
        set_gr_immed    -4,gr8
296
        csmul           gr7,gr8,gr8,cc5,0
297
        test_gr_limmed  0xffff,0xffff,gr8
298
        test_gr_limmed  0x0000,0x0000,gr9
299
 
300
        set_gr_limmed   0x7fff,0xffff,gr7       ; max negative result
301
        set_gr_limmed   0x8000,0x0000,gr8
302
        csmul           gr7,gr8,gr8,cc5,0
303
        test_gr_limmed  0xc000,0x0000,gr8
304
        test_gr_limmed  0x8000,0x0000,gr9
305
 
306
        ; Negative operands
307
        set_gr_immed    -3,gr7          ; multiply small numbers
308
        set_gr_immed    -2,gr8
309
        csmul           gr7,gr8,gr8,cc5,0
310
        test_gr_immed   0,gr8
311
        test_gr_immed   6,gr9
312
 
313
        set_gr_immed    -1,gr7          ; multiply by 1
314
        set_gr_immed    -2,gr8
315
        csmul           gr7,gr8,gr8,cc5,0
316
        test_gr_immed   0,gr8
317
        test_gr_immed   2,gr9
318
 
319
        set_gr_immed    -2,gr7          ; multiply by 1
320
        set_gr_immed    -1,gr8
321
        csmul           gr7,gr8,gr8,cc5,0
322
        test_gr_immed   0,gr8
323
        test_gr_immed   2,gr9
324
 
325
        set_gr_limmed   0xc000,0x0001,gr7       ; 31 bit result
326
        set_gr_immed    -2,gr8
327
        csmul           gr7,gr8,gr8,cc5,0
328
        test_gr_immed   0,gr8
329
        test_gr_limmed  0x7fff,0xfffe,gr9
330
 
331
        set_gr_limmed   0xc000,0x0000,gr7       ; 32 bit result
332
        set_gr_immed    -2,gr8
333
        csmul           gr7,gr8,gr8,cc5,0
334
        test_gr_immed   0,gr8
335
        test_gr_limmed  0x8000,0x0000,gr9
336
 
337
        set_gr_limmed   0xc000,0x0000,gr7       ; 33 bit result
338
        set_gr_immed    -4,gr8
339
        csmul           gr7,gr8,gr8,cc5,0
340
        test_gr_immed   1,gr8
341
        test_gr_immed   0x00000000,gr9
342
 
343
        set_gr_limmed   0x8000,0x0001,gr7       ; almost max positive result
344
        set_gr_limmed   0x8000,0x0001,gr8
345
        csmul           gr7,gr8,gr8,cc5,0
346
        test_gr_limmed  0x3fff,0xffff,gr8
347
        test_gr_immed   0x00000001,gr9
348
 
349
 
350
        set_gr_limmed   0x8000,0x0000,gr7       ; max positive result
351
        set_gr_limmed   0x8000,0x0000,gr8
352
        csmul           gr7,gr8,gr8,cc5,0
353
        test_gr_limmed  0x4000,0x0000,gr8
354
        test_gr_immed   0x00000000,gr9
355
 
356
        ; Positive operands
357
        set_gr_immed    3,gr7           ; multiply small numbers
358
        set_gr_immed    2,gr8
359
        csmul           gr7,gr8,gr8,cc4,0
360
        test_gr_immed   2,gr8
361
        test_gr_immed   0,gr9
362
 
363
        set_gr_immed    1,gr7           ; multiply by 1
364
        set_gr_immed    2,gr8
365
        csmul           gr7,gr8,gr8,cc4,0
366
        test_gr_immed   2,gr8
367
        test_gr_immed   0,gr9
368
 
369
        set_gr_immed    2,gr7           ; multiply by 1
370
        set_gr_immed    1,gr8
371
        csmul           gr7,gr8,gr8,cc4,0
372
        test_gr_immed   1,gr8
373
        test_gr_immed   0,gr9
374
 
375
        set_gr_immed    0,gr7           ; multiply by 0
376
        set_gr_immed    2,gr8
377
        csmul           gr7,gr8,gr8,cc4,0
378
        test_gr_immed   2,gr8
379
        test_gr_immed   0,gr9
380
 
381
        set_gr_immed    2,gr7           ; multiply by 0
382
        set_gr_immed    0,gr8
383
        csmul           gr7,gr8,gr8,cc4,0
384
        test_gr_immed   0,gr8
385
        test_gr_immed   0,gr9
386
 
387
        set_gr_limmed   0x3fff,0xffff,gr7       ; 31 bit result
388
        set_gr_immed    2,gr8
389
        csmul           gr7,gr8,gr8,cc4,0
390
        test_gr_immed   2,gr8
391
        test_gr_immed   0,gr9
392
 
393
        set_gr_limmed   0x4000,0x0000,gr7       ; 32 bit result
394
        set_gr_immed    2,gr8
395
        csmul           gr7,gr8,gr8,cc4,0
396
        test_gr_immed   2,gr8
397
        test_gr_immed   0,gr9
398
 
399
        set_gr_limmed   0x4000,0x0000,gr7       ; 33 bit result
400
        set_gr_immed    4,gr8
401
        csmul           gr7,gr8,gr8,cc4,0
402
        test_gr_immed   4,gr8
403
        test_gr_immed   0,gr9
404
 
405
        set_gr_limmed   0x7fff,0xffff,gr7       ; max positive result
406
        set_gr_limmed   0x7fff,0xffff,gr8
407
        csmul           gr7,gr8,gr8,cc4,0
408
        test_gr_limmed  0x7fff,0xffff,gr8
409
        test_gr_immed   0,gr9
410
 
411
        ; Mixed operands
412
        set_gr_immed    -3,gr7          ; multiply small numbers
413
        set_gr_immed    2,gr8
414
        csmul           gr7,gr8,gr8,cc4,0
415
        test_gr_immed   2,gr8
416
        test_gr_immed   0,gr9
417
 
418
        set_gr_immed    3,gr7           ; multiply small numbers
419
        set_gr_immed    -2,gr8
420
        csmul           gr7,gr8,gr8,cc4,0
421
        test_gr_immed   -2,gr8
422
        test_gr_immed   0,gr9
423
 
424
        set_gr_immed    1,gr7           ; multiply by 1
425
        set_gr_immed    -2,gr8
426
        csmul           gr7,gr8,gr8,cc4,0
427
        test_gr_immed   -2,gr8
428
        test_gr_immed   0,gr9
429
 
430
        set_gr_immed    -2,gr7          ; multiply by 1
431
        set_gr_immed    1,gr8
432
        csmul           gr7,gr8,gr8,cc4,0
433
        test_gr_immed   1,gr8
434
        test_gr_immed   0,gr9
435
 
436
        set_gr_immed    0,gr7           ; multiply by 0
437
        set_gr_immed    -2,gr8
438
        csmul           gr7,gr8,gr8,cc4,0
439
        test_gr_immed   -2,gr8
440
        test_gr_immed   0,gr9
441
 
442
        set_gr_immed    -2,gr7          ; multiply by 0
443
        set_gr_immed    0,gr8
444
        csmul           gr7,gr8,gr8,cc4,0
445
        test_gr_immed   0,gr8
446
        test_gr_immed   0,gr9
447
 
448
        set_gr_limmed   0x2000,0x0001,gr7       ; 31 bit result
449
        set_gr_immed    -2,gr8
450
        csmul           gr7,gr8,gr8,cc4,0
451
        test_gr_immed   -2,gr8
452
        test_gr_immed   0,gr9
453
 
454
        set_gr_limmed   0x4000,0x0000,gr7       ; 32 bit result
455
        set_gr_immed    -2,gr8
456
        csmul           gr7,gr8,gr8,cc4,0
457
        test_gr_immed   -2,gr8
458
        test_gr_immed   0,gr9
459
 
460
        set_gr_limmed   0x4000,0x0001,gr7       ; 32 bit result
461
        set_gr_immed    -2,gr8
462
        csmul           gr7,gr8,gr8,cc4,0
463
        test_gr_immed   -2,gr8
464
        test_gr_immed   0,gr9
465
 
466
        set_gr_limmed   0x4000,0x0000,gr7       ; 33 bit result
467
        set_gr_immed    -4,gr8
468
        csmul           gr7,gr8,gr8,cc4,0
469
        test_gr_immed   -4,gr8
470
        test_gr_immed   0,gr9
471
 
472
        set_gr_limmed   0x7fff,0xffff,gr7       ; max negative result
473
        set_gr_limmed   0x8000,0x0000,gr8
474
        csmul           gr7,gr8,gr8,cc4,0
475
        test_gr_limmed  0x8000,0x0000,gr8
476
        test_gr_immed   0,gr9
477
 
478
        ; Negative operands
479
        set_gr_immed    -3,gr7          ; multiply small numbers
480
        set_gr_immed    -2,gr8
481
        csmul           gr7,gr8,gr8,cc4,0
482
        test_gr_immed   -2,gr8
483
        test_gr_immed   0,gr9
484
 
485
        set_gr_immed    -1,gr7          ; multiply by 1
486
        set_gr_immed    -2,gr8
487
        csmul           gr7,gr8,gr8,cc4,0
488
        test_gr_immed   -2,gr8
489
        test_gr_immed   0,gr9
490
 
491
        set_gr_immed    -2,gr7          ; multiply by 1
492
        set_gr_immed    -1,gr8
493
        csmul           gr7,gr8,gr8,cc4,0
494
        test_gr_immed   -1,gr8
495
        test_gr_immed   0,gr9
496
 
497
        set_gr_limmed   0xc000,0x0001,gr7       ; 31 bit result
498
        set_gr_immed    -2,gr8
499
        csmul           gr7,gr8,gr8,cc4,0
500
        test_gr_immed   -2,gr8
501
        test_gr_immed   0,gr9
502
 
503
        set_gr_limmed   0xc000,0x0000,gr7       ; 32 bit result
504
        set_gr_immed    -2,gr8
505
        csmul           gr7,gr8,gr8,cc4,0
506
        test_gr_immed   -2,gr8
507
        test_gr_immed   0,gr9
508
 
509
        set_gr_limmed   0xc000,0x0000,gr7       ; 33 bit result
510
        set_gr_immed    -4,gr8
511
        csmul           gr7,gr8,gr8,cc4,0
512
        test_gr_immed   -4,gr8
513
        test_gr_immed   0,gr9
514
 
515
        set_gr_limmed   0x8000,0x0001,gr7       ; almost max positive result
516
        set_gr_limmed   0x8000,0x0001,gr8
517
        csmul           gr7,gr8,gr8,cc4,0
518
        test_gr_limmed  0x8000,0x0001,gr8
519
        test_gr_immed   0,gr9
520
 
521
 
522
        set_gr_limmed   0x8000,0x0000,gr7       ; max positive result
523
        set_gr_limmed   0x8000,0x0000,gr8
524
        csmul           gr7,gr8,gr8,cc4,0
525
        test_gr_limmed  0x8000,0x0000,gr8
526
        test_gr_immed   0,gr9
527
 
528
        ; Positive operands
529
        set_gr_immed    3,gr7           ; multiply small numbers
530
        set_gr_immed    2,gr8
531
        csmul           gr7,gr8,gr8,cc5,1
532
        test_gr_immed   2,gr8
533
        test_gr_immed   0,gr9
534
 
535
        set_gr_immed    1,gr7           ; multiply by 1
536
        set_gr_immed    2,gr8
537
        csmul           gr7,gr8,gr8,cc5,1
538
        test_gr_immed   2,gr8
539
        test_gr_immed   0,gr9
540
 
541
        set_gr_immed    2,gr7           ; multiply by 1
542
        set_gr_immed    1,gr8
543
        csmul           gr7,gr8,gr8,cc5,1
544
        test_gr_immed   1,gr8
545
        test_gr_immed   0,gr9
546
 
547
        set_gr_immed    0,gr7           ; multiply by 0
548
        set_gr_immed    2,gr8
549
        csmul           gr7,gr8,gr8,cc5,1
550
        test_gr_immed   2,gr8
551
        test_gr_immed   0,gr9
552
 
553
        set_gr_immed    2,gr7           ; multiply by 0
554
        set_gr_immed    0,gr8
555
        csmul           gr7,gr8,gr8,cc5,1
556
        test_gr_immed   0,gr8
557
        test_gr_immed   0,gr9
558
 
559
        set_gr_limmed   0x3fff,0xffff,gr7       ; 31 bit result
560
        set_gr_immed    2,gr8
561
        csmul           gr7,gr8,gr8,cc5,1
562
        test_gr_immed   2,gr8
563
        test_gr_immed   0,gr9
564
 
565
        set_gr_limmed   0x4000,0x0000,gr7       ; 32 bit result
566
        set_gr_immed    2,gr8
567
        csmul           gr7,gr8,gr8,cc5,1
568
        test_gr_immed   2,gr8
569
        test_gr_immed   0,gr9
570
 
571
        set_gr_limmed   0x4000,0x0000,gr7       ; 33 bit result
572
        set_gr_immed    4,gr8
573
        csmul           gr7,gr8,gr8,cc5,1
574
        test_gr_immed   4,gr8
575
        test_gr_immed   0,gr9
576
 
577
        set_gr_limmed   0x7fff,0xffff,gr7       ; max positive result
578
        set_gr_limmed   0x7fff,0xffff,gr8
579
        csmul           gr7,gr8,gr8,cc5,1
580
        test_gr_limmed  0x7fff,0xffff,gr8
581
        test_gr_immed   0,gr9
582
 
583
        ; Mixed operands
584
        set_gr_immed    -3,gr7          ; multiply small numbers
585
        set_gr_immed    2,gr8
586
        csmul           gr7,gr8,gr8,cc5,1
587
        test_gr_immed   2,gr8
588
        test_gr_immed   0,gr9
589
 
590
        set_gr_immed    3,gr7           ; multiply small numbers
591
        set_gr_immed    -2,gr8
592
        csmul           gr7,gr8,gr8,cc5,1
593
        test_gr_immed   -2,gr8
594
        test_gr_immed   0,gr9
595
 
596
        set_gr_immed    1,gr7           ; multiply by 1
597
        set_gr_immed    -2,gr8
598
        csmul           gr7,gr8,gr8,cc5,1
599
        test_gr_immed   -2,gr8
600
        test_gr_immed   0,gr9
601
 
602
        set_gr_immed    -2,gr7          ; multiply by 1
603
        set_gr_immed    1,gr8
604
        csmul           gr7,gr8,gr8,cc5,1
605
        test_gr_immed   1,gr8
606
        test_gr_immed   0,gr9
607
 
608
        set_gr_immed    0,gr7           ; multiply by 0
609
        set_gr_immed    -2,gr8
610
        csmul           gr7,gr8,gr8,cc5,1
611
        test_gr_immed   -2,gr8
612
        test_gr_immed   0,gr9
613
 
614
        set_gr_immed    -2,gr7          ; multiply by 0
615
        set_gr_immed    0,gr8
616
        csmul           gr7,gr8,gr8,cc5,1
617
        test_gr_immed   0,gr8
618
        test_gr_immed   0,gr9
619
 
620
        set_gr_limmed   0x2000,0x0001,gr7       ; 31 bit result
621
        set_gr_immed    -2,gr8
622
        csmul           gr7,gr8,gr8,cc5,1
623
        test_gr_immed   -2,gr8
624
        test_gr_immed   0,gr9
625
 
626
        set_gr_limmed   0x4000,0x0000,gr7       ; 32 bit result
627
        set_gr_immed    -2,gr8
628
        csmul           gr7,gr8,gr8,cc5,1
629
        test_gr_immed   -2,gr8
630
        test_gr_immed   0,gr9
631
 
632
        set_gr_limmed   0x4000,0x0001,gr7       ; 32 bit result
633
        set_gr_immed    -2,gr8
634
        csmul           gr7,gr8,gr8,cc5,1
635
        test_gr_immed   -2,gr8
636
        test_gr_immed   0,gr9
637
 
638
        set_gr_limmed   0x4000,0x0000,gr7       ; 33 bit result
639
        set_gr_immed    -4,gr8
640
        csmul           gr7,gr8,gr8,cc5,1
641
        test_gr_immed   -4,gr8
642
        test_gr_immed   0,gr9
643
 
644
        set_gr_limmed   0x7fff,0xffff,gr7       ; max negative result
645
        set_gr_limmed   0x8000,0x0000,gr8
646
        csmul           gr7,gr8,gr8,cc5,1
647
        test_gr_limmed  0x8000,0x0000,gr8
648
        test_gr_immed   0,gr9
649
 
650
        ; Negative operands
651
        set_gr_immed    -3,gr7          ; multiply small numbers
652
        set_gr_immed    -2,gr8
653
        csmul           gr7,gr8,gr8,cc5,1
654
        test_gr_immed   -2,gr8
655
        test_gr_immed   0,gr9
656
 
657
        set_gr_immed    -1,gr7          ; multiply by 1
658
        set_gr_immed    -2,gr8
659
        csmul           gr7,gr8,gr8,cc5,1
660
        test_gr_immed   -2,gr8
661
        test_gr_immed   0,gr9
662
 
663
        set_gr_immed    -2,gr7          ; multiply by 1
664
        set_gr_immed    -1,gr8
665
        csmul           gr7,gr8,gr8,cc5,1
666
        test_gr_immed   -1,gr8
667
        test_gr_immed   0,gr9
668
 
669
        set_gr_limmed   0xc000,0x0001,gr7       ; 31 bit result
670
        set_gr_immed    -2,gr8
671
        csmul           gr7,gr8,gr8,cc5,1
672
        test_gr_immed   -2,gr8
673
        test_gr_immed   0,gr9
674
 
675
        set_gr_limmed   0xc000,0x0000,gr7       ; 32 bit result
676
        set_gr_immed    -2,gr8
677
        csmul           gr7,gr8,gr8,cc5,1
678
        test_gr_immed   -2,gr8
679
        test_gr_immed   0,gr9
680
 
681
        set_gr_limmed   0xc000,0x0000,gr7       ; 33 bit result
682
        set_gr_immed    -4,gr8
683
        csmul           gr7,gr8,gr8,cc5,1
684
        test_gr_immed   -4,gr8
685
        test_gr_immed   0,gr9
686
 
687
        set_gr_limmed   0x8000,0x0001,gr7       ; almost max positive result
688
        set_gr_limmed   0x8000,0x0001,gr8
689
        csmul           gr7,gr8,gr8,cc5,1
690
        test_gr_limmed  0x8000,0x0001,gr8
691
        test_gr_immed   0,gr9
692
 
693
 
694
        set_gr_limmed   0x8000,0x0000,gr7       ; max positive result
695
        set_gr_limmed   0x8000,0x0000,gr8
696
        csmul           gr7,gr8,gr8,cc5,1
697
        test_gr_limmed  0x8000,0x0000,gr8
698
        test_gr_immed   0,gr9
699
 
700
        ; Positive operands
701
        set_gr_immed    3,gr7           ; multiply small numbers
702
        set_gr_immed    2,gr8
703
        csmul           gr7,gr8,gr8,cc6,0
704
        test_gr_immed   2,gr8
705
        test_gr_immed   0,gr9
706
 
707
        set_gr_immed    1,gr7           ; multiply by 1
708
        set_gr_immed    2,gr8
709
        csmul           gr7,gr8,gr8,cc6,0
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
        csmul           gr7,gr8,gr8,cc6,0
716
        test_gr_immed   1,gr8
717
        test_gr_immed   0,gr9
718
 
719
        set_gr_immed    0,gr7           ; multiply by 0
720
        set_gr_immed    2,gr8
721
        csmul           gr7,gr8,gr8,cc6,0
722
        test_gr_immed   2,gr8
723
        test_gr_immed   0,gr9
724
 
725
        set_gr_immed    2,gr7           ; multiply by 0
726
        set_gr_immed    0,gr8
727
        csmul           gr7,gr8,gr8,cc6,0
728
        test_gr_immed   0,gr8
729
        test_gr_immed   0,gr9
730
 
731
        set_gr_limmed   0x3fff,0xffff,gr7       ; 31 bit result
732
        set_gr_immed    2,gr8
733
        csmul           gr7,gr8,gr8,cc6,0
734
        test_gr_immed   2,gr8
735
        test_gr_immed   0,gr9
736
 
737
        set_gr_limmed   0x4000,0x0000,gr7       ; 32 bit result
738
        set_gr_immed    2,gr8
739
        csmul           gr7,gr8,gr8,cc6,0
740
        test_gr_immed   2,gr8
741
        test_gr_immed   0,gr9
742
 
743
        set_gr_limmed   0x4000,0x0000,gr7       ; 33 bit result
744
        set_gr_immed    4,gr8
745
        csmul           gr7,gr8,gr8,cc6,0
746
        test_gr_immed   4,gr8
747
        test_gr_immed   0,gr9
748
 
749
        set_gr_limmed   0x7fff,0xffff,gr7       ; max positive result
750
        set_gr_limmed   0x7fff,0xffff,gr8
751
        csmul           gr7,gr8,gr8,cc6,0
752
        test_gr_limmed  0x7fff,0xffff,gr8
753
        test_gr_immed   0,gr9
754
 
755
        ; Mixed operands
756
        set_gr_immed    -3,gr7          ; multiply small numbers
757
        set_gr_immed    2,gr8
758
        csmul           gr7,gr8,gr8,cc6,0
759
        test_gr_immed   2,gr8
760
        test_gr_immed   0,gr9
761
 
762
        set_gr_immed    3,gr7           ; multiply small numbers
763
        set_gr_immed    -2,gr8
764
        csmul           gr7,gr8,gr8,cc6,0
765
        test_gr_immed   -2,gr8
766
        test_gr_immed   0,gr9
767
 
768
        set_gr_immed    1,gr7           ; multiply by 1
769
        set_gr_immed    -2,gr8
770
        csmul           gr7,gr8,gr8,cc6,0
771
        test_gr_immed   -2,gr8
772
        test_gr_immed   0,gr9
773
 
774
        set_gr_immed    -2,gr7          ; multiply by 1
775
        set_gr_immed    1,gr8
776
        csmul           gr7,gr8,gr8,cc6,0
777
        test_gr_immed   1,gr8
778
        test_gr_immed   0,gr9
779
 
780
        set_gr_immed    0,gr7           ; multiply by 0
781
        set_gr_immed    -2,gr8
782
        csmul           gr7,gr8,gr8,cc6,0
783
        test_gr_immed   -2,gr8
784
        test_gr_immed   0,gr9
785
 
786
        set_gr_immed    -2,gr7          ; multiply by 0
787
        set_gr_immed    0,gr8
788
        csmul           gr7,gr8,gr8,cc6,0
789
        test_gr_immed   0,gr8
790
        test_gr_immed   0,gr9
791
 
792
        set_gr_limmed   0x2000,0x0001,gr7       ; 31 bit result
793
        set_gr_immed    -2,gr8
794
        csmul           gr7,gr8,gr8,cc6,0
795
        test_gr_immed   -2,gr8
796
        test_gr_immed   0,gr9
797
 
798
        set_gr_limmed   0x4000,0x0000,gr7       ; 32 bit result
799
        set_gr_immed    -2,gr8
800
        csmul           gr7,gr8,gr8,cc6,0
801
        test_gr_immed   -2,gr8
802
        test_gr_immed   0,gr9
803
 
804
        set_gr_limmed   0x4000,0x0001,gr7       ; 32 bit result
805
        set_gr_immed    -2,gr8
806
        csmul           gr7,gr8,gr8,cc6,0
807
        test_gr_immed   -2,gr8
808
        test_gr_immed   0,gr9
809
 
810
        set_gr_limmed   0x4000,0x0000,gr7       ; 33 bit result
811
        set_gr_immed    -4,gr8
812
        csmul           gr7,gr8,gr8,cc6,0
813
        test_gr_immed   -4,gr8
814
        test_gr_immed   0,gr9
815
 
816
        set_gr_limmed   0x7fff,0xffff,gr7       ; max negative result
817
        set_gr_limmed   0x8000,0x0000,gr8
818
        csmul           gr7,gr8,gr8,cc6,0
819
        test_gr_limmed  0x8000,0x0000,gr8
820
        test_gr_immed   0,gr9
821
 
822
        ; Negative operands
823
        set_gr_immed    -3,gr7          ; multiply small numbers
824
        set_gr_immed    -2,gr8
825
        csmul           gr7,gr8,gr8,cc6,0
826
        test_gr_immed   -2,gr8
827
        test_gr_immed   0,gr9
828
 
829
        set_gr_immed    -1,gr7          ; multiply by 1
830
        set_gr_immed    -2,gr8
831
        csmul           gr7,gr8,gr8,cc6,0
832
        test_gr_immed   -2,gr8
833
        test_gr_immed   0,gr9
834
 
835
        set_gr_immed    -2,gr7          ; multiply by 1
836
        set_gr_immed    -1,gr8
837
        csmul           gr7,gr8,gr8,cc6,0
838
        test_gr_immed   -1,gr8
839
        test_gr_immed   0,gr9
840
 
841
        set_gr_limmed   0xc000,0x0001,gr7       ; 31 bit result
842
        set_gr_immed    -2,gr8
843
        csmul           gr7,gr8,gr8,cc6,0
844
        test_gr_immed   -2,gr8
845
        test_gr_immed   0,gr9
846
 
847
        set_gr_limmed   0xc000,0x0000,gr7       ; 32 bit result
848
        set_gr_immed    -2,gr8
849
        csmul           gr7,gr8,gr8,cc6,0
850
        test_gr_immed   -2,gr8
851
        test_gr_immed   0,gr9
852
 
853
        set_gr_limmed   0xc000,0x0000,gr7       ; 33 bit result
854
        set_gr_immed    -4,gr8
855
        csmul           gr7,gr8,gr8,cc6,0
856
        test_gr_immed   -4,gr8
857
        test_gr_immed   0,gr9
858
 
859
        set_gr_limmed   0x8000,0x0001,gr7       ; almost max positive result
860
        set_gr_limmed   0x8000,0x0001,gr8
861
        csmul           gr7,gr8,gr8,cc6,0
862
        test_gr_limmed  0x8000,0x0001,gr8
863
        test_gr_immed   0,gr9
864
 
865
 
866
        set_gr_limmed   0x8000,0x0000,gr7       ; max positive result
867
        set_gr_limmed   0x8000,0x0000,gr8
868
        csmul           gr7,gr8,gr8,cc6,0
869
        test_gr_limmed  0x8000,0x0000,gr8
870
        test_gr_immed   0,gr9
871
 
872
        ; Positive operands
873
        set_gr_immed    3,gr7           ; multiply small numbers
874
        set_gr_immed    2,gr8
875
        csmul           gr7,gr8,gr8,cc7,1
876
        test_gr_immed   2,gr8
877
        test_gr_immed   0,gr9
878
 
879
        set_gr_immed    1,gr7           ; multiply by 1
880
        set_gr_immed    2,gr8
881
        csmul           gr7,gr8,gr8,cc7,1
882
        test_gr_immed   2,gr8
883
        test_gr_immed   0,gr9
884
 
885
        set_gr_immed    2,gr7           ; multiply by 1
886
        set_gr_immed    1,gr8
887
        csmul           gr7,gr8,gr8,cc7,1
888
        test_gr_immed   1,gr8
889
        test_gr_immed   0,gr9
890
 
891
        set_gr_immed    0,gr7           ; multiply by 0
892
        set_gr_immed    2,gr8
893
        csmul           gr7,gr8,gr8,cc7,1
894
        test_gr_immed   2,gr8
895
        test_gr_immed   0,gr9
896
 
897
        set_gr_immed    2,gr7           ; multiply by 0
898
        set_gr_immed    0,gr8
899
        csmul           gr7,gr8,gr8,cc7,1
900
        test_gr_immed   0,gr8
901
        test_gr_immed   0,gr9
902
 
903
        set_gr_limmed   0x3fff,0xffff,gr7       ; 31 bit result
904
        set_gr_immed    2,gr8
905
        csmul           gr7,gr8,gr8,cc7,1
906
        test_gr_immed   2,gr8
907
        test_gr_immed   0,gr9
908
 
909
        set_gr_limmed   0x4000,0x0000,gr7       ; 32 bit result
910
        set_gr_immed    2,gr8
911
        csmul           gr7,gr8,gr8,cc7,1
912
        test_gr_immed   2,gr8
913
        test_gr_immed   0,gr9
914
 
915
        set_gr_limmed   0x4000,0x0000,gr7       ; 33 bit result
916
        set_gr_immed    4,gr8
917
        csmul           gr7,gr8,gr8,cc7,1
918
        test_gr_immed   4,gr8
919
        test_gr_immed   0,gr9
920
 
921
        set_gr_limmed   0x7fff,0xffff,gr7       ; max positive result
922
        set_gr_limmed   0x7fff,0xffff,gr8
923
        csmul           gr7,gr8,gr8,cc7,1
924
        test_gr_limmed  0x7fff,0xffff,gr8
925
        test_gr_immed   0,gr9
926
 
927
        ; Mixed operands
928
        set_gr_immed    -3,gr7          ; multiply small numbers
929
        set_gr_immed    2,gr8
930
        csmul           gr7,gr8,gr8,cc7,1
931
        test_gr_immed   2,gr8
932
        test_gr_immed   0,gr9
933
 
934
        set_gr_immed    3,gr7           ; multiply small numbers
935
        set_gr_immed    -2,gr8
936
        csmul           gr7,gr8,gr8,cc7,1
937
        test_gr_immed   -2,gr8
938
        test_gr_immed   0,gr9
939
 
940
        set_gr_immed    1,gr7           ; multiply by 1
941
        set_gr_immed    -2,gr8
942
        csmul           gr7,gr8,gr8,cc7,1
943
        test_gr_immed   -2,gr8
944
        test_gr_immed   0,gr9
945
 
946
        set_gr_immed    -2,gr7          ; multiply by 1
947
        set_gr_immed    1,gr8
948
        csmul           gr7,gr8,gr8,cc7,1
949
        test_gr_immed   1,gr8
950
        test_gr_immed   0,gr9
951
 
952
        set_gr_immed    0,gr7           ; multiply by 0
953
        set_gr_immed    -2,gr8
954
        csmul           gr7,gr8,gr8,cc7,1
955
        test_gr_immed   -2,gr8
956
        test_gr_immed   0,gr9
957
 
958
        set_gr_immed    -2,gr7          ; multiply by 0
959
        set_gr_immed    0,gr8
960
        csmul           gr7,gr8,gr8,cc7,1
961
        test_gr_immed   0,gr8
962
        test_gr_immed   0,gr9
963
 
964
        set_gr_limmed   0x2000,0x0001,gr7       ; 31 bit result
965
        set_gr_immed    -2,gr8
966
        csmul           gr7,gr8,gr8,cc7,1
967
        test_gr_immed   -2,gr8
968
        test_gr_immed   0,gr9
969
 
970
        set_gr_limmed   0x4000,0x0000,gr7       ; 32 bit result
971
        set_gr_immed    -2,gr8
972
        csmul           gr7,gr8,gr8,cc7,1
973
        test_gr_immed   -2,gr8
974
        test_gr_immed   0,gr9
975
 
976
        set_gr_limmed   0x4000,0x0001,gr7       ; 32 bit result
977
        set_gr_immed    -2,gr8
978
        csmul           gr7,gr8,gr8,cc7,1
979
        test_gr_immed   -2,gr8
980
        test_gr_immed   0,gr9
981
 
982
        set_gr_limmed   0x4000,0x0000,gr7       ; 33 bit result
983
        set_gr_immed    -4,gr8
984
        csmul           gr7,gr8,gr8,cc7,1
985
        test_gr_immed   -4,gr8
986
        test_gr_immed   0,gr9
987
 
988
        set_gr_limmed   0x7fff,0xffff,gr7       ; max negative result
989
        set_gr_limmed   0x8000,0x0000,gr8
990
        csmul           gr7,gr8,gr8,cc7,1
991
        test_gr_limmed  0x8000,0x0000,gr8
992
        test_gr_immed   0,gr9
993
 
994
        ; Negative operands
995
        set_gr_immed    -3,gr7          ; multiply small numbers
996
        set_gr_immed    -2,gr8
997
        csmul           gr7,gr8,gr8,cc7,1
998
        test_gr_immed   -2,gr8
999
        test_gr_immed   0,gr9
1000
 
1001
        set_gr_immed    -1,gr7          ; multiply by 1
1002
        set_gr_immed    -2,gr8
1003
        csmul           gr7,gr8,gr8,cc7,1
1004
        test_gr_immed   -2,gr8
1005
        test_gr_immed   0,gr9
1006
 
1007
        set_gr_immed    -2,gr7          ; multiply by 1
1008
        set_gr_immed    -1,gr8
1009
        csmul           gr7,gr8,gr8,cc7,1
1010
        test_gr_immed   -1,gr8
1011
        test_gr_immed   0,gr9
1012
 
1013
        set_gr_limmed   0xc000,0x0001,gr7       ; 31 bit result
1014
        set_gr_immed    -2,gr8
1015
        csmul           gr7,gr8,gr8,cc7,1
1016
        test_gr_immed   -2,gr8
1017
        test_gr_immed   0,gr9
1018
 
1019
        set_gr_limmed   0xc000,0x0000,gr7       ; 32 bit result
1020
        set_gr_immed    -2,gr8
1021
        csmul           gr7,gr8,gr8,cc7,1
1022
        test_gr_immed   -2,gr8
1023
        test_gr_immed   0,gr9
1024
 
1025
        set_gr_limmed   0xc000,0x0000,gr7       ; 33 bit result
1026
        set_gr_immed    -4,gr8
1027
        csmul           gr7,gr8,gr8,cc7,1
1028
        test_gr_immed   -4,gr8
1029
        test_gr_immed   0,gr9
1030
 
1031
        set_gr_limmed   0x8000,0x0001,gr7       ; almost max positive result
1032
        set_gr_limmed   0x8000,0x0001,gr8
1033
        csmul           gr7,gr8,gr8,cc7,1
1034
        test_gr_limmed  0x8000,0x0001,gr8
1035
        test_gr_immed   0,gr9
1036
 
1037
 
1038
        set_gr_limmed   0x8000,0x0000,gr7       ; max positive result
1039
        set_gr_limmed   0x8000,0x0000,gr8
1040
        csmul           gr7,gr8,gr8,cc7,1
1041
        test_gr_limmed  0x8000,0x0000,gr8
1042
        test_gr_immed   0,gr9
1043
 
1044
        pass

powered by: WebSVN 2.1.0

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