Coverage Report

Created: 2026-01-12 07:13

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/capstonenext/arch/Sparc/SparcMapping.c
Line
Count
Source
1
/* Capstone Disassembly Engine */
2
/* By Nguyen Anh Quynh <aquynh@gmail.com>, 2013-2015 */
3
4
#ifdef CAPSTONE_HAS_SPARC
5
6
#include <stdio.h> // debug
7
#include <string.h>
8
9
#include "../../Mapping.h"
10
#include "../../utils.h"
11
#include "../../cs_simple_types.h"
12
13
#include "SparcMapping.h"
14
15
void Sparc_init_cs_detail(MCInst *MI)
16
36.2k
{
17
36.2k
  if (!detail_is_set(MI)) {
18
0
    return;
19
0
  }
20
36.2k
  memset(get_detail(MI), 0,
21
36.2k
         offsetof(cs_detail, sparc) + sizeof(cs_sparc));
22
36.2k
  Sparc_get_detail(MI)->cc = SPARC_CC_UNDEF;
23
36.2k
  Sparc_get_detail(MI)->cc_field = SPARC_CC_FIELD_NONE;
24
36.2k
}
25
26
const insn_map sparc_insns[] = {
27
#include "SparcGenCSMappingInsn.inc"
28
};
29
30
void Sparc_set_instr_map_data(MCInst *MI)
31
36.2k
{
32
36.2k
  map_cs_id(MI, sparc_insns, ARR_SIZE(sparc_insns));
33
36.2k
  map_implicit_reads(MI, sparc_insns);
34
36.2k
  map_implicit_writes(MI, sparc_insns);
35
36.2k
  map_groups(MI, sparc_insns);
36
36.2k
  const sparc_suppl_info *suppl_info =
37
36.2k
    map_get_suppl_info(MI, sparc_insns);
38
36.2k
  if (suppl_info) {
39
36.2k
    Sparc_get_detail(MI)->format = suppl_info->form;
40
36.2k
  }
41
36.2k
}
42
43
/// Adds details which are not defined consistently as LLVM operands like
44
/// condition codes for alias instructions or branch hint bits.
45
static void Sparc_add_bit_details(MCInst *MI, const uint8_t *Bytes,
46
          size_t BytesLen)
