1 # frv testcase for mcpxrs $GRi,$GRj,$ACCk
4 .include "testutils.inc"
11 set_fr_iimmed 2,4,fr7 ; multiply small numbers
14 test_accg_immed 0xff,accg0
15 test_acc_immed -14,acc0
17 set_fr_iimmed 3,1,fr7 ; multiply by 0
20 test_accg_immed 0,accg0
23 set_fr_iimmed 2,1,fr7 ; multiply by 1
26 test_accg_immed 0,accg0
29 set_fr_iimmed 0x3fff,2,fr7 ; 15 bit result
30 set_fr_iimmed 2,0x0007,fr8
32 test_accg_immed 0,accg0
33 test_acc_limmed 0,0x7ff0,acc0
35 set_fr_iimmed 0x4000,2,fr7 ; 16 bit result
36 set_fr_iimmed 2,0x2000,fr8
38 test_accg_immed 0,accg0
39 test_acc_limmed 0x0000,0x4000,acc0
41 set_fr_iimmed 0x7fff,0x0000,fr7 ; max positive result
42 set_fr_iimmed 0x7fff,0x7fff,fr8
44 test_accg_immed 0,accg0
45 test_acc_limmed 0x3fff,0x0001,acc0
48 set_fr_iimmed 2,0xfffd,fr7 ; multiply small numbers
49 set_fr_iimmed 0xfffd,1,fr8
51 test_accg_immed 0xff,accg0
52 test_acc_immed -3,acc0
54 set_fr_iimmed 0xfffe,2,fr7 ; multiply by 1
55 set_fr_iimmed 1,0xfffe,fr8
57 test_accg_immed 0,accg0
60 set_fr_iimmed 0xfffe,0,fr7 ; multiply by 0
61 set_fr_iimmed 1,0xfffe,fr8
63 test_accg_immed 0xff,accg0
64 test_acc_immed -2,acc0
66 set_fr_iimmed 0x2001,0xfffe,fr7 ; 15 bit result
67 set_fr_iimmed 0xfffe,0xfff9,fr8
69 test_accg_immed 0xff,accg0
70 test_acc_limmed 0xffff,0xbff0,acc0
72 set_fr_iimmed 0x4000,0xfffe,fr7 ; 16 bit result
73 set_fr_iimmed 0xfffe,0x0003,fr8
75 test_accg_immed 0xff,accg0
76 test_acc_limmed 0xffff,0x8006,acc0
78 set_fr_iimmed 0x7fff,0x8000,fr7 ; max negative result
79 set_fr_iimmed 0x8000,0x8000,fr8
81 test_accg_immed 0xff,accg0
82 test_acc_limmed 0x8000,0x8000,acc0
84 set_fr_iimmed 0x8000,0x7fff,fr7 ; max positive result
85 set_fr_iimmed 0x8000,0x8000,fr8
87 test_accg_immed 0,accg0
88 test_acc_limmed 0x7fff,0x8000,acc0
91 set_fr_iimmed 0xfffe,0xfffc,fr7 ; multiply small numbers
92 set_fr_iimmed 0xfffd,0xfffb,fr8
94 test_accg_immed 0xff,accg0
95 test_acc_immed -14,acc0
97 set_fr_iimmed 0xffff,0xffff,fr7 ; multiply by -1
98 set_fr_iimmed 0xfffe,0xffff,fr8
100 test_accg_immed 0,accg0
101 test_acc_immed 1,acc0
103 set_fr_iimmed 0x7fff,0x0000,fr7 ; almost max positive result
104 set_fr_iimmed 0x7fff,0x8001,fr8
106 test_accg_immed 0,accg0
107 test_acc_immed 0x3fff0001,acc0
109 set_fr_iimmed 0x8000,0x0000,fr7 ; max positive result
110 set_fr_iimmed 0x8000,0x8000,fr8
112 test_accg_immed 0,accg0
113 test_acc_immed 0x40000000,acc0