1 # frv testcase for mmulhs $GRi,$GRj,$ACCk
4 .include "testutils.inc"
11 set_fr_iimmed 2,3,fr7 ; multiply small numbers
14 test_accg_immed 0,accg0
16 test_accg_immed 0,accg1
19 set_fr_iimmed 0,1,fr7 ; multiply by 0
22 test_accg_immed 0,accg0
24 test_accg_immed 0,accg1
27 set_fr_iimmed 2,1,fr7 ; multiply by 1
30 test_accg_immed 0,accg0
32 test_accg_immed 0,accg1
35 set_fr_iimmed 0x3fff,2,fr7 ; 15 bit result
36 set_fr_iimmed 2,0x3fff,fr8
38 test_accg_immed 0,accg0
39 test_acc_limmed 0,0x7ffe,acc0
40 test_accg_immed 0,accg1
41 test_acc_limmed 0,0x7ffe,acc1
43 set_fr_iimmed 0x4000,2,fr7 ; 16 bit result
44 set_fr_iimmed 2,0x4000,fr8
46 test_accg_immed 0,accg0
47 test_acc_limmed 0x0000,0x8000,acc0
48 test_accg_immed 0,accg1
49 test_acc_limmed 0x0000,0x8000,acc1
51 set_fr_iimmed 0x7fff,0x7fff,fr7 ; max positive result
52 set_fr_iimmed 0x7fff,0x7fff,fr8
54 test_accg_immed 0,accg0
55 test_acc_limmed 0x3fff,0x0001,acc0
56 test_accg_immed 0,accg1
57 test_acc_limmed 0x3fff,0x0001,acc1
60 set_fr_iimmed 2,0xfffd,fr7 ; multiply small numbers
61 set_fr_iimmed 0xfffd,2,fr8
63 test_accg_immed 0xff,accg0
64 test_acc_immed -6,acc0
65 test_accg_immed 0xff,accg1
66 test_acc_immed -6,acc1
68 set_fr_iimmed 0xfffe,1,fr7 ; multiply by 1
69 set_fr_iimmed 1,0xfffe,fr8
71 test_accg_immed 0xff,accg0
72 test_acc_immed -2,acc0
73 test_accg_immed 0xff,accg1
74 test_acc_immed -2,acc1
76 set_fr_iimmed 0xfffe,0,fr7 ; multiply by 0
77 set_fr_iimmed 0,0xfffe,fr8
79 test_accg_immed 0,accg0
81 test_accg_immed 0,accg1
84 set_fr_iimmed 0x2001,0xfffe,fr7 ; 15 bit result
85 set_fr_iimmed 0xfffe,0x2001,fr8
87 test_accg_immed 0xff,accg0
88 test_acc_limmed 0xffff,0xbffe,acc0
89 test_accg_immed 0xff,accg1
90 test_acc_limmed 0xffff,0xbffe,acc1
92 set_fr_iimmed 0x4000,0xfffe,fr7 ; 16 bit result
93 set_fr_iimmed 0xfffe,0x4000,fr8
95 test_accg_immed 0xff,accg0
96 test_acc_limmed 0xffff,0x8000,acc0
97 test_accg_immed 0xff,accg1
98 test_acc_limmed 0xffff,0x8000,acc1
100 set_fr_iimmed 0x7fff,0x8000,fr7 ; max negative result
101 set_fr_iimmed 0x8000,0x7fff,fr8
103 test_accg_immed 0xff,accg0
104 test_acc_limmed 0xc000,0x8000,acc0
105 test_accg_immed 0xff,accg1
106 test_acc_limmed 0xc000,0x8000,acc1
109 set_fr_iimmed 0xfffe,0xfffd,fr7 ; multiply small numbers
110 set_fr_iimmed 0xfffd,0xfffe,fr8
112 test_accg_immed 0,accg0
113 test_acc_immed 6,acc0
114 test_accg_immed 0,accg1
115 test_acc_immed 6,acc1
117 set_fr_iimmed 0xffff,0xfffe,fr7 ; multiply by -1
118 set_fr_iimmed 0xfffe,0xffff,fr8
120 test_accg_immed 0,accg0
121 test_acc_immed 2,acc0
122 test_accg_immed 0,accg1
123 test_acc_immed 2,acc1
125 set_fr_iimmed 0x8001,0x8001,fr7 ; almost max positive result
126 set_fr_iimmed 0x8001,0x8001,fr8
128 test_accg_immed 0,accg0
129 test_acc_immed 0x3fff0001,acc0
130 test_accg_immed 0,accg1
131 test_acc_immed 0x3fff0001,acc1
133 set_fr_iimmed 0x8000,0x8000,fr7 ; max positive result
134 set_fr_iimmed 0x8000,0x8000,fr8
136 test_accg_immed 0,accg0
137 test_acc_immed 0x40000000,acc0
138 test_accg_immed 0,accg1
139 test_acc_immed 0x40000000,acc1