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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gdb-6.8/] [sim/] [testsuite/] [sim/] [frv/] [mmulxhs.cgs] - Blame information for rev 157

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 24 jeremybenn
# frv testcase for mmulxhs $GRi,$GRj,$ACCk
2
# mach: all
3
 
4
        .include "testutils.inc"
5
 
6
        start
7
 
8
        .global mmulxhs
9
mmulxhs:
10
        ; Positive operands
11
        set_fr_iimmed   2,3,fr7         ; multiply small numbers
12
        set_fr_iimmed   3,2,fr8
13
        mmulxhs         fr7,fr8,acc0
14
        test_accg_immed         0,accg0
15
        test_acc_immed  4,acc0
16
        test_accg_immed         0,accg1
17
        test_acc_immed  9,acc1
18
 
19
        set_fr_iimmed   0,1,fr7         ; multiply by 0
20
        set_fr_iimmed   0,2,fr8
21
        mmulxhs         fr7,fr8,acc0
22
        test_accg_immed         0,accg0
23
        test_acc_immed  0,acc0
24
        test_accg_immed         0,accg1
25
        test_acc_immed  0,acc1
26
 
27
        set_fr_iimmed   2,1,fr7         ; multiply by 1
28
        set_fr_iimmed   2,1,fr8
29
        mmulxhs         fr7,fr8,acc0
30
        test_accg_immed         0,accg0
31
        test_acc_immed  2,acc0
32
        test_accg_immed         0,accg1
33
        test_acc_immed  2,acc1
34
 
35
        set_fr_iimmed   0x3fff,2,fr7    ; 15 bit result
36
        set_fr_iimmed   0x3fff,2,fr8
37
        mmulxhs         fr7,fr8,acc0
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
42
 
43
        set_fr_iimmed   0x4000,2,fr7    ; 16 bit result
44
        set_fr_iimmed   0x4000,2,fr8
45
        mmulxhs         fr7,fr8,acc0
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
50
 
51
        set_fr_iimmed   0x7fff,0x7fff,fr7       ; max positive result
52
        set_fr_iimmed   0x7fff,0x7fff,fr8
53
        mmulxhs         fr7,fr8,acc0
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
58
 
59
        ; Mixed operands
60
        set_fr_iimmed   2,0xfffd,fr7            ; multiply small numbers
61
        set_fr_iimmed   2,0xfffd,fr8
62
        mmulxhs         fr7,fr8,acc0
63
        test_accg_immed         0xff,accg0
64
        test_acc_immed  -6,acc0
65
        test_accg_immed         0xff,accg1
66
        test_acc_immed  -6,acc1
67
 
68
        set_fr_iimmed   0xfffe,1,fr7            ; multiply by 1
69
        set_fr_iimmed   0xfffe,1,fr8
70
        mmulxhs         fr7,fr8,acc0
71
        test_accg_immed         0xff,accg0
72
        test_acc_immed  -2,acc0
73
        test_accg_immed         0xff,accg1
74
        test_acc_immed  -2,acc1
75
 
76
        set_fr_iimmed   0xfffe,0,fr7            ; multiply by 0
77
        set_fr_iimmed   0xfffe,0,fr8
78
        mmulxhs         fr7,fr8,acc0
79
        test_accg_immed         0,accg0
80
        test_acc_immed  0,acc0
81
        test_accg_immed         0,accg1
82
        test_acc_immed  0,acc1
83
 
84
        set_fr_iimmed   0x2001,0xfffe,fr7       ; 15 bit result
85
        set_fr_iimmed   0x2001,0xfffe,fr8
86
        mmulxhs         fr7,fr8,acc0
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
91
 
92
        set_fr_iimmed   0x4000,0xfffe,fr7       ; 16 bit result
93
        set_fr_iimmed   0x4000,0xfffe,fr8
94
        mmulxhs         fr7,fr8,acc0
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
99
 
100
        set_fr_iimmed   0x7fff,0x8000,fr7       ; max negative result
101
        set_fr_iimmed   0x7fff,0x8000,fr8
102
        mmulxhs         fr7,fr8,acc0
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
107
 
108
        ; Negative operands
109
        set_fr_iimmed   0xfffe,0xfffd,fr7               ; multiply small numbers
110
        set_fr_iimmed   0xfffe,0xfffd,fr8
111
        mmulxhs         fr7,fr8,acc0
112
        test_accg_immed         0,accg0
113
        test_acc_immed  6,acc0
114
        test_accg_immed         0,accg1
115
        test_acc_immed  6,acc1
116
 
117
        set_fr_iimmed   0xffff,0xfffe,fr7               ; multiply by -1
118
        set_fr_iimmed   0xffff,0xfffe,fr8
119
        mmulxhs         fr7,fr8,acc0
120
        test_accg_immed         0,accg0
121
        test_acc_immed  2,acc0
122
        test_accg_immed         0,accg1
123
        test_acc_immed  2,acc1
124
 
125
        set_fr_iimmed   0x8001,0x8001,fr7       ; almost max positive result
126
        set_fr_iimmed   0x8001,0x8001,fr8
127
        mmulxhs         fr7,fr8,acc0
128
        test_accg_immed         0,accg0
129
        test_acc_immed  0x3fff0001,acc0
130
        test_accg_immed         0,accg1
131
        test_acc_immed  0x3fff0001,acc1
132
 
133
        set_fr_iimmed   0x8000,0x8000,fr7       ; max positive result
134
        set_fr_iimmed   0x8000,0x8000,fr8
135
        mmulxhs         fr7,fr8,acc0
136
        test_accg_immed         0,accg0
137
        test_acc_immed  0x40000000,acc0
138
        test_accg_immed         0,accg1
139
        test_acc_immed  0x40000000,acc1
140
 
141
        pass

powered by: WebSVN 2.1.0

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