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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gdb-6.8/] [sim/] [testsuite/] [sim/] [frv/] [fr400/] [smass.cgs] - Blame information for rev 840

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 24 jeremybenn
# frv testcase for smass $GRi,$GRj
2
# mach: fr405 fr450
3
 
4
        .include "../testutils.inc"
5
 
6
        start
7
 
8
        .global smass
9
smass1:
10
        ; Positive operands
11
        set_gr_immed    3,gr7           ; multiply small numbers
12
        set_gr_immed    2,gr8
13
        set_spr_immed   0,iacc0h
14
        set_spr_immed   1,iacc0l
15
        smass           gr7,gr8
16
        test_gr_immed   3,gr7
17
        test_gr_immed   2,gr8
18
        test_spr_immed  7,iacc0l        ; result 3*2+1
19
        test_spr_immed  0,iacc0h
20
smass2:
21
        set_gr_immed    1,gr7           ; multiply by 1
22
        set_gr_immed    2,gr8
23
        set_spr_immed   0,iacc0h
24
        set_spr_immed   1,iacc0l
25
        smass           gr7,gr8
26
        test_gr_immed   1,gr7
27
        test_gr_immed   2,gr8
28
        test_spr_immed  3,iacc0l        ; result 1*2+1
29
        test_spr_immed  0,iacc0h
30
smass3:
31
        set_gr_immed    2,gr7           ; multiply by 1
32
        set_gr_immed    1,gr8
33
        set_spr_immed   0,iacc0h
34
        set_spr_immed   1,iacc0l
35
        smass           gr7,gr8
36
        test_gr_immed   1,gr8
37
        test_gr_immed   2,gr7
38
        test_spr_immed  3,iacc0l        ; result 2*1+1
39
        test_spr_immed  0,iacc0h
40
smass4:
41
        set_gr_immed    0,gr7           ; multiply by 0
42
        set_gr_immed    2,gr8
43
        set_spr_immed   0,iacc0h
44
        set_spr_immed   1,iacc0l
45
        smass           gr7,gr8
46
        test_gr_immed   2,gr8
47
        test_gr_immed   0,gr7
48
        test_spr_immed  1,iacc0l        ; result 0*2+1
49
        test_spr_immed  0,iacc0h
50
smass5:
51
        set_gr_immed    2,gr7           ; multiply by 0
52
        set_gr_immed    0,gr8
53
        set_spr_immed   0,iacc0h
54
        set_spr_immed   1,iacc0l
55
        smass           gr7,gr8
56
        test_gr_immed   0,gr8
57
        test_gr_immed   2,gr7
58
        test_spr_immed  1,iacc0l        ; result 2*0+1
59
        test_spr_immed  0,iacc0h
60
smass6:
61
        set_gr_limmed   0x3fff,0xffff,gr7       ; 31 bit result
62
        set_gr_immed    2,gr8
63
        set_spr_immed   0,iacc0h
64
        set_spr_immed   1,iacc0l
65
        smass           gr7,gr8
66
        test_gr_immed   2,gr8
67
        test_gr_limmed  0x3fff,0xffff,gr7
68
        test_spr_limmed 0x7fff,0xffff,iacc0l    ; 3fffffff*2+1
69
        test_spr_immed  0,iacc0h
70
smass7:
71
        set_gr_limmed   0x4000,0x0000,gr7       ; 32 bit result
72
        set_gr_immed    2,gr8
73
        set_spr_immed   0,iacc0h
74
        set_spr_immed   1,iacc0l
75
        smass           gr7,gr8
76
        test_gr_immed   2,gr8
77
        test_gr_limmed  0x4000,0x0000,gr7
78
        test_spr_limmed 0x8000,0x0001,iacc0l    ; 40000000*2+1
79
        test_spr_immed  0,iacc0h
80
smass8:
81
        set_gr_limmed   0x4000,0x0000,gr7       ; 33 bit result
82
        set_gr_immed    4,gr8
83
        set_spr_immed   0,iacc0h
84
        set_spr_immed   1,iacc0l
85
        smass           gr7,gr8
86
        test_gr_immed   4,gr8
87
        test_gr_limmed  0x4000,0x0000,gr7
88
        test_spr_immed  1,iacc0l                ; 40000000*4+1
89
        test_spr_immed  1,iacc0h
90
smass9:
91
        set_gr_limmed   0x7fff,0xffff,gr7       ; max positive result
92
        set_gr_limmed   0x7fff,0xffff,gr8
93
        set_spr_immed   0,iacc0h
94
        set_spr_immed   1,iacc0l
95
        smass           gr7,gr8
96
        test_gr_limmed  0x7fff,0xffff,gr8
97
        test_gr_limmed  0x7fff,0xffff,gr7
98
        test_spr_immed  0x00000002,iacc0l       ; 7fffffff*7fffffff+1