47
36.2k
{
48
36.2k
  if (!Bytes || BytesLen < 4 || !detail_is_set(MI)) {
49
470
    return;
50
470
  }
51
35.7k
  uint32_t insn = readBytes32(MI, Bytes);
52
53
  // CC field
54
35.7k
  cs_sparc *detail = Sparc_get_detail(MI);
55
35.7k
  switch (detail->format) {
56
28.3k
  default:
57
28.3k
    break;
58
28.3k
  case SPARC_INSN_FORM_F2_2: {
59
    // This format is used either by B or FB instructions.
60
    // The op2 == 6 for the FB and 2 for B.
61
    // This is the only indicator we have here to determine which CC field is used
62
    // if we don't want big switch cases.
63
    //
64
    // See: Opcode Maps - Table 39 - Sparc V9 ISA
65
2.37k
    size_t op2 = get_insn_field_r(insn, 22, 24);
66
2.37k
    detail->cc_field = op2 == 6 ? SPARC_CC_FIELD_FCC0 :
67
2.37k
                SPARC_CC_FIELD_ICC;
68
2.37k
    break;
69
0
  }
70
3.13k
  case SPARC_INSN_FORM_F2_3:
71
3.13k
    detail->cc_field = get_insn_field_r(insn, 20, 21);
72
3.13k
    if (get_insn_field_r(insn, 22, 24) == 1) {
73
      // BPcc and FBPcc encode their fields in two bits.
74
      // BPcc needs the upper bit set to match our CC field enum.
75
1.60k
      detail->cc_field |= 0x4;
76
1.60k
    }
77
3.13k
    break;
78
280
  case SPARC_INSN_FORM_TRAPSP:
79
280
    detail->cc_field = 0x4 | get_insn_field_r(insn, 11, 12);
80
280
    break;
81
212
  case SPARC_INSN_FORM_F4_1:
82
500
  case SPARC_INSN_FORM_F4_2:
83
500
    detail->cc_field = get_insn_field_r(insn, 11, 12);
84
500
    detail->cc_field |= get_insn_field_r(insn, 18, 18) << 2;
85
500
    break;
86
1.07k
  case SPARC_INSN_FORM_F4_3:
87
1.07k
    detail->cc_field = get_insn_field_r(insn, 11, 13);
88
1.07k
    break;
89
35.7k
  }
90
91
  // Condition codes
92
35.7k
  switch (detail->format) {
93
23.5k
  default:
94
23.5k
    break;
95
23.5k
  case SPARC_INSN_FORM_F2_1:
96
5.50k
  case SPARC_INSN_FORM_F2_2:
97
8.64k
  case SPARC_INSN_FORM_F2_3:
98
8.92k
  case SPARC_INSN_FORM_TRAPSP: {
99
    // cond
100
    // Alias instructions don't define the conditions as operands.
101
    // We need to add them here to the details again.
102
8.92k
    sparc_cc cc = get_insn_field_r(insn, 25, 28);
103
8.92k
    if (MCInst_getOpcode(MI) == Sparc_CBCOND ||
104
8.51k
        MCInst_getOpcode(MI) == Sparc_CBCONDA) {
105
724
      cc += SPARC_CC_CPCC_BEGIN;
106
724
    }
107
8.92k
    detail->cc = cc;
108
8.92k
    break;
109
8.64k
  }
110
212
  case SPARC_INSN_FORM_F4_1:
111
500
  case SPARC_INSN_FORM_F4_2:
112
1.57k
  case SPARC_INSN_FORM_F4_3: {
113
1.57k
    sparc_cc cc = get_insn_field_r(insn, 14, 17);
114
1.57k
    detail->cc = cc;
115
1.57k
    break;
116
500
  }
117
1.09k
  case SPARC_INSN_FORM_F2_4: {
118
    // cond
119
    // Alias instructions don't define the conditions as operands.
120
    // We need to add them here to the details again.
121
1.09k
    sparc_cc rcc = get_insn_field_r(insn, 25, 27);
122
1.09k
    detail->cc = rcc + SPARC_CC_REG_BEGIN;
123
1.09k
    break;
124
500
  }
125
342
  case SPARC_INSN_FORM_F4_4R:
126
632
  case SPARC_INSN_FORM_F4_4I: {
127
632
    sparc_cc rcc = get_insn_field_r(insn, 10, 12);
128
632
    detail->cc = rcc + SPARC_CC_REG_BEGIN;
129
632
    break;
130
342
  }
131
35.7k
  }
132
35.7k
  switch (detail->cc_field) {
133
28.3k
  default:
134
30.8k
  case SPARC_CC_FIELD_ICC:
135
31.9k
  case SPARC_CC_FIELD_XCC:
136
31.9k
    break;
137
2.64k
  case SPARC_CC_FIELD_FCC0:
138
2.92k
  case SPARC_CC_FIELD_FCC1:
139
3.46k
  case SPARC_CC_FIELD_FCC2:
140
3.85k
  case SPARC_CC_FIELD_FCC3:
141
3.85k
    detail->cc += SPARC_CC_FCC_BEGIN;
142
3.85k
    break;
143
35.7k
  }
144
145
  // Hints
146
35.7k
  switch (detail->format) {
147
29.1k
  default:
148
29.1k
    break;
149
29.1k
  case SPARC_INSN_FORM_F2_2:
150
2.37k
    detail->hint = get_insn_field_r(insn, 29, 29);
151
2.37k
    break;
152
3.13k
  case SPARC_INSN_FORM_F2_3:
153
4.23k
  case SPARC_INSN_FORM_F2_4:
154
4.23k
    detail->hint = get_insn_field_r(insn, 29, 29);
155
4.23k
    detail->hint |= get_insn_field_r(insn, 19, 19) == 0 ?
156
1.05k
          SPARC_HINT_PN :
157
4.23k
          SPARC_HINT_PT;
158
4.23k
    break;
159
35.7k
  }
160
35.7k
}
161
162
bool Sparc_getInstruction(csh handle, const uint8_t *code, size_t code_len,
163
        MCInst *instr, uint16_t *size, uint64_t address,
164
        void *info)
