-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathOPCODES
273 lines (238 loc) · 4.13 KB
/
OPCODES
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
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
Control instructions:
They don't seem to have short or immediate forms, nor use op2. Needs to be
checked some day.
op tested pred insn
0 F + discard
1 * + bra
2 * - call
3 * + ret
4 * - breakaddr
5 * + break
6 * - quadon
7 * - quadpop
8 C - bar sync
9 * - trap
a * - joinat
b C ? brkpt sm11
c !C
d !C
e !C
f !C
Short instructions:
Usual format:
0x00000003: set to 0
0x000000fc: S*DST
0x00000100: flag1
0x00007e00: S*SRC or S*SHARED
0x00008000: flag2
0x003f0000: S*SRC2 or S*CONST
0x00400000: flag3
0x00800000: use S*CONST
0x01000000: use S*SHARED
0x0e000000: addressing
0xf0000000: opcode
op tested insn
0 !CF
1 * mov
2 * add
3 * add
4 * mul
5 * sad
6 * madd
7 * madd
8 F !C interp
9 * rcp
a
b * add f32
c * mul f32
d !CF
e * madd f32
f * tex
Immediate instructions:
Looks like there are no immediate instructions with non-0 op2, but let's check
anyway.
Usual format:
0x0000000000000003: set to 1
0x00000000000000fc: S*DST
0x0000000000000100: flag1
0x0000000000007e00: S*SRC or S*SHARED
0x0000000000008000: flag2
0x00000000003f0000: IMMD, low part
0x0000000000400000: flag3
0x0000000000800000: -
0x0000000001000000: use S*SHARED
0x000000000e000000: addressing
0x00000000f0000000: opcode
0x0000000300000000: set to 3
0x0ffffffc00000000: IMMD, high part
0x1000000000000000: -
0xe000000000000000: op2
op op2 tested insn
0 0 !C
1 0 * mov
2 0 * add
3 0 * add
4 0 * mul
5 0 !C
6 0 * madd
7 0 * madd
8 0 !C
9 0 !C
a 0 !C
b 0 * add f32
c 0 * mul f32
d 0 * bitop
e 0 * madd f32
f 0 !C
All non-0 op2's were tried on CP and didn't work.
Long instructions
Mostly, destination is in L*DST or LLDST, sources are in:
- 1: L*SRC or L*SHARED
- 2: L*SRC2 or L*CONST2, or SHCNT for shift insns
- 3: L*SRC3 or L*CONST3
Some insns can also set $c registers with MCDST, or read them eith COND.
Usual format:
0x0000000000000003: set to 1
0x00000000000001fc: L*DST
0x000000000000fe00: L*SRC or L*SHARED
0x00000000007f0000: L*SRC2 or L*CONST2
0x0000000000800000: use L*CONST2
0x0000000001000000: use L*CONST3
0x000000000e000000: addressing
0x00000000f0000000: opcode
0x0000000300000000: 0 normal, 1 with exit, 2 with join
0x0000000400000000: addressing
0x0000000800000000: $o DST instead of $r
0x0000003000000000: $c reg to set
0x0000004000000000: enable setting that $c.
0x00000f8000000000: predicate condition
0x0000300000000000: $c to use for predicate and/or carry input
0x001fc00000000000: L*SRC3 or L*CONST3
0x0020000000000000: use L*SHARED
0x03c0000000000000: c[] space to use
0x0c00000000000000: misc flags
0x1000000000000000: -
0xe000000000000000: op2
[op2 shifted left to be in alignment with the hexit you see]
op op2 tested insn
0 0 !FC mov from a[]
0 2 * mov from $c
0 4 * mov from $a
0 6 * mov from special reg
0 8 !FC
0 a * mov to $c
0 c * shl to $a
0 e C mov to s[] XXX WTF? does something on FP
1 0 * mov
1 2 * mov from c[]
1 4 C !F mov from s[] sm11
1 6 C vote sm12
1 8 !FC
1 a !FC
1 c !FC
1 e !FC
2 0 * add
2 2 !FC
2 4 !FC
2 6 !FC
2 8 !FC
2 a !FC
2 c !FC
2 e !FC
3 0 * add
3 2 !FC
3 4 !FC
3 6 * set
3 8 * max
3 a * min
3 c * shl
3 e * shr
4 0 * mul
4 2 !C
4 4 !C
4 6 !C
4 8 !C
4 a !C
4 c !C
4 e !C
5 0 * sad
5 2 !FC
5 4 !FC
5 6 !FC
5 8 !FC
5 a !FC
5 c !FC
5 e !FC
6 0 * madd
6 2 * madd
6 4 * madd
6 6 * madd
6 8 * madd
6 a * madd
6 c * madd
6 e * madd
7 0 * madd
7 2 XXX ??? \
7 4 XXX ??? |
7 6 XXX ??? |
7 8 XXX ??? | seem to be copies of 6/6 for some reason.
7 a XXX ??? |
7 c XXX ??? |
7 e XXX ??? /
8 0 F !C interp
8 2 !FC
8 4 !FC
8 6 !FC
8 8 !FC
8 a !FC
8 c !FC
8 e !FC
9 0 * rcp f32
9 2 !FC
9 4 * rsqrt f32
9 6 * lg2 f32
9 8 * sin f32
9 a * cos f32
9 c * ex2 f32
9 e !FC
a * * cvt
b 0 * add f32
b 2 * add f32
b 4 !FC
b 6 * set f32
b 8 * max f32
b a * min f32
b c * pre f32
b e !FC
c 0 * mul f32
c 2 !FC
c 4 * slct f32
c 6 * slct f32 neg
c 8 * quadop
c a !FC
c c !FC
c e !FC
d 0 * bitop
d 2 * add from $a to $a
d 4 * mov from l[]
d 6 * mov to l[]
d 8 C mov from g[] weird format
d a C mov to g[]
d c C atom g[]
d e C ld atom g[]
e 0 * madd f32
e 2 * madd f32
e 4 C madd f64
e 6 C add f64
e 8 C mul f64
e a C min f64
e c C max f64
e e C set f64
f 0 * tex
f 2 * tex
f 4 * tex
f 6 * tex
f 8 * tex
f a C XXX ??? looks like it does exactly nothing.
f c G !C emit,restart
f e */C nop/pmevent