99
        test_spr_limmed 0x3fff,0xffff,iacc0h
100
smass10:
101
        ; Mixed operands
102
        set_gr_immed    -3,gr7          ; multiply small numbers
103
        set_gr_immed    2,gr8
104
        set_spr_immed   0,iacc0h
105
        set_spr_immed   1,iacc0l
106
        smass           gr7,gr8
107
        test_gr_immed   2,gr8
108
        test_gr_immed   -3,gr7
109
        test_spr_immed  -5,iacc0l       ; -3*2+1
110
        test_spr_immed  -1,iacc0h
111
smass11:
112
        set_gr_immed    3,gr7           ; multiply small numbers
113
        set_gr_immed    -2,gr8
114
        set_spr_immed   0,iacc0h
115
        set_spr_immed   1,iacc0l
116
        smass           gr7,gr8
117
        test_gr_immed   -2,gr8
118
        test_gr_immed   3,gr7
119
        test_spr_immed  -5,iacc0l       ; 3*-2+1
120
        test_spr_immed  -1,iacc0h
121
smass12:
122
        set_gr_immed    1,gr7           ; multiply by 1
123
        set_gr_immed    -2,gr8
124
        set_spr_immed   0,iacc0h
125
        set_spr_immed   1,iacc0l
126
        smass           gr7,gr8
127
        test_gr_immed   -2,gr8
128
        test_gr_immed   1,gr7
129
        test_spr_immed  -1,iacc0l       ; 1*-2+1
130
        test_spr_immed  -1,iacc0h
131
smass13:
132
        set_gr_immed    -2,gr7          ; multiply by 1
133
        set_gr_immed    1,gr8
134
        set_spr_immed   0,iacc0h
135
        set_spr_immed   1,iacc0l
136
        smass           gr7,gr8
137
        test_gr_immed   1,gr8
138
        test_gr_immed   -2,gr7
139
        test_spr_immed  -1,iacc0l       ; -2*1+1
140
        test_spr_immed  -1,iacc0h
141
smass14:
142
        set_gr_immed    0,gr7           ; multiply by 0
143
        set_gr_immed    -2,gr8
144
        set_spr_immed   0,iacc0h
145
        set_spr_immed   1,iacc0l
146
        smass           gr7,gr8
147
        test_gr_immed   -2,gr8
148
        test_gr_immed   0,gr7
149
        test_spr_immed  1,iacc0l        ; 0*-2+1
150
        test_spr_immed  0,iacc0h
151
smass15:
152
        set_gr_immed    -2,gr7          ; multiply by 0
153
        set_gr_immed    0,gr8
154
        set_spr_immed   0,iacc0h
155
        set_spr_immed   1,iacc0l
156
        smass           gr7,gr8
157
        test_gr_immed   0,gr8
158
        test_gr_immed   -2,gr7
159
        test_spr_immed  1,iacc0l        ; -2*0+1
160
        test_spr_immed  0,iacc0h
161
smass16:
162
        set_gr_limmed   0x2000,0x0001,gr7       ; 31 bit result
163
        set_gr_immed    -2,gr8
164
        set_spr_immed   0,iacc0h
165
        set_spr_immed   1,iacc0l
166
        smass           gr7,gr8
167
        test_gr_immed   -2,gr8
168
        test_gr_limmed  0x2000,0x0001,gr7
169
        test_spr_limmed 0xbfff,0xffff,iacc0l    ; 20000001*-2+1
170
        test_spr_limmed 0xffff,0xffff,iacc0h
171
smass17:
172
        set_gr_limmed   0x4000,0x0000,gr7       ; 32 bit result
173
        set_gr_immed    -2,gr8
174
        set_spr_immed   0,iacc0h
175
        set_spr_immed   1,iacc0l
176
        smass           gr7,gr8
177
        test_gr_immed   -2,gr8
178
        test_gr_limmed  0x4000,0x0000,gr7
179
        test_spr_limmed 0x8000,0x0001,iacc0l    ; 40000000*-2+1
180
        test_spr_limmed 0xffff,0xffff,iacc0h
181
smass18:
182
        set_gr_limmed   0x4000,0x0001,gr7       ; 32 bit result
183
        set_gr_immed    -2,gr8
184
        set_spr_immed   0,iacc0h
185
        set_spr_immed   1,iacc0l
186
        smass           gr7,gr8
187
        test_gr_immed   -2,gr8
188
        test_gr_limmed  0x4000,0x0001,gr7
189
        test_spr_limmed 0x7fff,0xffff,iacc0l    ; 40000001*-2+1
190
        test_spr_limmed 0xffff,0xffff,iacc0h
191
smass19:
192
        set_gr_limmed   0x4000,0x0000,gr7       ; 33 bit result
193
        set_gr_immed    -4,gr8
194
        set_spr_immed   0,iacc0h
