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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gdb-7.1/] [sim/] [testsuite/] [sim/] [frv/] [fr400/] [smsss.cgs] - Blame information for rev 816

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

Line No. Rev Author Line
1 227 jeremybenn
# frv testcase for smsss $GRi,$GRj
2
# mach: fr405 fr450
3
 
4
        .include "../testutils.inc"
5
 
6
        start
7
 
8
        .global smsss
9
smsss1:
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   7,iacc0l
15
        smsss           gr7,gr8
16
        test_gr_immed   3,gr7
17
        test_gr_immed   2,gr8
18
        test_spr_immed  1,iacc0l        ; result 7-3*2
19
        test_spr_immed  0,iacc0h
20
smsss2:
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   3,iacc0l
25
        smsss           gr7,gr8
26
        test_gr_immed   1,gr7
27
        test_gr_immed   2,gr8
28
        test_spr_immed  1,iacc0l        ; result 3-1*2
29
        test_spr_immed  0,iacc0h
30
smsss3:
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   3,iacc0l
35
        smsss           gr7,gr8
36
        test_gr_immed   1,gr8
37
        test_gr_immed   2,gr7
38
        test_spr_immed  1,iacc0l        ; result 3-2*1
39
        test_spr_immed  0,iacc0h
40
smsss4:
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
        smsss           gr7,gr8
46
        test_gr_immed   2,gr8
47
        test_gr_immed   0,gr7
48
        test_spr_immed  1,iacc0l        ; result 1-0*2
49
        test_spr_immed  0,iacc0h
50
smsss5:
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
        smsss           gr7,gr8
56
        test_gr_immed   0,gr8
57
        test_gr_immed   2,gr7
58
        test_spr_immed  1,iacc0l        ; result 1-2*0
59
        test_spr_immed  0,iacc0h
60
smsss6:
61
        set_gr_limmed   0x3fff,0xffff,gr7       ; 31 bit result
62
        set_gr_immed    2,gr8
63
        set_spr_immed   -1,iacc0h
64
        set_spr_immed   -1,iacc0l
65
        smsss           gr7,gr8
66
        test_gr_immed   2,gr8
67
        test_gr_limmed  0x3fff,0xffff,gr7
68
        test_spr_limmed 0x8000,0x0001,iacc0l    ; -1-3fffffff*2
69
        test_spr_immed  -1,iacc0h
70
smsss7:
71
        set_gr_limmed   0x4000,0x0000,gr7       ; 32 bit result
72
        set_gr_immed    2,gr8
73
        set_spr_immed   -1,iacc0h
74
        set_spr_limmed  0x8000,0x0001,iacc0l
75
        smsss           gr7,gr8
76
        test_gr_immed   2,gr8
77
        test_gr_limmed  0x4000,0x0000,gr7
78
        test_spr_immed  1,iacc0l        ; ffffffff80000001-40000000*2
79
        test_spr_immed  -1,iacc0h
80
smsss8:
81
        set_gr_limmed   0x4000,0x0000,gr7       ; 33 bit result
82
        set_gr_immed    4,gr8
83
        set_spr_immed   -1,iacc0h
84
        set_spr_immed   1,iacc0l
85
        smsss           gr7,gr8
86
        test_gr_immed   4,gr8
87
        test_gr_limmed  0x4000,0x0000,gr7
88
        test_spr_immed  1,iacc0l                ; ffffffff00000001-40000000*4
89
        test_spr_immed  -2,iacc0h
90
smsss9:
91
        set_gr_limmed   0x7fff,0xffff,gr7       ; max positive result
92
        set_gr_limmed   0x7fff,0xffff,gr8
93
        set_spr_limmed  0x7fff,0xffff,iacc0h
94
        set_spr_immed   -1,iacc0l
95
        smsss           gr7,gr8
96
        test_gr_limmed  0x7fff,0xffff,gr8
97
        test_gr_limmed  0x7fff,0xffff,gr7
98
        test_spr_limmed 0xffff,0xfffe,iacc0l    ; 7fffffffffffffff-7fffffff*7fffffff
99
        test_spr_limmed 0x4000,0x0000,iacc0h
100
smsss10:
101
        ; Mixed operands
102
        set_gr_immed    -3,gr7          ; multiply small numbers
103
        set_gr_immed    2,gr8
