Automatic date update in version.in
[binutils-gdb.git] / sim / testsuite / frv / fr400 / maveh.cgs
blob445e121daf6ee97c8729b0c268f533af99661716
1 # frv testcase for maveh $FRi,$FRj,$FRj on fr400 machines
2 # mach: all
4         .include "../testutils.inc"
6         start
8         .global maveh
9 maveh:
10         ; Test Rounding toward positive infinity via RDAV
11         or_spr_immed    0x20000000,msr0
12         and_spr_immed   0xefffffff,msr0
14         set_fr_iimmed   0x0000,0x0000,fr10
15         set_fr_iimmed   0x0000,0x0000,fr11
16         maveh           fr10,fr11,fr12
17         test_fr_limmed  0x0000,0x0000,fr12
19         set_fr_iimmed   0x0001,0x0000,fr10
20         set_fr_iimmed   0x0002,0x0001,fr11
21         maveh           fr10,fr11,fr12
22         test_fr_limmed  0x0002,0x0001,fr12
24         set_fr_iimmed   0x0000,0xffff,fr10
25         set_fr_iimmed   0xffff,0xfffe,fr11
26         maveh           fr10,fr11,fr12
27         test_fr_limmed  0x0000,0xffff,fr12
29         set_fr_iimmed   0xdead,0x0000,fr10
30         set_fr_iimmed   0x0000,0xbeef,fr11
31         maveh           fr10,fr11,fr12
32         test_fr_limmed  0xef57,0xdf78,fr12
34         set_fr_iimmed   0x0000,0xdead,fr10
35         set_fr_iimmed   0xbeef,0x0000,fr11
36         maveh           fr10,fr11,fr12
37         test_fr_limmed  0xdf78,0xef57,fr12
39         set_fr_iimmed   0x1234,0x5678,fr10
40         set_fr_iimmed   0x1111,0x1111,fr11
41         maveh           fr10,fr11,fr12
42         test_fr_limmed  0x11a3,0x33c5,fr12
44         set_fr_iimmed   0x1234,0x5678,fr10
45         set_fr_iimmed   0xffff,0xffff,fr11
46         maveh           fr10,fr11,fr12
47         test_fr_limmed  0x091a,0x2b3c,fr12
49         set_fr_iimmed   0x7ffe,0x7ffe,fr10
50         set_fr_iimmed   0x0002,0x0001,fr11
51         maveh           fr10,fr11,fr12
52         test_fr_limmed  0x4000,0x4000,fr12
54         set_fr_iimmed   0x8001,0x8001,fr10
55         set_fr_iimmed   0xffff,0xfffe,fr11
56         maveh           fr10,fr11,fr12
57         test_fr_limmed  0xc000,0xc000,fr12
59         set_fr_iimmed   0x8001,0x8001,fr10
60         set_fr_iimmed   0xfffe,0xfffe,fr11
61         maveh           fr10,fr11,fr12
62         test_fr_limmed  0xc000,0xc000,fr12
64         set_fr_iimmed   0x8000,0x8000,fr10
65         set_fr_iimmed   0x7fff,0x7fff,fr11
66         maveh.p         fr10,fr10,fr12
67         maveh           fr11,fr11,fr13
68         test_fr_limmed  0x8000,0x8000,fr12
69         test_fr_limmed  0x7fff,0x7fff,fr13
71         ; Test Rounding toward nearest via RD
72         or_spr_immed    0x10000000,msr0
73         and_spr_immed   0x3fffffff,msr0
75         set_fr_iimmed   0x0000,0x0000,fr10
76         set_fr_iimmed   0x0000,0x0000,fr11
77         maveh           fr10,fr11,fr12
78         test_fr_limmed  0x0000,0x0000,fr12
80         set_fr_iimmed   0x0001,0x0000,fr10
81         set_fr_iimmed   0x0002,0x0001,fr11
82         maveh           fr10,fr11,fr12
83         test_fr_limmed  0x0002,0x0001,fr12
85         set_fr_iimmed   0x0000,0xffff,fr10
86         set_fr_iimmed   0xffff,0xfffe,fr11
87         maveh           fr10,fr11,fr12
88         test_fr_limmed  0xffff,0xfffe,fr12
90         set_fr_iimmed   0xdead,0x0000,fr10
91         set_fr_iimmed   0x0000,0xbeef,fr11
92         maveh           fr10,fr11,fr12
93         test_fr_limmed  0xef56,0xdf77,fr12
95         set_fr_iimmed   0x0000,0xdead,fr10
96         set_fr_iimmed   0xbeef,0x0000,fr11
97         maveh           fr10,fr11,fr12
98         test_fr_limmed  0xdf77,0xef56,fr12
100         set_fr_iimmed   0x1234,0x5678,fr10
101         set_fr_iimmed   0x1111,0x1111,fr11
102         maveh           fr10,fr11,fr12
103         test_fr_limmed  0x11a3,0x33c5,fr12
105         set_fr_iimmed   0x1234,0x5678,fr10
106         set_fr_iimmed   0xffff,0xffff,fr11
107         maveh           fr10,fr11,fr12
108         test_fr_limmed  0x091a,0x2b3c,fr12
110         set_fr_iimmed   0x7ffe,0x7ffe,fr10
111         set_fr_iimmed   0x0002,0x0001,fr11
112         maveh           fr10,fr11,fr12
113         test_fr_limmed  0x4000,0x4000,fr12
115         set_fr_iimmed   0x8001,0x8001,fr10
116         set_fr_iimmed   0xffff,0xfffe,fr11
117         maveh           fr10,fr11,fr12
118         test_fr_limmed  0xc000,0xbfff,fr12
120         set_fr_iimmed   0x8001,0x8001,fr10
121         set_fr_iimmed   0xfffe,0xfffe,fr11
122         maveh           fr10,fr11,fr12
123         test_fr_limmed  0xbfff,0xbfff,fr12
125         set_fr_iimmed   0x8000,0x8000,fr10
126         set_fr_iimmed   0x7fff,0x7fff,fr11
127         maveh.p         fr10,fr10,fr12
128         maveh           fr11,fr11,fr13
129         test_fr_limmed  0x8000,0x8000,fr12
130         test_fr_limmed  0x7fff,0x7fff,fr13
132         ; Test Rounding toward zero via RD
133         or_spr_immed    0x50000000,msr0
134         and_spr_immed   0x7fffffff,msr0
136         set_fr_iimmed   0x0000,0x0000,fr10
137         set_fr_iimmed   0x0000,0x0000,fr11
138         maveh           fr10,fr11,fr12
139         test_fr_limmed  0x0000,0x0000,fr12
141         set_fr_iimmed   0x0001,0x0000,fr10
142         set_fr_iimmed   0x0002,0x0001,fr11
143         maveh           fr10,fr11,fr12
144         test_fr_limmed  0x0001,0x0000,fr12
146         set_fr_iimmed   0x0000,0xffff,fr10
147         set_fr_iimmed   0xffff,0xfffe,fr11
148         maveh           fr10,fr11,fr12
149         test_fr_limmed  0x0000,0xffff,fr12
151         set_fr_iimmed   0xdead,0x0000,fr10
152         set_fr_iimmed   0x0000,0xbeef,fr11
153         maveh           fr10,fr11,fr12
154         test_fr_limmed  0xef57,0xdf78,fr12
156         set_fr_iimmed   0x0000,0xdead,fr10
157         set_fr_iimmed   0xbeef,0x0000,fr11
158         maveh           fr10,fr11,fr12
159         test_fr_limmed  0xdf78,0xef57,fr12
161         set_fr_iimmed   0x1234,0x5678,fr10
162         set_fr_iimmed   0x1111,0x1111,fr11
163         maveh           fr10,fr11,fr12
164         test_fr_limmed  0x11a2,0x33c4,fr12
166         set_fr_iimmed   0x1234,0x5678,fr10
167         set_fr_iimmed   0xffff,0xffff,fr11
168         maveh           fr10,fr11,fr12
169         test_fr_limmed  0x0919,0x2b3b,fr12
171         set_fr_iimmed   0x7ffe,0x7ffe,fr10
172         set_fr_iimmed   0x0002,0x0001,fr11
173         maveh           fr10,fr11,fr12
174         test_fr_limmed  0x4000,0x3fff,fr12
176         set_fr_iimmed   0x8001,0x8001,fr10
177         set_fr_iimmed   0xffff,0xfffe,fr11
178         maveh           fr10,fr11,fr12
179         test_fr_limmed  0xc000,0xc000,fr12
181         set_fr_iimmed   0x8001,0x8001,fr10
182         set_fr_iimmed   0xfffe,0xfffe,fr11
183         maveh           fr10,fr11,fr12
184         test_fr_limmed  0xc000,0xc000,fr12
186         set_fr_iimmed   0x8000,0x8000,fr10
187         set_fr_iimmed   0x7fff,0x7fff,fr11
188         maveh.p         fr10,fr10,fr12
189         maveh           fr11,fr11,fr13
190         test_fr_limmed  0x8000,0x8000,fr12
191         test_fr_limmed  0x7fff,0x7fff,fr13
193         ; Test Rounding toward positive infinity via RD
194         or_spr_immed    0x90000000,msr0
195         and_spr_immed   0xbfffffff,msr0
197         set_fr_iimmed   0x0000,0x0000,fr10
198         set_fr_iimmed   0x0000,0x0000,fr11
199         maveh           fr10,fr11,fr12
200         test_fr_limmed  0x0000,0x0000,fr12
202         set_fr_iimmed   0x0001,0x0000,fr10
203         set_fr_iimmed   0x0002,0x0001,fr11
204         maveh           fr10,fr11,fr12
205         test_fr_limmed  0x0002,0x0001,fr12
207         set_fr_iimmed   0x0000,0xffff,fr10
208         set_fr_iimmed   0xffff,0xfffe,fr11
209         maveh           fr10,fr11,fr12
210         test_fr_limmed  0x0000,0xffff,fr12
212         set_fr_iimmed   0xdead,0x0000,fr10
213         set_fr_iimmed   0x0000,0xbeef,fr11
214         maveh           fr10,fr11,fr12
215         test_fr_limmed  0xef57,0xdf78,fr12
217         set_fr_iimmed   0x0000,0xdead,fr10
218         set_fr_iimmed   0xbeef,0x0000,fr11
219         maveh           fr10,fr11,fr12
220         test_fr_limmed  0xdf78,0xef57,fr12
222         set_fr_iimmed   0x1234,0x5678,fr10
223         set_fr_iimmed   0x1111,0x1111,fr11
224         maveh           fr10,fr11,fr12
225         test_fr_limmed  0x11a3,0x33c5,fr12
227         set_fr_iimmed   0x1234,0x5678,fr10
228         set_fr_iimmed   0xffff,0xffff,fr11
229         maveh           fr10,fr11,fr12
230         test_fr_limmed  0x091a,0x2b3c,fr12
232         set_fr_iimmed   0x7ffe,0x7ffe,fr10
233         set_fr_iimmed   0x0002,0x0001,fr11
234         maveh           fr10,fr11,fr12
235         test_fr_limmed  0x4000,0x4000,fr12
237         set_fr_iimmed   0x8001,0x8001,fr10
238         set_fr_iimmed   0xffff,0xfffe,fr11
239         maveh           fr10,fr11,fr12
240         test_fr_limmed  0xc000,0xc000,fr12
242         set_fr_iimmed   0x8001,0x8001,fr10
243         set_fr_iimmed   0xfffe,0xfffe,fr11
244         maveh           fr10,fr11,fr12
245         test_fr_limmed  0xc000,0xc000,fr12
247         set_fr_iimmed   0x8000,0x8000,fr10
248         set_fr_iimmed   0x7fff,0x7fff,fr11
249         maveh.p         fr10,fr10,fr12
250         maveh           fr11,fr11,fr13
251         test_fr_limmed  0x8000,0x8000,fr12
252         test_fr_limmed  0x7fff,0x7fff,fr13
254         ; Test Rounding toward negative infinity via RD
255         or_spr_immed    0xd0000000,msr0
257         set_fr_iimmed   0x0000,0x0000,fr10
258         set_fr_iimmed   0x0000,0x0000,fr11
259         maveh           fr10,fr11,fr12
260         test_fr_limmed  0x0000,0x0000,fr12
262         set_fr_iimmed   0x0001,0x0000,fr10
263         set_fr_iimmed   0x0002,0x0001,fr11
264         maveh           fr10,fr11,fr12
265         test_fr_limmed  0x0001,0x0000,fr12
267         set_fr_iimmed   0x0000,0xffff,fr10
268         set_fr_iimmed   0xffff,0xfffe,fr11
269         maveh           fr10,fr11,fr12
270         test_fr_limmed  0xffff,0xfffe,fr12
272         set_fr_iimmed   0xdead,0x0000,fr10
273         set_fr_iimmed   0x0000,0xbeef,fr11
274         maveh           fr10,fr11,fr12
275         test_fr_limmed  0xef56,0xdf77,fr12
277         set_fr_iimmed   0x0000,0xdead,fr10
278         set_fr_iimmed   0xbeef,0x0000,fr11
279         maveh           fr10,fr11,fr12
280         test_fr_limmed  0xdf77,0xef56,fr12
282         set_fr_iimmed   0x1234,0x5678,fr10
283         set_fr_iimmed   0x1111,0x1111,fr11
284         maveh           fr10,fr11,fr12
285         test_fr_limmed  0x11a2,0x33c4,fr12
287         set_fr_iimmed   0x1234,0x5678,fr10
288         set_fr_iimmed   0xffff,0xffff,fr11
289         maveh           fr10,fr11,fr12
290         test_fr_limmed  0x0919,0x2b3b,fr12
292         set_spr_immed   0,msr0
293         set_fr_iimmed   0x7ffe,0x7ffe,fr10
294         set_fr_iimmed   0x0002,0x0001,fr11
295         maveh           fr10,fr11,fr12
296         test_fr_limmed  0x4000,0x3fff,fr12
298         set_spr_immed   0,msr0
299         set_fr_iimmed   0x8001,0x8001,fr10
300         set_fr_iimmed   0xffff,0xfffe,fr11
301         maveh           fr10,fr11,fr12
302         test_fr_limmed  0xc000,0xbfff,fr12
304         set_spr_immed   0,msr0
305         set_fr_iimmed   0x8001,0x8001,fr10
306         set_fr_iimmed   0xfffe,0xfffe,fr11
307         maveh           fr10,fr11,fr12
308         test_fr_limmed  0xbfff,0xbfff,fr12
310         set_spr_immed   0,msr0
311         set_spr_immed   0,msr1
312         set_fr_iimmed   0x8000,0x8000,fr10
313         set_fr_iimmed   0x7fff,0x7fff,fr11
314         maveh.p         fr10,fr10,fr12
315         maveh           fr11,fr11,fr13
316         test_fr_limmed  0x8000,0x8000,fr12
317         test_fr_limmed  0x7fff,0x7fff,fr13
319         pass