165
36.2k
{
166
36.2k
  Sparc_init_cs_detail(instr);
167
36.2k
  bool Result = Sparc_LLVM_getInstruction(handle, code, code_len, instr,
168
36.2k
            size, address,
169
36.2k
            info) != MCDisassembler_Fail;
170
36.2k
  Sparc_set_instr_map_data(instr);
171
172
36.2k
  Sparc_add_bit_details(instr, code, code_len);
173
36.2k
  return Result;
174
36.2k
}
175
176
void Sparc_init_mri(MCRegisterInfo *MRI)
177
1.46k
{
178
1.46k
  MCRegisterInfo_InitMCRegisterInfo(
179
1.46k
    MRI, SparcRegDesc, sizeof(SparcRegDesc), 0, 0,
180
1.46k
    SparcMCRegisterClasses, ARR_SIZE(SparcMCRegisterClasses), 0, 0,
181
1.46k
    SparcRegDiffLists, 0, SparcSubRegIdxLists,
182
1.46k
    ARR_SIZE(SparcSubRegIdxLists), 0);
183
1.46k
}
184
185
const char *Sparc_reg_name(csh handle, unsigned int reg)
186
12.6k
{
187
12.6k
  int syntax_opt = ((cs_struct *)(uintptr_t)handle)->syntax;
188
189
12.6k
  if (syntax_opt & CS_OPT_SYNTAX_NOREGNAME) {
190
0
    return Sparc_LLVM_getRegisterName(reg, Sparc_NoRegAltName);
191
0
  }
192
12.6k
  return Sparc_LLVM_getRegisterName(reg, Sparc_RegNamesStateReg);
193
12.6k
}
194
195
void Sparc_get_insn_id(cs_struct *h, cs_insn *insn, unsigned int id)
196
35.5k
{
197
  // Not used by Sparc. Information is set after disassembly.
198
35.5k
}
199
200
static const char *const insn_name_maps[] = {
201
#include "SparcGenCSMappingInsnName.inc"
202
};
203
204
#ifndef CAPSTONE_DIET
205
static const name_map insn_alias_mnem_map[] = {
206
#include "SparcGenCSAliasMnemMap.inc"
207
  { SPARC_INS_ALIAS_CALL, "call" },
208
  { SPARC_INS_ALIAS_END, NULL },
209
};
210
#endif
211
212
static void insert_op(MCInst *MI, unsigned index, cs_sparc_op op)
213
970
{
214
970
  if (!detail_is_set(MI)) {
215
0
    return;
216
0
  }
217
970
  Sparc_check_safe_inc(MI);
218
219
970
  cs_sparc_op *ops = Sparc_get_detail(MI)->operands;
220
970
  int i = Sparc_get_detail(MI)->op_count;
221
970
  if (index == -1) {
222
793
    ops[i] = op;
223
793
    Sparc_inc_op_count(MI);
224
793
    return;
225
793
  }
226
354
  for (; i > 0 && i > index; --i) {
227
177
    ops[i] = ops[i - 1];
228
177
  }
229
177
  ops[index] = op;
230
177
  Sparc_inc_op_count(MI);
231
177
}
232
233
/// Inserts a register to the detail operands at @index.
234
/// Already present operands are moved.
235
/// If @index is -1 the operand is appended.
236
static void Sparc_insert_detail_op_reg_at(MCInst *MI, unsigned index,
237
            sparc_reg Reg, cs_ac_type access)
