CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
hrydgard

CoCalc provides the best real-time collaborative environment for Jupyter Notebooks, LaTeX documents, and SageMath, scalable from individual users to large groups and classes!

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