104
        set_spr_immed   -1,iacc0h
105
        set_spr_immed   -5,iacc0l
106
        smsss           gr7,gr8
107
        test_gr_immed   2,gr8
108
        test_gr_immed   -3,gr7
109
        test_spr_immed  1,iacc0l        ; -5-(-3*2)
110
        test_spr_immed  0,iacc0h
111
smsss11:
112
        set_gr_immed    3,gr7           ; multiply small numbers
113
        set_gr_immed    -2,gr8
114
        set_spr_immed   -1,iacc0h
115
        set_spr_immed   -5,iacc0l
116
        smsss           gr7,gr8
117
        test_gr_immed   -2,gr8
118
        test_gr_immed   3,gr7
119
        test_spr_immed  1,iacc0l        ; -5-(3*-2)
120
        test_spr_immed  0,iacc0h
121
smsss12:
122
        set_gr_immed    1,gr7           ; multiply by 1
123
        set_gr_immed    -2,gr8
124
        set_spr_immed   -1,iacc0h
125
        set_spr_immed   -1,iacc0l
126
        smsss           gr7,gr8
127
        test_gr_immed   -2,gr8
128
        test_gr_immed   1,gr7
129
        test_spr_immed  1,iacc0l        ; -1-(1*-2)
130
        test_spr_immed  0,iacc0h
131
smsss13:
132
        set_gr_immed    -2,gr7          ; multiply by 1
133
        set_gr_immed    1,gr8
134
        set_spr_immed   -1,iacc0h
135
        set_spr_immed   -1,iacc0l
136
        smsss           gr7,gr8
137
        test_gr_immed   1,gr8
138
        test_gr_immed   -2,gr7
139
        test_spr_immed  1,iacc0l        ; -1-(-2*1)
140
        test_spr_immed  0,iacc0h
141
smsss14:
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
        smsss           gr7,gr8
147
        test_gr_immed   -2,gr8
148
        test_gr_immed   0,gr7
149
        test_spr_immed  1,iacc0l        ; 1-(0*-2)
150
        test_spr_immed  0,iacc0h
151
smsss15:
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
        smsss           gr7,gr8
157
        test_gr_immed   0,gr8
158
        test_gr_immed   -2,gr7
159
        test_spr_immed  1,iacc0l        ; 1-(-2*0)
160
        test_spr_immed  0,iacc0h
161
smsss16:
162
        set_gr_limmed   0x2000,0x0000,gr7       ; 31 bit result
163
        set_gr_immed    -2,gr8
164
        set_spr_immed   0,iacc0h
165
        set_spr_limmed  0x3fff,0xffff,iacc0l
166
        smsss           gr7,gr8
167
        test_gr_immed   -2,gr8
168
        test_gr_limmed  0x2000,0x0000,gr7
169
        test_spr_limmed 0x7fff,0xffff,iacc0l
170
        test_spr_immed  0,iacc0h        ; 3fffffff-20000001*-2
171
smsss17:
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
        smsss           gr7,gr8
177
        test_gr_immed   -2,gr8
178
        test_gr_limmed  0x4000,0x0000,gr7
179
        test_spr_limmed 0x8000,0x0001,iacc0l    ; 1-40000000*-2
180
        test_spr_immed  0,iacc0h
181
smsss18:
182
        set_gr_limmed   0x4000,0x0000,gr7       ; 32 bit result
183
        set_gr_immed    -2,gr8
184
        set_spr_immed   -1,iacc0h
185
        set_spr_immed   -1,iacc0l
186
        smsss           gr7,gr8
187
        test_gr_immed   -2,gr8
188
        test_gr_limmed  0x4000,0x0000,gr7
189
        test_spr_limmed 0x7fff,0xffff,iacc0l
190
        test_spr_immed  0,iacc0h        ; -1-40000000*-2
191
smsss19:
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
        smsss           gr7,gr8
197
        test_gr_immed   -4,gr8
198
        test_gr_limmed  0x4000,0x0000,gr7
199
        test_spr_immed  1,iacc0l        ; 200000001-(40000000*-4)
200
        test_spr_immed  1,iacc0h
201
smsss20:
202
        set_gr_limmed   0x7fff,0xffff,gr7       ; max negative result
203
        set_gr_limmed   0x7fff,0xffff,gr8