195
        set_spr_immed   1,iacc0l
196
        smass           gr7,gr8
197
        test_gr_immed   -4,gr8
198
        test_gr_limmed  0x4000,0x0000,gr7
199
        test_spr_limmed 0x0000,0x0001,iacc0l    ; 40000000*-4+1
200
        test_spr_limmed 0xffff,0xffff,iacc0h
201
smass20:
202
        set_gr_limmed   0x7fff,0xffff,gr7       ; max negative result
203
        set_gr_limmed   0x8000,0x0000,gr8
204
        set_spr_immed   0,iacc0h
205
        set_spr_immed   1,iacc0l
206
        smass           gr7,gr8
207
        test_gr_limmed  0x8000,0x0000,gr8
208
        test_gr_limmed  0x7fff,0xffff,gr7
209
        test_spr_limmed 0x8000,0x0001,iacc0l    ; 7fffffff*80000000+1
210
        test_spr_limmed 0xc000,0x0000,iacc0h
211
smass21:
212
        ; Negative operands
213
        set_gr_immed    -3,gr7          ; multiply small numbers
214
        set_gr_immed    -2,gr8
215
        set_spr_immed   0,iacc0h
216
        set_spr_immed   1,iacc0l
217
        smass           gr7,gr8
218
        test_gr_immed   -2,gr8
219
        test_gr_immed   -3,gr7
220
        test_spr_immed  7,iacc0l        ; -3*-2+1
221
        test_spr_immed  0,iacc0h
222
smass22:
223
        set_gr_immed    -1,gr7          ; multiply by 1
224
        set_gr_immed    -2,gr8
225
        set_spr_immed   0,iacc0h
226
        set_spr_immed   1,iacc0l
227
        smass           gr7,gr8
228
        test_gr_immed   -2,gr8
229
        test_gr_immed   -1,gr7
230
        test_spr_immed  3,iacc0l        ; -1*-2+1
231
        test_spr_immed  0,iacc0h
232
smass23:
233
        set_gr_immed    -2,gr7          ; multiply by 1
234
        set_gr_immed    -1,gr8
235
        set_spr_immed   0,iacc0h
236
        set_spr_immed   1,iacc0l
237
        smass           gr7,gr8
238
        test_gr_immed   -1,gr8
239
        test_gr_immed   -2,gr7
240
        test_spr_immed  3,iacc0l        ; -2*-1+1
241
        test_spr_immed  0,iacc0h
242
smass24:
243
        set_gr_limmed   0xc000,0x0001,gr7       ; 31 bit result
244
        set_gr_immed    -2,gr8
245
        set_spr_immed   0,iacc0h
246
        set_spr_immed   1,iacc0l
247
        smass           gr7,gr8
248
        test_gr_immed   -2,gr8
249
        test_gr_limmed  0xc000,0x0001,gr7
250
        test_spr_limmed 0x7fff,0xffff,iacc0l    ; c0000001*-2+1
251
        test_spr_immed  0,iacc0h
252
smass25:
253
        set_gr_limmed   0xc000,0x0000,gr7       ; 32 bit result
254
        set_gr_immed    -2,gr8
255
        set_spr_immed   0,iacc0h
256
        set_spr_immed   1,iacc0l
257
        smass           gr7,gr8
258
        test_gr_immed   -2,gr8
259
        test_gr_limmed  0xc000,0x0000,gr7
260
        test_spr_limmed 0x8000,0x0001,iacc0l    ; c0000000*-2+1
261
        test_spr_immed  0,iacc0h
262
smass26:
263
        set_gr_limmed   0xc000,0x0000,gr7       ; 33 bit result
264
        set_gr_immed    -4,gr8
265
        set_spr_immed   0,iacc0h
266
        set_spr_immed   1,iacc0l
267
        smass           gr7,gr8
268
        test_gr_immed   -4,gr8
269
        test_gr_limmed  0xc000,0x0000,gr7
270
        test_spr_immed  0x00000001,iacc0l       ; c0000000*-4+1
271
        test_spr_immed  1,iacc0h
272
smass27:
273
        set_gr_limmed   0x8000,0x0001,gr7       ; almost max positive result
274
        set_gr_limmed   0x8000,0x0001,gr8
275
        set_spr_immed   0,iacc0h
276
        set_spr_immed   1,iacc0l
277
        smass           gr7,gr8
278
        test_gr_limmed  0x8000,0x0001,gr8
279
        test_gr_limmed  0x8000,0x0001,gr7
280
        test_spr_immed  0x00000002,iacc0l       ; 80000001*80000001+1
281
        test_spr_limmed 0x3fff,0xffff,iacc0h
282
smass28:
283
        set_gr_limmed   0x8000,0x0000,gr7       ; max positive result
284
        set_gr_limmed   0x8000,0x0000,gr8
