Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
hrydgard
GitHub Repository: hrydgard/ppsspp
Path: blob/master/Core/MIPS/MIPSDisVFPU.cpp
3186 views
1
// Copyright (c) 2012- PPSSPP Project.
2
3
// This program is free software: you can redistribute it and/or modify
4
// it under the terms of the GNU General Public License as published by
5
// the Free Software Foundation, version 2.0 or later versions.
6
7
// This program is distributed in the hope that it will be useful,
8
// but WITHOUT ANY WARRANTY; without even the implied warranty of
9
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10
// GNU General Public License 2.0 for more details.
11
12
// A copy of the GPL 2.0 should have been included with the program.
13
// If not, see http://www.gnu.org/licenses/
14
15
// Official git repository and contact information can be found at
16
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
17
18
#include "Common/Data/Convert/SmallDataConvert.h"
19
#include "Common/StringUtils.h"
20
#include "Core/MIPS/MIPS.h"
21
#include "Core/MIPS/MIPSDis.h"
22
#include "Core/MIPS/MIPSTables.h"
23
#include "Core/MIPS/MIPSDebugInterface.h"
24
#include "Core/MIPS/MIPSVFPUUtils.h"
25
26
#define _RS ((op>>21) & 0x1F)
27
#define _RT ((op>>16) & 0x1F)
28
#define _RD ((op>>11) & 0x1F)
29
#define _FS ((op>>11) & 0x1F)
30
#define _FT ((op>>16) & 0x1F)
31
#define _FD ((op>>6 ) & 0x1F)
32
#define _POS ((op>>6 ) & 0x1F)
33
#define _SIZE ((op>>11) & 0x1F)
34
35
36
#define RN(i) (currentDebugMIPS->GetRegName(0, i).c_str())
37
#define FN(i) (currentDebugMIPS->GetRegName(1, i).c_str())
38
//#define VN(i) (currentDebugMIPS->GetRegName(2, i).c_str())
39
40
41
#define S_not(a,b,c) (a<<2)|(b)|(c<<5)
42
#define SgetA(v) (((v)>>2)&0x7)
43
#define SgetB(v) ((v)&3)
44
#define SgetC(v) (((v)>>5)&0x3)
45
46
#define HorizOff 32
47
#define VertOff 1
48
#define MtxOff 4
49
50
inline std::string VNStr(int v, VectorSize size) {
51
static const char * const vfpuCtrlNames[VFPU_CTRL_MAX] = {
52
"SPFX",
53
"TPFX",
54
"DPFX",
55
"CC",
56
"INF4",
57
"RSV5",
58
"RSV6",
59
"REV",
60
"RCX0",
61
"RCX1",
62
"RCX2",
63
"RCX3",
64
"RCX4",
65
"RCX5",
66
"RCX6",
67
"RCX7",
68
};
69
if (size == V_Single && v >= 128 && v < 128 + VFPU_CTRL_MAX) {
70
return vfpuCtrlNames[v - 128];
71
} else if (size == V_Single && v == 255) {
72
return "(interlock)";
73
}
74
75
return GetVectorNotation(v, size);
76
}
77
78
inline std::string MNStr(int v, MatrixSize size) {
79
return GetMatrixNotation(v, size);
80
}
81
82
#define VN(v, s) (VNStr(v, s).c_str())
83
#define MN(v, s) (MNStr(v, s).c_str())
84
85
inline const char *VSuff(MIPSOpcode op)
86
{
87
int a = (op>>7)&1;
88
int b = (op>>15)&1;
89
a+=(b<<1);
90
switch (a)
91
{
92
case 0: return ".s";
93
case 1: return ".p";
94
case 2: return ".t";
95
case 3: return ".q";
96
default: return "%";
97
}
98
}
99
100
namespace MIPSDis
101
{
102
std::string SignedHex(int i);
103
104
void Dis_SV(MIPSOpcode op, uint32_t pc, char *out, size_t outSize) {
105
int offset = SignExtend16ToS32(op & 0xFFFC);
106
int vt = ((op>>16)&0x1f)|((op&3)<<5);
107
int rs = (op>>21) & 0x1f;
108
const char *name = MIPSGetName(op);
109
snprintf(out, outSize, "%s\t%s, %s(%s)", name, VN(vt, V_Single), SignedHex(offset).c_str(), RN(rs));
110
}
111
112
void Dis_SVQ(MIPSOpcode op, uint32_t pc, char *out, size_t outSize) {
113
int offset = SignExtend16ToS32(op & 0xFFFC);
114
int vt = (((op>>16)&0x1f))|((op&1)<<5);
115
int rs = (op>>21) & 0x1f;
116
const char *name = MIPSGetName(op);
117
size_t outpos = 0;
118
outpos += snprintf(out, outSize, "%s\t%s, %s(%s)", name, VN(vt, V_Quad), SignedHex(offset).c_str(), RN(rs));
119
if ((op & 2) && outpos < outSize)
120
truncate_cpy(out + outpos, outSize - outpos, ", wb");
121
}
122
123
void Dis_SVLRQ(MIPSOpcode op, uint32_t pc, char *out, size_t outSize) {
124
int offset = SignExtend16ToS32(op & 0xFFFC);
125
int vt = (((op>>16)&0x1f))|((op&1)<<5);
126
int rs = (op>>21) & 0x1f;
127
int lr = (op>>1)&1;
128
const char *name = MIPSGetName(op);
129
snprintf(out, outSize, "%s%s.q\t%s, %s(%s)", name, lr ? "r" : "l", VN(vt, V_Quad), SignedHex(offset).c_str(), RN(rs));
130
}
131
132
void Dis_Mftv(MIPSOpcode op, uint32_t pc, char *out, size_t outSize) {
133
int vr = op & 0xFF;
134
int rt = _RT;
135
const char *name = MIPSGetName(op);
136
snprintf(out, outSize, "%s%s\t%s, %s", name, vr > 127 ? "c" : "", RN(rt), VN(vr, V_Single));
137
}
138
139
void Dis_Vmfvc(MIPSOpcode op, uint32_t pc, char *out, size_t outSize) {
140
int vd = _VD;
141
int vr = (op >> 8) & 0x7F;
142
const char* name = MIPSGetName(op);
143
snprintf(out, outSize, "%s\t%s, %s", name, VN(vd, V_Single), VN(vr + 128, V_Single));
144
}
145
146
void Dis_Vmtvc(MIPSOpcode op, uint32_t pc, char *out, size_t outSize) {
147
int vr = op & 0x7F;
148
int vs = _VS;
149
const char *name = MIPSGetName(op);
150
snprintf(out, outSize, "%s\t%s, %s", name, VN(vs, V_Single), VN(vr + 128, V_Single));
151
}
152
153
void Dis_VPFXST(MIPSOpcode op, uint32_t pc, char *out, size_t outSize) {
154
int data = op & 0xFFFFF;
155
const char *name = MIPSGetName(op);
156
size_t outpos = snprintf(out, outSize, "%s\t[", name);
157
158
static const char * const regnam[4] = {"X","Y","Z","W"};
159
static const char * const constan[8] = {"0","1","2","1/2","3","1/3","1/4","1/6"};
160
for (int i=0; i<4; i++)
161
{
162
int regnum = (data>>(i*2)) & 3;
163
int abs = (data>>(8+i)) & 1;
164
int negate = (data>>(16+i)) & 1;
165
int constants = (data>>(12+i)) & 1;
166
if (negate && outpos < outSize)
167
outpos += truncate_cpy(out + outpos, outSize - outpos, "-");
168
if (abs && !constants && outpos < outSize)
169
outpos += truncate_cpy(out + outpos, outSize - outpos, "|");
170
if (!constants) {
171
if (outpos < outSize)
172
outpos += truncate_cpy(out + outpos, outSize - outpos, regnam[regnum]);
173
} else {
174
if (abs)
175
regnum+=4;
176
if (outpos < outSize)
177
outpos += truncate_cpy(out + outpos, outSize - outpos, constan[regnum]);
178
}
179
if (abs && !constants && outpos < outSize)
180
outpos += truncate_cpy(out + outpos, outSize - outpos, "|");
181
if (i != 3 && outpos < outSize)
182
outpos += truncate_cpy(out + outpos, outSize - outpos, ",");
183
}
184
185
if (outpos < outSize)
186
outpos += truncate_cpy(out + outpos, outSize - outpos, "]");
187
}
188
189
void Dis_VPFXD(MIPSOpcode op, uint32_t pc, char *out, size_t outSize) {
190
int data = op & 0xFFFFF;
191
const char *name = MIPSGetName(op);
192
size_t outpos = snprintf(out, outSize, "%s\t[", name);
193
194
static const char * const satNames[4] = {"", "0:1", "X", "-1:1"};
195
for (int i=0; i<4; i++)
196
{
197
int sat = (data>>i*2)&3;
198
int mask = (data>>(8+i))&1;
199
if (sat && outpos < outSize)
200
outpos += truncate_cpy(out + outpos, outSize - outpos, satNames[sat]);
201
if (mask && outpos < outSize)
202
outpos += truncate_cpy(out + outpos, outSize - outpos, "M");
203
if (i < 4 - 1 && outpos < outSize)
204
outpos += truncate_cpy(out + outpos, outSize - outpos, ",");
205
}
206
207
if (outpos < outSize)
208
outpos += truncate_cpy(out + outpos, outSize - outpos, "]");
209
}
210
211
212
void Dis_Viim(MIPSOpcode op, uint32_t pc, char *out, size_t outSize) {
213
int vt = _VT;
214
int imm = SignExtend16ToS32(op & 0xFFFF);
215
const char *name = MIPSGetName(op);
216
217
int type = (op >> 23) & 7;
218
if (type == 6)
219
snprintf(out, outSize, "%s\t%s, %i", name, VN(vt, V_Single), imm);
220
else if (type == 7)
221
snprintf(out, outSize, "%s\t%s, %f", name, VN(vt, V_Single), Float16ToFloat32((u16)imm));
222
else
223
snprintf(out, outSize, "%s\tARGH", name);
224
}
225
226
void Dis_Vcst(MIPSOpcode op, uint32_t pc, char *out, size_t outSize) {
227
int conNum = (op>>16) & 0x1f;
228
int vd = _VD;
229
VectorSize sz = GetVecSize(op);
230
static const char * const constants[32] =
231
{
232
"(undef)",
233
"MaxFloat",
234
"Sqrt(2)",
235
"Sqrt(1/2)",
236
"2/Sqrt(PI)",
237
"2/PI",
238
"1/PI",
239
"PI/4",
240
"PI/2",
241
"PI",
242
"e",
243
"Log2(e)",
244
"Log10(e)",
245
"ln(2)",
246
"ln(10)",
247
"2*PI",
248
"PI/6",
249
"Log10(2)",
250
"Log2(10)",
251
"Sqrt(3)/2"
252
};
253
const char *name = MIPSGetName(op);
254
const char *c = constants[conNum];
255
if (c==0) c = constants[0];
256
snprintf(out, outSize, "%s%s\t%s, %s", name, VSuff(op), VN(vd,sz), c);
257
}
258
259
260
void Dis_MatrixSet1(MIPSOpcode op, uint32_t pc, char *out, size_t outSize) {
261
const char *name = MIPSGetName(op);
262
int vd = _VD;
263
MatrixSize sz = GetMtxSize(op);
264
snprintf(out, outSize, "%s%s\t%s", name, VSuff(op), MN(vd, sz));
265
}
266
void Dis_MatrixSet2(MIPSOpcode op, uint32_t pc, char *out, size_t outSize) {
267
const char *name = MIPSGetName(op);
268
int vd = _VD;
269
int vs = _VS;
270
MatrixSize sz = GetMtxSize(op);
271
snprintf(out, outSize, "%s%s\t%s, %s", name, VSuff(op), MN(vd, sz), MN(vs,sz));
272
}
273
void Dis_MatrixSet3(MIPSOpcode op, uint32_t pc, char *out, size_t outSize) {
274
const char *name = MIPSGetName(op);
275
int vd = _VD;
276
int vs = _VS;
277
int vt = _VT;
278
MatrixSize sz = GetMtxSize(op);
279
snprintf(out, outSize, "%s%s\t%s, %s, %s", name, VSuff(op), MN(vd, sz), MN(vs,sz), MN(vt,sz));
280
}
281
282
void Dis_MatrixMult(MIPSOpcode op, uint32_t pc, char *out, size_t outSize) {
283
const char *name = MIPSGetName(op);
284
int vd = _VD;
285
int vs = _VS;
286
int vt = _VT;
287
MatrixSize sz = GetMtxSize(op);
288
// TODO: Xpose?
289
snprintf(out, outSize, "%s%s\t%s, %s, %s", name, VSuff(op), MN(vd, sz), MN(Xpose(vs),sz), MN(vt,sz));
290
}
291
292
void Dis_Vmscl(MIPSOpcode op, uint32_t pc, char *out, size_t outSize) {
293
const char *name = MIPSGetName(op);
294
int vd = _VD;
295
int vs = _VS;
296
int vt = _VT;
297
MatrixSize sz = GetMtxSize(op);
298
snprintf(out, outSize, "%s%s\t%s, %s, %s", name, VSuff(op), MN(vd, sz), MN(vs, sz), VN(vt, V_Single));
299
}
300
301
void Dis_VectorDot(MIPSOpcode op, uint32_t pc, char *out, size_t outSize) {
302
const char *name = MIPSGetName(op);
303
int vd = _VD;
304
int vs = _VS;
305
int vt = _VT;
306
VectorSize sz = GetVecSize(op);
307
snprintf(out, outSize, "%s%s\t%s, %s, %s", name, VSuff(op), VN(vd, V_Single), VN(vs,sz), VN(vt, sz));
308
}
309
310
void Dis_Vtfm(MIPSOpcode op, uint32_t pc, char *out, size_t outSize) {
311
int vd = _VD;
312
int vs = _VS;
313
int vt = _VT;
314
int ins = (op>>23) & 7;
315
VectorSize sz = GetVecSize(op);
316
MatrixSize msz = GetMtxSize(op);
317
int n = GetNumVectorElements(sz);
318
319
if (n == ins)
320
{
321
//homogenous
322
snprintf(out, outSize, "vhtfm%i%s\t%s, %s, %s", n, VSuff(op), VN(vd, sz), MN(vs, msz), VN(vt, sz));
323
}
324
else if (n == ins+1)
325
{
326
snprintf(out, outSize, "vtfm%i%s\t%s, %s, %s", n, VSuff(op), VN(vd, sz), MN(vs, msz), VN(vt, sz));
327
}
328
else
329
{
330
truncate_cpy(out, outSize, "BADVTFM");
331
}
332
}
333
334
void Dis_Vflush(MIPSOpcode op, uint32_t pc, char *out, size_t outSize) {
335
truncate_cpy(out, outSize, "vflush");
336
}
337
338
void Dis_Vcrs(MIPSOpcode op, uint32_t pc, char *out, size_t outSize) {
339
const char *name = MIPSGetName(op);
340
int vt = _VT;
341
int vs = _VS;
342
int vd = _VD;
343
VectorSize sz = GetVecSize(op);
344
if (sz != V_Triple)
345
{
346
truncate_cpy(out, outSize, "vcrs\tERROR");
347
}
348
else
349
snprintf(out, outSize, "%s%s\t%s, %s, %s", name, VSuff(op), VN(vd, sz), VN(vs, sz), VN(vt,sz));
350
}
351
352
353
void Dis_Vcmp(MIPSOpcode op, uint32_t pc, char *out, size_t outSize) {
354
const char *name = MIPSGetName(op);
355
int vt = _VT;
356
int vs = _VS;
357
int cond = op&15;
358
VectorSize sz = GetVecSize(op);
359
const char *condNames[16] = {"FL","EQ","LT","LE","TR","NE","GE","GT","EZ","EN","EI","ES","NZ","NN","NI","NS"};
360
snprintf(out, outSize, "%s%s\t%s, %s, %s", name, VSuff(op), condNames[cond], VN(vs, sz), VN(vt,sz));
361
}
362
363
void Dis_Vcmov(MIPSOpcode op, uint32_t pc, char *out, size_t outSize) {
364
const char *name = MIPSGetName(op);
365
VectorSize sz = GetVecSize(op);
366
int vd = _VD;
367
int vs = _VS;
368
int tf = (op >> 19)&3;
369
int imm3 = (op>>16)&7;
370
if (tf > 1)
371
{
372
snprintf(out, outSize, "%s\tARGH%i", name, tf);
373
return;
374
}
375
if (imm3<6)
376
snprintf(out, outSize, "%s%s%s\t%s, %s, CC[%i]", name, tf==0?"t":"f", VSuff(op), VN(vd, sz), VN(vs,sz), imm3);
377
else if (imm3 == 6)
378
snprintf(out, outSize, "%s%s%s\t%s, %s, CC[...]", name, tf==0?"t":"f", VSuff(op), VN(vd, sz), VN(vs,sz));
379
}
380
381
void Dis_Vfad(MIPSOpcode op, uint32_t pc, char *out, size_t outSize) {
382
const char *name = MIPSGetName(op);
383
int vd = _VD;
384
int vs = _VS;
385
VectorSize sz = GetVecSize(op);
386
snprintf(out, outSize, "%s%s\t%s, %s", name, VSuff(op), VN(vd, V_Single), VN(vs,sz));
387
}
388
389
void Dis_VScl(MIPSOpcode op, uint32_t pc, char *out, size_t outSize) {
390
const char *name = MIPSGetName(op);
391
int vd = _VD;
392
int vs = _VS;
393
int vt = _VT;
394
VectorSize sz = GetVecSize(op);
395
snprintf(out, outSize, "%s%s\t%s, %s, %s", name, VSuff(op), VN(vd, sz), VN(vs,sz), VN(vt, V_Single));
396
}
397
398
void Dis_VectorSet1(MIPSOpcode op, uint32_t pc, char *out, size_t outSize) {
399
const char *name = MIPSGetName(op);
400
int vd = _VD;
401
VectorSize sz = GetVecSize(op);
402
snprintf(out, outSize, "%s%s\t%s", name, VSuff(op), VN(vd, sz));
403
}
404
void Dis_VectorSet2(MIPSOpcode op, uint32_t pc, char *out, size_t outSize) {
405
const char *name = MIPSGetName(op);
406
int vd = _VD;
407
int vs = _VS;
408
VectorSize sz = GetVecSize(op);
409
snprintf(out, outSize, "%s%s\t%s, %s", name, VSuff(op), VN(vd, sz), VN(vs, sz));
410
}
411
void Dis_VectorSet3(MIPSOpcode op, uint32_t pc, char *out, size_t outSize) {
412
const char *name = MIPSGetName(op);
413
int vd = _VD;
414
int vs = _VS;
415
int vt = _VT;
416
VectorSize sz = GetVecSize(op);
417
snprintf(out, outSize, "%s%s\t%s, %s, %s", name, VSuff(op), VN(vd, sz), VN(vs,sz), VN(vt, sz));
418
}
419
420
void Dis_VRot(MIPSOpcode op, uint32_t pc, char *out, size_t outSize) {
421
int vd = _VD;
422
int vs = _VS;
423
int imm = (op>>16) & 0x1f;
424
bool negSin = (imm & 0x10) ? true : false;
425
char c[5] = "0000";
426
char temp[16]={""};
427
if (((imm>>2)&3)==(imm&3))
428
{
429
for (int i=0; i<4; i++)
430
c[i]='S';
431
}
432
c[(imm>>2) & 3] = 'S';
433
c[imm&3] = 'C';
434
VectorSize sz = GetVecSize(op);
435
int numElems = GetNumVectorElements(sz);
436
int pos = 0;
437
temp[pos++] = '[';
438
for (int i=0; i<numElems; i++)
439
{
440
if (c[i] == 'S' && negSin)
441
temp[pos++] = '-';
442
temp[pos++] = c[i];
443
if (i != numElems-1)
444
temp[pos++] = ',';
445
}
446
temp[pos++] = ']';
447
temp[pos]=0;
448
const char *name = MIPSGetName(op);
449
snprintf(out, outSize, "%s%s\t%s, %s, %s", name, VSuff(op), VN(vd, sz), VN(vs, V_Single),temp);
450
}
451
452
void Dis_CrossQuat(MIPSOpcode op, uint32_t pc, char *out, size_t outSize) {
453
VectorSize sz = GetVecSize(op);
454
const char *name;
455
switch (sz)
456
{
457
case V_Triple:
458
name = "vcrsp";
459
//Ah, a regular cross product.
460
break;
461
case V_Quad:
462
name = "vqmul";
463
//Ah, a quaternion multiplication.
464
break;
465
default:
466
// invalid
467
name = "???";
468
break;
469
}
470
int vd = _VD;
471
int vs = _VS;
472
int vt = _VT;
473
snprintf(out, outSize, "%s%s\t%s, %s, %s", name, VSuff(op), VN(vd, sz), VN(vs,sz), VN(vt, sz));
474
}
475
476
void Dis_Vbfy(MIPSOpcode op, uint32_t pc, char *out, size_t outSize) {
477
VectorSize sz = GetVecSize(op);
478
int vd = _VD;
479
int vs = _VS;
480
const char *name = MIPSGetName(op);
481
snprintf(out, outSize, "%s%s\t%s, %s", name, VSuff(op), VN(vd, sz), VN(vs, sz));
482
}
483
484
void Dis_Vf2i(MIPSOpcode op, uint32_t pc, char *out, size_t outSize) {
485
VectorSize sz = GetVecSize(op);
486
int vd = _VD;
487
int vs = _VS;
488
int imm = (op>>16)&0x1f;
489
const char *name = MIPSGetName(op);
490
snprintf(out, outSize, "%s%s\t%s, %s, %i", name, VSuff(op), VN(vd, sz), VN(vs, sz), imm);
491
}
492
493
void Dis_Vs2i(MIPSOpcode op, uint32_t pc, char *out, size_t outSize) {
494
VectorSize sz = GetVecSize(op);
495
int vd = _VD;
496
int vs = _VS;
497
const char *name = MIPSGetName(op);
498
snprintf(out, outSize, "%s%s\t%s, %s", name, VSuff(op), VN(vd, sz), VN(vs, sz));
499
}
500
501
void Dis_Vi2x(MIPSOpcode op, uint32_t pc, char *out, size_t outSize) {
502
VectorSize sz = GetVecSize(op);
503
VectorSize dsz = GetHalfVectorSizeSafe(sz);
504
if (((op>>16)&3)==0)
505
dsz = V_Single;
506
507
int vd = _VD;
508
int vs = _VS;
509
const char *name = MIPSGetName(op);
510
snprintf(out, outSize, "%s%s\t%s, %s", name, VSuff(op), VN(vd, dsz), VN(vs, sz));
511
}
512
513
void Dis_Vwbn(MIPSOpcode op, uint32_t pc, char *out, size_t outSize) {
514
VectorSize sz = GetVecSize(op);
515
516
int vd = _VD;
517
int vs = _VS;
518
int imm = (int)((op >> 16) & 0xFF);
519
const char *name = MIPSGetName(op);
520
snprintf(out, outSize, "%s%s\t%s, %s, %d", name, VSuff(op), VN(vd, sz), VN(vs, sz), imm);
521
}
522
523
void Dis_Vf2h(MIPSOpcode op, uint32_t pc, char *out, size_t outSize) {
524
VectorSize sz = GetVecSize(op);
525
VectorSize dsz = GetHalfVectorSizeSafe(sz);
526
if (((op>>16)&3)==0)
527
dsz = V_Single;
528
529
int vd = _VD;
530
int vs = _VS;
531
const char *name = MIPSGetName(op);
532
snprintf(out, outSize, "%s%s\t%s, %s", name, VSuff(op), VN(vd, dsz), VN(vs, sz));
533
}
534
535
void Dis_Vh2f(MIPSOpcode op, uint32_t pc, char *out, size_t outSize) {
536
VectorSize sz = GetVecSize(op);
537
VectorSize dsz = GetDoubleVectorSizeSafe(sz);
538
539
int vd = _VD;
540
int vs = _VS;
541
const char *name = MIPSGetName(op);
542
snprintf(out, outSize, "%s%s\t%s, %s", name, VSuff(op), VN(vd, dsz), VN(vs, sz));
543
}
544
545
void Dis_ColorConv(MIPSOpcode op, uint32_t pc, char *out, size_t outSize) {
546
VectorSize sz = GetVecSize(op);
547
VectorSize dsz = GetHalfVectorSizeSafe(sz);
548
549
int vd = _VD;
550
int vs = _VS;
551
const char *name = MIPSGetName(op);
552
snprintf(out, outSize, "%s%s\t%s, %s", name, VSuff(op), VN(vd, dsz), VN(vs, sz));
553
}
554
555
void Dis_Vrnds(MIPSOpcode op, uint32_t pc, char *out, size_t outSize) {
556
int vd = _VD;
557
const char *name = MIPSGetName(op);
558
snprintf(out, outSize, "%s%s\t%s", name, VSuff(op), VN(vd, V_Single));
559
}
560
561
void Dis_VrndX(MIPSOpcode op, uint32_t pc, char *out, size_t outSize) {
562
VectorSize sz = GetVecSize(op);
563
564
int vd = _VD;
565
const char *name = MIPSGetName(op);
566
snprintf(out, outSize, "%s%s\t%s", name, VSuff(op), VN(vd, sz));
567
}
568
569
void Dis_VBranch(MIPSOpcode op, uint32_t pc, char *out, size_t outSize) {
570
u32 off = pc;
571
int imm = SignExtend16ToS32(op&0xFFFF) << 2;
572
int imm3 = (op>>18)&7;
573
off += imm + 4;
574
const char *name = MIPSGetName(op);
575
snprintf(out, outSize, "%s\t->$%08x (CC[%i])", name, off, imm3);
576
}
577
578
}
579
580