238
970
{
239
970
  if (!detail_is_set(MI))
240
0
    return;
241
242
970
  cs_sparc_op op = { 0 };
243
970
  op.type = SPARC_OP_REG;
244
970
  op.reg = Reg;
245
970
  op.access = access;
246
970
  insert_op(MI, index, op);
247
970
}
248
249
static void Sparc_correct_details(MCInst *MI)
250
35.5k
{
251
35.5k
  if (!detail_is_set(MI)) {
252
0
    return;
253
0
  }
254
35.5k
  switch (MCInst_getOpcode(MI)) {
255
33.3k
  default:
256
33.3k
    return;
257
33.3k
  case Sparc_LDSTUBri:
258
191
  case Sparc_LDSTUBrr:
259
689
  case Sparc_LDSTUBAri:
260
1.13k
  case Sparc_LDSTUBArr:
261
    // The memory gets written back with ones
262
    // but there is not write back memory operand defined
263
    // (if even possible).
264
1.13k
    Sparc_get_detail(MI)->operands[0].access = CS_AC_READ_WRITE;
265
1.13k
    break;
266
34
  case Sparc_RDPSR:
267
34
    Sparc_insert_detail_op_reg_at(MI, 0, SPARC_REG_PSR, CS_AC_READ);
268
34
    break;
269
35
  case Sparc_PWRPSRri:
270
106
  case Sparc_PWRPSRrr:
271
184
  case Sparc_WRPSRri:
272
384
  case Sparc_WRPSRrr:
273
384
    Sparc_insert_detail_op_reg_at(MI, -1, SPARC_REG_PSR,
274
384
                CS_AC_WRITE);
275
384
    break;
276
75
  case Sparc_RDWIM:
277
75
    Sparc_insert_detail_op_reg_at(MI, 0, SPARC_REG_WIM, CS_AC_READ);
278
75
    break;
279
77
  case Sparc_WRWIMri:
280
143
  case Sparc_WRWIMrr:
281
143
    Sparc_insert_detail_op_reg_at(MI, -1, SPARC_REG_WIM,
282
143
                CS_AC_WRITE);
283
143
    break;
284
68
  case Sparc_RDTBR:
285
68
    Sparc_insert_detail_op_reg_at(MI, 0, SPARC_REG_TBR, CS_AC_READ);
286
68
    break;
287
218
  case Sparc_WRTBRri:
288
266
  case Sparc_WRTBRrr:
289
266
    Sparc_insert_detail_op_reg_at(MI, -1, SPARC_REG_TBR,
290
266
                CS_AC_WRITE);
291
266
    break;
292
35.5k
  }
293
35.5k
}
294
295
void Sparc_printer(MCInst *MI, SStream *O, void * /* MCRegisterInfo* */ info)
296
35.5k
{
297
35.5k
  MCRegisterInfo *MRI = (MCRegisterInfo *)info;
298
35.5k
  MI->MRI = MRI;
299
35.5k
  MI->flat_insn->usesAliasDetails = map_use_alias_details(MI);
300
35.5k
  Sparc_LLVM_printInst(MI, MI->address, "", O);
301
302
35.5k
#ifndef CAPSTONE_DIET
303
35.5k
  map_set_alias_id(MI, O, insn_alias_mnem_map,
304
35.5k
       ARR_SIZE(insn_alias_mnem_map));
305
35.5k
  Sparc_correct_details(MI);
306
35.5k
#endif
307
35.5k
}
308
309
const char *Sparc_insn_name(csh handle, unsigned int id)
310
35.5k
{
311
35.5k
#ifndef CAPSTONE_DIET
312
35.5k
  if (id < SPARC_INS_ALIAS_END && id > SPARC_INS_ALIAS_BEGIN) {
313
0
    if (id - SPARC_INS_ALIAS_BEGIN >= ARR_SIZE(insn_alias_mnem_map))
314
0
      return NULL;
315
316
0
    return insn_alias_mnem_map[id - SPARC_INS_ALIAS_BEGIN - 1].name;
317
0
  }
318
35.5k
  if (id >= SPARC_INS_ENDING)
319
0
    return NULL;
320
321
35.5k
  if (id < ARR_SIZE(insn_name_maps))
322
35.5k
    return insn_name_maps[id];
323
  // not found
324
0
  return NULL;
325
#else
326
  return NULL;
327
#endif
328
35.5k
}
329
330
#ifndef CAPSTONE_DIET
331
static const name_map group_name_maps[] = {
332
  { SPARC_GRP_INVALID, NULL },
333
334
  { SPARC_GRP_JUMP, "jump" },
335
  { SPARC_GRP_CALL, "call" },
336
  { SPARC_GRP_RET, "return" },
337
  { SPARC_GRP_INT, "int" },
338
  { SPARC_GRP_IRET, "iret" },
339
  { SPARC_GRP_PRIVILEGE, "privilege" },
340
  { SPARC_GRP_BRANCH_RELATIVE, "branch_relative" },
341
342
// architecture-specific groups
343
#include "SparcGenCSFeatureName.inc"
344
};
345
#endif
346
347
const char *Sparc_group_name(csh handle, unsigned int id)
348
26.3k
{
349
26.3k
#ifndef CAPSTONE_DIET
350
26.3k
  return id2name(group_name_maps, ARR_SIZE(group_name_maps), id);
351
#else
352
  return NULL;
353
#endif
354
26.3k
}
355
356
static const map_insn_ops insn_operands[] = {
357
#include "SparcGenCSMappingInsnOp.inc"
358
};
359
360
void Sparc_set_detail_op_imm(MCInst *MI, unsigned OpNum, sparc_op_type ImmType,
361
           int64_t Imm)
