1 # frv testcase for smulcc $GRi,$GRj,$GRk
4 .include "testutils.inc"
11 set_gr_immed 3,gr7 ; multiply small numbers
14 smulcc gr7,gr8,gr8,icc0
19 set_gr_immed 1,gr7 ; multiply by 1
22 smulcc gr7,gr8,gr8,icc0
27 set_gr_immed 2,gr7 ; multiply by 1
30 smulcc gr7,gr8,gr8,icc0
35 set_gr_immed 0,gr7 ; multiply by 0
38 smulcc gr7,gr8,gr8,icc0
43 set_gr_immed 2,gr7 ; multiply by 0
46 smulcc gr7,gr8,gr8,icc0
51 set_gr_limmed 0x3fff,0xffff,gr7 ; 31 bit result
54 smulcc gr7,gr8,gr8,icc0
57 test_gr_limmed 0x7fff,0xfffe,gr9
59 set_gr_limmed 0x4000,0x0000,gr7 ; 32 bit result
62 smulcc gr7,gr8,gr8,icc0
65 test_gr_limmed 0x8000,0x0000,gr9
67 set_gr_limmed 0x4000,0x0000,gr7 ; 33 bit result
70 smulcc gr7,gr8,gr8,icc0
73 test_gr_limmed 0x0000,0x0000,gr9
75 set_gr_limmed 0x7fff,0xffff,gr7 ; max positive result
76 set_gr_limmed 0x7fff,0xffff,gr8
78 smulcc gr7,gr8,gr8,icc0
80 test_gr_limmed 0x3fff,0xffff,gr8
81 test_gr_immed 0x00000001,gr9
84 set_gr_immed -3,gr7 ; multiply small numbers
87 smulcc gr7,gr8,gr8,icc0
92 set_gr_immed 3,gr7 ; multiply small numbers
95 smulcc gr7,gr8,gr8,icc0
100 set_gr_immed 1,gr7 ; multiply by 1
103 smulcc gr7,gr8,gr8,icc0
104 test_icc 1 0 1 1 icc0
108 set_gr_immed -2,gr7 ; multiply by 1
111 smulcc gr7,gr8,gr8,icc0
112 test_icc 1 0 0 0 icc0
116 set_gr_immed 0,gr7 ; multiply by 0
119 smulcc gr7,gr8,gr8,icc0
120 test_icc 0 1 0 1 icc0
124 set_gr_immed -2,gr7 ; multiply by 0
127 smulcc gr7,gr8,gr8,icc0
128 test_icc 0 1 1 0 icc0
132 set_gr_limmed 0x2000,0x0001,gr7 ; 31 bit result
135 smulcc gr7,gr8,gr8,icc0
136 test_icc 1 0 1 1 icc0
137 test_gr_limmed 0xffff,0xffff,gr8
138 test_gr_limmed 0xbfff,0xfffe,gr9
140 set_gr_limmed 0x4000,0x0000,gr7 ; 32 bit result
143 smulcc gr7,gr8,gr8,icc0
144 test_icc 1 0 0 0 icc0
145 test_gr_limmed 0xffff,0xffff,gr8
146 test_gr_limmed 0x8000,0x0000,gr9
148 set_gr_limmed 0x4000,0x0001,gr7 ; 32 bit result
151 smulcc gr7,gr8,gr8,icc0
152 test_icc 1 0 0 1 icc0
153 test_gr_limmed 0xffff,0xffff,gr8
154 test_gr_limmed 0x7fff,0xfffe,gr9
156 set_gr_limmed 0x4000,0x0000,gr7 ; 33 bit result
159 smulcc gr7,gr8,gr8,icc0
160 test_icc 1 0 1 0 icc0
161 test_gr_limmed 0xffff,0xffff,gr8
162 test_gr_limmed 0x0000,0x0000,gr9
164 set_gr_limmed 0x7fff,0xffff,gr7 ; max negative result
165 set_gr_limmed 0x8000,0x0000,gr8
167 smulcc gr7,gr8,gr8,icc0
168 test_icc 1 0 1 1 icc0
169 test_gr_limmed 0xc000,0x0000,gr8
170 test_gr_limmed 0x8000,0x0000,gr9
173 set_gr_immed -3,gr7 ; multiply small numbers
176 smulcc gr7,gr8,gr8,icc0
177 test_icc 0 0 0 0 icc0
181 set_gr_immed -1,gr7 ; multiply by 1
184 smulcc gr7,gr8,gr8,icc0
185 test_icc 0 0 0 1 icc0
189 set_gr_immed -2,gr7 ; multiply by 1
192 smulcc gr7,gr8,gr8,icc0
193 test_icc 0 0 1 0 icc0
197 set_gr_limmed 0xc000,0x0001,gr7 ; 31 bit result
200 smulcc gr7,gr8,gr8,icc0
201 test_icc 0 0 1 1 icc0
203 test_gr_limmed 0x7fff,0xfffe,gr9
205 set_gr_limmed 0xc000,0x0000,gr7 ; 32 bit result
208 smulcc gr7,gr8,gr8,icc0
209 test_icc 0 0 0 0 icc0
211 test_gr_limmed 0x8000,0x0000,gr9
213 set_gr_limmed 0xc000,0x0000,gr7 ; 33 bit result
216 smulcc gr7,gr8,gr8,icc0
217 test_icc 0 0 0 1 icc0
219 test_gr_immed 0x00000000,gr9
221 set_gr_limmed 0x8000,0x0001,gr7 ; almost max positive result
222 set_gr_limmed 0x8000,0x0001,gr8
224 smulcc gr7,gr8,gr8,icc0
225 test_icc 0 0 1 0 icc0
226 test_gr_limmed 0x3fff,0xffff,gr8
227 test_gr_immed 0x00000001,gr9
230 set_gr_limmed 0x8000,0x0000,gr7 ; max positive result
231 set_gr_limmed 0x8000,0x0000,gr8
233 smulcc gr7,gr8,gr8,icc0
234 test_icc 0 0 1 1 icc0
235 test_gr_limmed 0x4000,0x0000,gr8
236 test_gr_immed 0x00000000,gr9