285
        set_spr_immed   0,iacc0h
286
        set_spr_immed   1,iacc0l
287
        smass           gr7,gr8
288
        test_gr_limmed  0x8000,0x0000,gr8
289
        test_gr_limmed  0x8000,0x0000,gr7
290
        test_spr_immed  0x00000001,iacc0l       ; 80000000*80000000+1
291
        test_spr_limmed 0x4000,0x0000,iacc0h
292
 
293
smass29:
294
        set_gr_limmed   0x7fff,0xffff,gr7       ; not quite overflow (pos)
295
        set_gr_limmed   0x7fff,0xffff,gr8
296
        set_spr_limmed  0xffff,0xfffe,iacc0l
297
        set_spr_limmed  0x4000,0x0000,iacc0h
298
        smass           gr7,gr8
299
        test_gr_limmed  0x7fff,0xffff,gr8
300
        test_gr_limmed  0x7fff,0xffff,gr7
301
        test_spr_limmed 0xffff,0xffff,iacc0l    ; 7fffffff*7fffffff+
302
        test_spr_limmed 0x7fff,0xffff,iacc0h    ;  40000000fffffffe
303
 
304
smass30:
305
        set_gr_limmed   0x7fff,0xffff,gr7       ; just barely overflow (pos)
306
        set_gr_limmed   0x7fff,0xffff,gr8
307
        set_spr_limmed  0xffff,0xffff,iacc0l
308
        set_spr_limmed  0x4000,0x0000,iacc0h
309
        smass           gr7,gr8
310
        test_gr_limmed  0x7fff,0xffff,gr8
311
        test_gr_limmed  0x7fff,0xffff,gr7
312
        test_spr_limmed 0xffff,0xffff,iacc0l    ; 7fffffff*7fffffff+
313
        test_spr_limmed 0x7fff,0xffff,iacc0h    ;  40000000ffffffff
314
 
315
smass31:
316
        set_gr_limmed   0x7fff,0xffff,gr7       ; maximum overflow (pos)
317
        set_gr_limmed   0x7fff,0xffff,gr8
318
        set_spr_limmed  0xffff,0xffff,iacc0l
319
        set_spr_limmed  0x7fff,0xffff,iacc0h
320
        smass           gr7,gr8
321
        test_gr_limmed  0x7fff,0xffff,gr8
322
        test_gr_limmed  0x7fff,0xffff,gr7
323
        test_spr_limmed 0xffff,0xffff,iacc0l    ; 7fffffff*7fffffff+
324
        test_spr_limmed 0x7fff,0xffff,iacc0h    ;  7fffffffffffffff
325
 
326
smass32:
327
        set_gr_limmed   0x7fff,0xffff,gr7       ; not quite overflow (neg)
328
        set_gr_limmed   0x8000,0x0000,gr8
329
        set_spr_limmed  0x8000,0x0000,iacc0l
330
        set_spr_limmed  0xbfff,0xffff,iacc0h
331
        smass           gr7,gr8
332
        test_gr_limmed  0x8000,0x0000,gr8
333
        test_gr_limmed  0x7fff,0xffff,gr7
334
        test_spr_limmed 0x0000,0x0000,iacc0l    ; 7fffffff*7fffffff+
335
        test_spr_limmed 0x8000,0x0000,iacc0h    ;  bfffffff80000000
336
 
337
smass33:
338
        set_gr_limmed   0x7fff,0xffff,gr7       ; just barely overflow (neg)
339
        set_gr_limmed   0x8000,0x0000,gr8
340
        set_spr_limmed  0x7fff,0xffff,iacc0l
341
        set_spr_limmed  0xbfff,0xffff,iacc0h
342
        smass           gr7,gr8
343
        test_gr_limmed  0x8000,0x0000,gr8
344
        test_gr_limmed  0x7fff,0xffff,gr7
345
        test_spr_limmed 0x0000,0x0000,iacc0l    ; 7fffffff*7fffffff+
346
        test_spr_limmed 0x8000,0x0000,iacc0h    ;  bfffffff7fffffff
347
 
348
smass34:
349
        set_gr_limmed   0x7fff,0xffff,gr7       ; maximum overflow (neg)
350
        set_gr_limmed   0x8000,0x0000,gr8
351
        set_spr_limmed  0x0000,0x0000,iacc0l
352
        set_spr_limmed  0x8000,0x0000,iacc0h
353
        smass           gr7,gr8
354
        test_gr_limmed  0x8000,0x0000,gr8
355
        test_gr_limmed  0x7fff,0xffff,gr7
356
        test_spr_limmed 0x0000,0x0000,iacc0l    ; 7fffffff*7fffffff+
357
        test_spr_limmed 0x8000,0x0000,iacc0h    ;  8000000000000000
358
 
359
        pass

powered by: WebSVN 2.1.0

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