362
14.8k
{
363
14.8k
  if (!detail_is_set(MI))
364
0
    return;
365
14.8k
  CS_ASSERT_RET((map_get_op_type(MI, OpNum) & ~CS_OP_MEM) == CS_OP_IMM);
366
14.8k
  CS_ASSERT_RET(ImmType == SPARC_OP_IMM);
367
368
14.8k
  Sparc_get_detail_op(MI, 0)->type = ImmType;
369
14.8k
  Sparc_get_detail_op(MI, 0)->imm = Imm;
370
14.8k
  Sparc_get_detail_op(MI, 0)->access = map_get_op_access(MI, OpNum);
371
14.8k
  Sparc_inc_op_count(MI);
372
14.8k
}
373
374
void Sparc_set_detail_op_reg(MCInst *MI, unsigned OpNum, sparc_reg Reg)
375
34.9k
{
376
34.9k
  if (!detail_is_set(MI))
377
0
    return;
378
34.9k
  CS_ASSERT_RET((map_get_op_type(MI, OpNum) & ~CS_OP_MEM) == CS_OP_REG);
379
380
34.9k
  switch (Reg) {
381
33.0k
  default:
382
33.0k
    Sparc_get_detail_op(MI, 0)->type = SPARC_OP_REG;
383
33.0k
    Sparc_get_detail_op(MI, 0)->reg = Reg;
384
33.0k
    Sparc_get_detail_op(MI, 0)->access =
385
33.0k
      map_get_op_access(MI, OpNum);
386
33.0k
    Sparc_inc_op_count(MI);
387
33.0k
    return;
388
  // The LLVM definition is inconsistent with the cc fields.
389
  // Sometimes they are encoded as register, sometimes not at all.
390
  // For Capstone they are always saved in the cc_field field for now.
391
0
  case SPARC_REG_ICC:
392
0
    Sparc_get_detail(MI)->cc_field = SPARC_CC_FIELD_ICC;
393
0
    break;
394
258
  case SPARC_REG_FCC0:
395
258
    Sparc_get_detail(MI)->cc_field = SPARC_CC_FIELD_FCC0;
396
258
    break;
397
367
  case SPARC_REG_FCC1:
398
367
    Sparc_get_detail(MI)->cc_field = SPARC_CC_FIELD_FCC1;
399
367
    break;
400
908
  case SPARC_REG_FCC2:
401
908
    Sparc_get_detail(MI)->cc_field = SPARC_CC_FIELD_FCC2;
402
908
    break;
403
393
  case SPARC_REG_FCC3:
404
393
    Sparc_get_detail(MI)->cc_field = SPARC_CC_FIELD_FCC3;
405
393
    break;
406
34.9k
  }
407
34.9k
}
408
409
static inline bool is_single_reg_mem_case(MCInst *MI, unsigned OpNo)
410
21.4k
{
411
21.4k
  if (map_get_op_type(MI, OpNo) != CS_OP_MEM_REG) {
412
5.83k
    return false;
413
5.83k
  }
414
15.6k
  cs_sparc_op *prev_op = Sparc_get_detail_op(MI, -1);
415
15.6k
  if (prev_op && prev_op->type == SPARC_OP_MEM) {
416
14.4k
    return false;
417
14.4k
  }
418
1.16k
  if (MI->size == 1) {
419
0
    return true;
420
1.16k
  } else if (MI->size > OpNo + 1 &&
421
944
       Sparc_get_detail(MI)->operands[0].type != SPARC_OP_MEM) {
422
    // Next operand is not a memory operand (disponent or index reg).
423
944
    return !(map_get_op_type(MI, OpNo + 1) & SPARC_OP_MEM);
424
944
  }
425
225
  return false;
426
1.16k
}
427
428
void Sparc_add_cs_detail_0(MCInst *MI, sparc_op_group op_group, unsigned OpNo)
429
94.9k
{
430
94.9k
  if (!detail_is_set(MI) || !map_fill_detail_ops(MI))
431
0
    return;
432
433
94.9k
  cs_op_type op_type = map_get_op_type(MI, OpNo);
434
435
94.9k
  switch (op_group) {
436
0
  default:
437
0
  case Sparc_OP_GROUP_GetPCX:
438
0
    printf("Operand group %d not handled!\n", op_group);
439
0
    return;
440
71.2k
  case Sparc_OP_GROUP_Operand:
441
71.2k
    if (op_type & CS_OP_MEM) {
442
21.4k
      if (is_single_reg_mem_case(MI, OpNo)) {
443
944
        Sparc_get_detail_op(MI, 0)->type = SPARC_OP_MEM;
444
944
        Sparc_get_detail_op(MI, 0)->mem.base =
445
944
          MCInst_getOpVal(MI, OpNo);
446
944
        Sparc_get_detail_op(MI, 0)->access =
447
944
          map_get_op_access(MI, OpNo);
448
944
        Sparc_inc_op_count(MI);
449
944
      }
450
21.4k
      break;
451
21.4k
    }
452
49.7k
    if (op_type == CS_OP_IMM) {
453
14.8k
      Sparc_set_detail_op_imm(MI, OpNo, SPARC_OP_IMM,
454
14.8k
            MCInst_getOpVal(MI, OpNo));
455
34.9k
    } else if (op_type == CS_OP_REG) {
456
34.9k
      Sparc_set_detail_op_reg(MI, OpNo,
457
34.9k
            MCInst_getOpVal(MI, OpNo));
458
34.9k
    } else {
459
0
      CS_ASSERT_RET(0 && "Op type not handled.");
460
0
    }
461
49.7k
    Sparc_get_detail_op(MI, 0)->access =
462
49.7k
      map_get_op_access(MI, OpNo);
463
49.7k
    break;
464
6.69k
  case Sparc_OP_GROUP_CCOperand: {
465
    // Handled in Sparc_add_bit_details().
466
6.69k
    break;
467
49.7k
  }
468
11.6k
  case Sparc_OP_GROUP_MemOperand: {
469
11.6k
    cs_sparc_op *prev_op = Sparc_get_detail_op(MI, -1);
470
11.6k
    if (prev_op && prev_op->type == SPARC_OP_MEM) {
471
      // Already added.
472
0
      break;
473
0
    }
474
11.6k
    MCOperand *Op1 = MCInst_getOperand(MI, (OpNo));
475
11.6k
    MCOperand *Op2 = MCInst_getOperand(MI, (OpNo + 1));
476
11.6k
    if (!MCOperand_isReg(Op1) ||
477
11.6k
        MCOperand_getReg(Op1) == Sparc_G0) {
478
      // Ignored
479
780
      return;
480
780
    }
481
10.8k
    Sparc_get_detail_op(MI, 0)->type = SPARC_OP_MEM;
482
10.8k
    Sparc_get_detail_op(MI, 0)->access =
483
10.8k
      map_get_op_access(MI, OpNo);
484
10.8k
    Sparc_get_detail_op(MI, 0)->mem.base = MCOperand_getReg(Op1);
485
486
10.8k
    if (MCOperand_isReg(Op2) && MCOperand_getReg(Op2) != Sparc_G0) {
487
3.61k
      Sparc_get_detail_op(MI, 0)->mem.index =
488
3.61k
        MCOperand_getReg(Op2);
489
7.23k
    } else if (MCOperand_isImm(Op2) && MCOperand_getImm(Op2) != 0) {
490
5.74k
      Sparc_get_detail_op(MI, 0)->mem.disp =
491
5.74k
        MCOperand_getImm(Op2);
492
5.74k
    }
493
10.8k
    Sparc_inc_op_count(MI);
494
10.8k
    break;
495
11.6k
  }
496
4.00k
  case Sparc_OP_GROUP_ASITag:
497
4.00k
    Sparc_get_detail_op(MI, 0)->type = SPARC_OP_ASI;
498
4.00k
    Sparc_get_detail_op(MI, 0)->access =
499
4.00k
      map_get_op_access(MI, OpNo);
500
4.00k
    Sparc_get_detail_op(MI, 0)->asi =
501
4.00k
      MCOperand_getImm(MCInst_getOperand(MI, OpNo));
502
4.00k
    Sparc_inc_op_count(MI);
503
4.00k
    break;
504
1.42k
  case Sparc_OP_GROUP_MembarTag:
505
1.42k
    Sparc_get_detail_op(MI, 0)->type = SPARC_OP_MEMBAR_TAG;
506
1.42k
    Sparc_get_detail_op(MI, 0)->access =
507
1.42k
      map_get_op_access(MI, OpNo);
508
1.42k
    Sparc_get_detail_op(MI, 0)->membar_tag =
509
1.42k
      MCOperand_getImm(MCInst_getOperand(MI, OpNo));
510
1.42k
    Sparc_inc_op_count(MI);
511
1.42k
    break;
512
94.9k
  }
513
94.9k
}
514
515
#endif