204
        set_spr_limmed  0xbfff,0xffff,iacc0h
205
        set_spr_limmed  0x0000,0x0001,iacc0l
206
        smsss           gr7,gr8
207
        test_gr_limmed  0x7fff,0xffff,gr8
208
        test_gr_limmed  0x7fff,0xffff,gr7
209
        test_spr_immed  0,iacc0l        ; bfffffff00000001-(7fffffff*7fffffff)
210
        test_spr_limmed 0x8000,0x0000,iacc0h
211
smsss21:
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   7,iacc0l
217
        smsss           gr7,gr8
218
        test_gr_immed   -2,gr8
219
        test_gr_immed   -3,gr7
220
        test_spr_immed  1,iacc0l        ; 7-(-3*-2)
221
        test_spr_immed  0,iacc0h
222
smsss22:
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   3,iacc0l
227
        smsss           gr7,gr8
228
        test_gr_immed   -2,gr8
229
        test_gr_immed   -1,gr7
230
        test_spr_immed  1,iacc0l        ; 3-(-1*-2)
231
        test_spr_immed  0,iacc0h
232
smsss23:
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   3,iacc0l
237
        smsss           gr7,gr8
238
        test_gr_immed   -1,gr8
239
        test_gr_immed   -2,gr7
240
        test_spr_immed  1,iacc0l        ; 3-(-2*-1)
241
        test_spr_immed  0,iacc0h
242
smsss24:
243
        set_gr_immed    -32768,gr7              ; 31 bit result
244
        set_gr_immed    -32768,gr8
245
        set_spr_immed   0,iacc0h
246
        set_spr_limmed  0xbfff,0xffff,iacc0l
247
        smsss           gr7,gr8
248
        test_gr_immed   -32768,gr8
249
        test_gr_immed   -32768,gr7
250
        test_spr_limmed 0x7fff,0xffff,iacc0l    ; 7ffffffb-(-2*-2)
251
        test_spr_immed  0,iacc0h
252
smsss25:
253
        set_gr_immed    0xffff,gr7              ; 32 bit result
254
        set_gr_immed    0xffff,gr8
255
        set_spr_immed   1,iacc0h
256
        set_spr_limmed  0xfffe,0x0000,iacc0l
257
        smsss           gr7,gr8
258
        test_gr_immed   0xffff,gr8
259
        test_gr_immed   0xffff,gr7
260
        test_spr_limmed 0xffff,0xffff,iacc0l    ; 1fffe0000-ffff*ffff
261
        test_spr_immed  0,iacc0h
262
smsss26:
263
        set_gr_limmed   0x0001,0x0000,gr7       ; 33 bit result
264
        set_gr_limmed   0x0001,0x0000,gr8
265
        set_spr_immed   2,iacc0h
266
        set_spr_immed   1,iacc0l
267
        smsss           gr7,gr8
268
        test_gr_limmed  0x0001,0x0000,gr8
269
        test_gr_limmed  0x0001,0x0000,gr7
270
        test_spr_immed  1,iacc0l        ; 0x200000001-0x10000*0x10000
271
        test_spr_immed  1,iacc0h
272
smsss27:
273
        set_gr_immed    -2,gr7          ; almost max positive result
274
        set_gr_immed    -2,gr8
275
        set_spr_limmed  0x7fff,0xffff,iacc0h
276
        set_spr_limmed  0xffff,0xffff,iacc0l
277
        smsss           gr7,gr8
278
        test_gr_immed   -2,gr8
279
        test_gr_immed   -2,gr7
280
        test_spr_limmed 0xffff,0xfffb,iacc0l    ; maxpos - (-2*-2)
281
        test_spr_limmed 0x7fff,0xffff,iacc0h
282
smsss28:
283
        set_gr_immed    0,gr7           ; max positive result
284
        set_gr_immed    0,gr8
285
        set_spr_limmed  0x7fff,0xffff,iacc0h
286
        set_spr_limmed  0xffff,0xffff,iacc0l
287
        smsss           gr7,gr8
288
        test_gr_immed   0,gr8
289
        test_gr_immed   0,gr7
290
        test_spr_limmed 0xffff,0xffff,iacc0l    ; maxpos-(0*0)
291
        test_spr_limmed 0x7fff,0xffff,iacc0h
