1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
|
.text
.global start
! Starting point
start:
! test all ASRs
rd %asr0, %l0
rd %asr1, %l0
rd %asr15, %l0
rd %asr17, %l0
rd %asr18, %l0
rd %asr19, %l0 ! should stop the processor
rd %asr20, %l0
rd %asr21, %l0
rd %asr22, %l0
wr %l0, 0, %asr0
wr %l0, 0, %asr1
wr %l0, 0, %asr15
wr %l0, 0, %asr17
wr %l0, 0, %asr18
wr %l0, 0, %asr19
wr %l0, 0, %asr20
wr %l0, 0, %asr21
wr %l0, 0, %asr22
! test UMUL with no overflow inside Y
test_umul:
umul %g1, %g2, %g3
! test UMUL with an overflow inside Y
umul %g1, %g2, %g3 ! %g3 must be equal to 0
! test SMUL with negative result
test_smul:
smul %g1, %g2, %g3
! test SMUL with positive result
smul %g1, %g2, %g3
! test STBAR: there are two possible syntaxes
test_stbar:
stbar ! is a valid V8 syntax, at least a synthetic
! instruction
rd %asr15, %g0 ! other solution
! test UNIMP
unimp 1
! test FLUSH
flush %l1 ! is the official V8 syntax
! test SCAN: find first 0
test_scan:
scan %l1, 0xffffffff, %l3
! test scan: find first 1
scan %l1, 0, %l3
! test scan: find first bit != bit-0
scan %l1, %l1, %l3
! test SHUFFLE
test_shuffle:
shuffle %l0, 0x1, %l1
shuffle %l0, 0x2, %l1
shuffle %l0, 0x4, %l1
shuffle %l0, 0x8, %l1
shuffle %l0, 0x10, %l1
shuffle %l0, 0x18, %l1
! test UMAC
test_umac:
umac %l1, %l2, %l0
umac %l1, 2, %l0
umac 2, %l1, %l0
! test UMACD
test_umacd:
umacd %l2, %l4, %l0
umacd %l2, 3, %l0
umacd 3, %l2, %l0
! test SMAC
test_smac:
smac %l1, %l2, %l0
smac %l1, -42, %l0
smac -42, %l1, %l0
! test SMACD
test_smacd:
smacd %l2, %l4, %l0
smacd %l2, 123, %l0
smacd 123, %l2, %l0
! test UMULD
test_umuld:
umuld %o2, %o4, %o0
umuld %o2, 0x234, %o0
umuld 0x567, %o2, %o0
! test SMULD
test_smuld:
smuld %i2, %i4, %i0
smuld %i2, -4096, %i0
smuld 4095, %i4, %i0
! Coprocessor instructions
test_coprocessor:
! %ccsr is register # 0
! %ccfr is register # 1
! %ccpr is register # 3
! %cccrcr is register # 2
! test CPUSH: just syntax
cpush %l0, %l1
cpush %l0, 1
cpusha %l0, %l1
cpusha %l0, 1
! test CPULL: just syntax
cpull %l0
! test CPRDCXT: just syntax
crdcxt %ccsr, %l0
crdcxt %ccfr, %l0
crdcxt %ccpr, %l0
crdcxt %cccrcr, %l0
! test CPWRCXT: just syntax
cwrcxt %l0, %ccsr
cwrcxt %l0, %ccfr
cwrcxt %l0, %ccpr
cwrcxt %l0, %cccrcr
! test CBccc: just syntax
cbn stop
nop
cbn,a stop
nop
cbe stop
nop
cbe,a stop
nop
cbf stop
nop
cbf,a stop
nop
cbef stop
nop
cbef,a stop
nop
cbr stop
nop
cbr,a stop
nop
cber stop
nop
cber,a stop
nop
cbfr stop
nop
cbfr,a stop
nop
cbefr stop
nop
cbefr,a stop
nop
cba stop
nop
cba,a stop
nop
cbne stop
nop
cbne,a stop
nop
cbnf stop
nop
cbnf,a stop
nop
cbnef stop
nop
cbnef,a stop
nop
cbnr stop
nop
cbnr,a stop
nop
cbner stop
nop
cbner,a stop
nop
cbnfr stop
nop
cbnfr,a stop
nop
cbnefr stop
nop
cbnefr,a stop
nop
|