292
smsss29:
293
        set_gr_limmed   0x7fff,0xffff,gr7       ; not quite overflow (pos)
294
        set_gr_limmed   0x8000,0x0000,gr8
295
        set_spr_limmed  0x4000,0x0000,iacc0h
296
        set_spr_limmed  0x7fff,0xffff,iacc0l
297
        smsss           gr7,gr8
298
        test_gr_limmed  0x8000,0x0000,gr8
299
        test_gr_limmed  0x7fff,0xffff,gr7
300
        test_spr_limmed 0xffff,0xffff,iacc0l    ; 400000007fffffff -
301
        test_spr_limmed 0x7fff,0xffff,iacc0h    ;  0x80000000*0x7fffffff
302
smsss30:
303
        set_gr_limmed   0x7fff,0xffff,gr7       ; just barely overflow (pos)
304
        set_gr_limmed   0x8000,0x0000,gr8
305
        set_spr_limmed  0x4000,0x0000,iacc0h
306
        set_spr_limmed  0x8000,0x0000,iacc0l
307
        smsss           gr7,gr8
308
        test_gr_limmed  0x8000,0x0000,gr8
309
        test_gr_limmed  0x7fff,0xffff,gr7
310
        test_spr_limmed 0xffff,0xffff,iacc0l    ; 4000000080000000 -
311
        test_spr_limmed 0x7fff,0xffff,iacc0h    ;  0x80000000*0x7fffffff
312
 
313
smsss31:
314
        set_gr_limmed   0x7fff,0xffff,gr7       ; maximum overflow (pos)
315
        set_gr_limmed   0x8000,0x0000,gr8
316
        set_spr_limmed  0xffff,0xffff,iacc0l
317
        set_spr_limmed  0x7fff,0xffff,iacc0h
318
        smsss           gr7,gr8
319
        test_gr_limmed  0x8000,0x0000,gr8
320
        test_gr_limmed  0x7fff,0xffff,gr7
321
        test_spr_limmed 0xffff,0xffff,iacc0l    ; 7fffffffffffffff -
322
        test_spr_limmed 0x7fff,0xffff,iacc0h    ;  80000000*80000000
323
smsss32:
324
        set_gr_limmed   0x7fff,0xffff,gr7       ; not quite overflow (neg)
325
        set_gr_limmed   0x7fff,0xffff,gr8
326
        set_spr_immed   1,iacc0l
327
        set_spr_limmed  0xbfff,0xffff,iacc0h
328
        smsss           gr7,gr8
329
        test_gr_limmed  0x7fff,0xffff,gr8
330
        test_gr_limmed  0x7fff,0xffff,gr7
331
        test_spr_limmed 0x0000,0x0000,iacc0l    ; bfffffff00000001 -
332
        test_spr_limmed 0x8000,0x0000,iacc0h    ;  0x7fffffff*0x7fffffff
333
smsss33:
334
        set_gr_limmed   0x7fff,0xffff,gr7       ; just barely overflow (neg)
335
        set_gr_limmed   0x7fff,0xffff,gr8
336
        set_spr_immed   0,iacc0l
337
        set_spr_limmed  0xbfff,0xffff,iacc0h
338
        smsss           gr7,gr8
339
        test_gr_limmed  0x7fff,0xffff,gr8
340
        test_gr_limmed  0x7fff,0xffff,gr7
341
        test_spr_limmed 0x0000,0x0000,iacc0l    ; 7fffffff*7fffffff+
342
        test_spr_limmed 0x8000,0x0000,iacc0h    ;  bfffffff7fffffff
343
smsss34:
344
        set_gr_limmed   0x7fff,0xffff,gr7       ; maximum overflow (neg)
345
        set_gr_limmed   0x7fff,0xffff,gr8
346
        set_spr_limmed  0x0000,0x0000,iacc0l
347
        set_spr_limmed  0x8000,0x0000,iacc0h
348
        smsss           gr7,gr8
349
        test_gr_limmed  0x7fff,0xffff,gr8
350
        test_gr_limmed  0x7fff,0xffff,gr7
351
        test_spr_limmed 0x0000,0x0000,iacc0l    ; 8000000000000000-
352
        test_spr_limmed 0x8000,0x0000,iacc0h    ;  7fffffff*7fffffff+
353
 
354
        pass

powered by: WebSVN 2.1.0

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