Coverage Report

Created: 2026-08-14 06:51

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
41.7k
{
17
41.7k
  if (!detail_is_set(MI)) {
18
0
    return;
19
0
  }
20
41.7k
  memset(get_detail(MI), 0,
21
41.7k
         offsetof(cs_detail, sparc) + sizeof(cs_sparc));
22
41.7k
  Sparc_get_detail(MI)->cc = SPARC_CC_UNDEF;
23
41.7k
  Sparc_get_detail(MI)->cc_field = SPARC_CC_FIELD_NONE;
24
41.7k
}
25
26
const insn_map sparc_insns[] = {
27
#include "SparcGenCSMappingInsn.inc"
28
};
29
30
void Sparc_set_instr_map_data(MCInst *MI)
31
41.7k
{
32
41.7k
  map_cs_id(MI, sparc_insns, ARR_SIZE(sparc_insns));
33
41.7k
  map_implicit_reads(MI, sparc_insns);
34
41.7k
  map_implicit_writes(MI, sparc_insns);
35
41.7k
  map_groups(MI, sparc_insns);
36
41.7k
  const sparc_suppl_info *suppl_info =
37
41.7k
    map_get_suppl_info(MI, sparc_insns);
38
41.7k
  if (suppl_info) {
39
41.7k
    Sparc_get_detail(MI)->format = suppl_info->form;
40
41.7k
  }
41
41.7k
}
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
41.7k
{
48
41.7k
  if (!Bytes || BytesLen < 4 || !detail_is_set(MI)) {
49
360
    return;
50
360
  }
51
41.4k
  uint32_t insn = readBytes32(MI, Bytes);
52
53
  // CC field
54
41.4k
  cs_sparc *detail = Sparc_get_detail(MI);
55
41.4k
  switch (detail->format) {
56
32.7k
  default:
57
32.7k
    break;
58
32.7k
  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.90k
    size_t op2 = get_insn_field_r(insn, 22, 24);
66
2.90k
    detail->cc_field = op2 == 6 ? SPARC_CC_FIELD_FCC0 :
67
2.90k
                SPARC_CC_FIELD_ICC;
68
2.90k
    break;
69
0
  }
70
3.68k
  case SPARC_INSN_FORM_F2_3:
71
3.68k
    detail->cc_field = get_insn_field_r(insn, 20, 21);
72
3.68k
    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.91k
      detail->cc_field |= 0x4;
76
1.91k
    }
77
3.68k
    break;
78
273
  case SPARC_INSN_FORM_TRAPSP:
79
273
    detail->cc_field = 0x4 | get_insn_field_r(insn, 11, 12);
80
273
    break;
81
150
  case SPARC_INSN_FORM_F4_1:
82
332
  case SPARC_INSN_FORM_F4_2:
83
332
    detail->cc_field = get_insn_field_r(insn, 11, 12);
84
332
    detail->cc_field |= get_insn_field_r(insn, 18, 18) << 2;
85
332
    break;
86
1.43k
  case SPARC_INSN_FORM_F4_3:
87
1.43k
    detail->cc_field = get_insn_field_r(insn, 11, 13);
88
1.43k
    break;
89
41.4k
  }
90
91
  // Condition codes
92
41.4k
  switch (detail->format) {
93
25.8k
  default:
94
25.8k
    break;
95
25.8k
  case SPARC_INSN_FORM_F2_1:
96
8.65k
  case SPARC_INSN_FORM_F2_2:
97
12.3k
  case SPARC_INSN_FORM_F2_3:
98
12.6k
  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
12.6k
    sparc_cc cc = get_insn_field_r(insn, 25, 28);
103
12.6k
    if (MCInst_getOpcode(MI) == Sparc_CBCOND ||
104
11.9k
        MCInst_getOpcode(MI) == Sparc_CBCONDA) {
105
1.32k
      cc += SPARC_CC_CPCC_BEGIN;
106
1.32k
    }
107
12.6k
    detail->cc = cc;
108
12.6k
    break;
109
12.3k
  }
110
150
  case SPARC_INSN_FORM_F4_1:
111
332
  case SPARC_INSN_FORM_F4_2:
112
1.76k
  case SPARC_INSN_FORM_F4_3: {
113
1.76k
    sparc_cc cc = get_insn_field_r(insn, 14, 17);
114
1.76k
    detail->cc = cc;
115
1.76k
    break;
116
332
  }
117
797
  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
797
    sparc_cc rcc = get_insn_field_r(insn, 25, 27);
122
797
    detail->cc = rcc + SPARC_CC_REG_BEGIN;
123
797
    break;
124
332
  }
125
299
  case SPARC_INSN_FORM_F4_4R:
126
436
  case SPARC_INSN_FORM_F4_4I: {
127
436
    sparc_cc rcc = get_insn_field_r(insn, 10, 12);
128
436
    detail->cc = rcc + SPARC_CC_REG_BEGIN;
129
436
    break;
130
299
  }
131
41.4k
  }
132
41.4k
  switch (detail->cc_field) {
133
32.7k
  default:
134
36.1k
  case SPARC_CC_FIELD_ICC:
135
37.6k
  case SPARC_CC_FIELD_XCC:
136
37.6k
    break;
137
2.65k
  case SPARC_CC_FIELD_FCC0:
138
2.93k
  case SPARC_CC_FIELD_FCC1:
139
3.28k
  case SPARC_CC_FIELD_FCC2:
140
3.76k
  case SPARC_CC_FIELD_FCC3:
141
3.76k
    detail->cc += SPARC_CC_FCC_BEGIN;
142
3.76k
    break;
143
41.4k
  }
144
145
  // Hints
146
41.4k
  switch (detail->format) {
147
34.0k
  default:
148
34.0k
    break;
149
34.0k
  case SPARC_INSN_FORM_F2_2:
150
2.90k
    detail->hint = get_insn_field_r(insn, 29, 29);
151
2.90k
    break;
152
3.68k
  case SPARC_INSN_FORM_F2_3:
153
4.47k
  case SPARC_INSN_FORM_F2_4:
154
4.47k
    detail->hint = get_insn_field_r(insn, 29, 29);
155
4.47k
    detail->hint |= get_insn_field_r(insn, 19, 19) == 0 ?
156
1.12k
          SPARC_HINT_PN :
157
4.47k
          SPARC_HINT_PT;
158
4.47k
    break;
159
41.4k
  }
160
41.4k
}
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
41.7k
{
166
41.7k
  Sparc_init_cs_detail(instr);
167
41.7k
  bool Result = Sparc_LLVM_getInstruction(handle, code, code_len, instr,
168
41.7k
            size, address,
169
41.7k
            info) != MCDisassembler_Fail;
170
41.7k
  Sparc_set_instr_map_data(instr);
171
172
41.7k
  Sparc_add_bit_details(instr, code, code_len);
173
41.7k
  return Result;
174
41.7k
}
175
176
void Sparc_init_mri(MCRegisterInfo *MRI)
177
1.06k
{
178
1.06k
  MCRegisterInfo_InitMCRegisterInfo(
179
1.06k
    MRI, SparcRegDesc, sizeof(SparcRegDesc), 0, 0,
180
1.06k
    SparcMCRegisterClasses, ARR_SIZE(SparcMCRegisterClasses), 0, 0,
181
1.06k
    SparcRegDiffLists, 0, SparcSubRegIdxLists,
182
1.06k
    ARR_SIZE(SparcSubRegIdxLists), 0);
183
1.06k
}
184
185
const char *Sparc_reg_name(csh handle, unsigned int reg)
186
18.1k
{
187
18.1k
  int syntax_opt = ((cs_struct *)(uintptr_t)handle)->syntax;
188
189
18.1k
  if (syntax_opt & CS_OPT_SYNTAX_NOREGNAME) {
190
0
    return Sparc_LLVM_getRegisterName(reg, Sparc_NoRegAltName);
191
0
  }
192
18.1k
  return Sparc_LLVM_getRegisterName(reg, Sparc_RegNamesStateReg);
193
18.1k
}
194
195
void Sparc_get_insn_id(cs_struct *h, cs_insn *insn, unsigned int id)
196
41.0k
{
197
  // Not used by Sparc. Information is set after disassembly.
198
41.0k
}
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
803
{
214
803
  if (!detail_is_set(MI)) {
215
0
    return;
216
0
  }
217
803
  Sparc_check_safe_inc(MI);
218
219
803
  cs_sparc_op *ops = Sparc_get_detail(MI)->operands;
220
803
  int i = Sparc_get_detail(MI)->op_count;
221
803
  if (index == -1) {
222
641
    ops[i] = op;
223
641
    Sparc_inc_op_count(MI);
224
641
    return;
225
641
  }
226
324
  for (; i > 0 && i > index; --i) {
227
162
    ops[i] = ops[i - 1];
228
162
  }
229
162
  ops[index] = op;
230
162
  Sparc_inc_op_count(MI);
231
162
}
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
803
{
239
803
  if (!detail_is_set(MI))
240
0
    return;
241
242
803
  cs_sparc_op op = { 0 };
243
803
  op.type = SPARC_OP_REG;
244
803
  op.reg = Reg;
245
803
  op.access = access;
246
803
  insert_op(MI, index, op);
247
803
}
248
249
static void Sparc_correct_details(MCInst *MI)
250
41.0k
{
251
41.0k
  if (!detail_is_set(MI)) {
252
0
    return;
253
0
  }
254
41.0k
  switch (MCInst_getOpcode(MI)) {
255
39.7k
  default:
256
39.7k
    return;
257
39.7k
  case Sparc_LDSTUBri:
258
187
  case Sparc_LDSTUBrr:
259
297
  case Sparc_LDSTUBAri:
260
516
  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
516
    Sparc_get_detail(MI)->operands[0].access = CS_AC_READ_WRITE;
265
516
    break;
266
84
  case Sparc_RDPSR:
267
84
    Sparc_insert_detail_op_reg_at(MI, 0, SPARC_REG_PSR, CS_AC_READ);
268
84
    break;
269
34
  case Sparc_PWRPSRri:
270
60
  case Sparc_PWRPSRrr:
271
221
  case Sparc_WRPSRri:
272
321
  case Sparc_WRPSRrr:
273
321
    Sparc_insert_detail_op_reg_at(MI, -1, SPARC_REG_PSR,
274
321
                CS_AC_WRITE);
275
321
    break;
276
71
  case Sparc_RDWIM:
277
71
    Sparc_insert_detail_op_reg_at(MI, 0, SPARC_REG_WIM, CS_AC_READ);
278
71
    break;
279
61
  case Sparc_WRWIMri:
280
106
  case Sparc_WRWIMrr:
281
106
    Sparc_insert_detail_op_reg_at(MI, -1, SPARC_REG_WIM,
282
106
                CS_AC_WRITE);
283
106
    break;
284
7
  case Sparc_RDTBR:
285
7
    Sparc_insert_detail_op_reg_at(MI, 0, SPARC_REG_TBR, CS_AC_READ);
286
7
    break;
287
80
  case Sparc_WRTBRri:
288
214
  case Sparc_WRTBRrr:
289
214
    Sparc_insert_detail_op_reg_at(MI, -1, SPARC_REG_TBR,
290
214
                CS_AC_WRITE);
291
214
    break;
292
41.0k
  }
293
41.0k
}
294
295
void Sparc_printer(MCInst *MI, SStream *O, void * /* MCRegisterInfo* */ info)
296
41.0k
{
297
41.0k
  MCRegisterInfo *MRI = (MCRegisterInfo *)info;
298
41.0k
  MI->MRI = MRI;
299
41.0k
  MI->flat_insn->usesAliasDetails = map_use_alias_details(MI);
300
41.0k
  Sparc_LLVM_printInst(MI, MI->address, "", O);
301
302
41.0k
#ifndef CAPSTONE_DIET
303
41.0k
  map_set_alias_id(MI, O, insn_alias_mnem_map,
304
41.0k
       ARR_SIZE(insn_alias_mnem_map));
305
41.0k
  Sparc_correct_details(MI);
306
41.0k
#endif
307
41.0k
}
308
309
const char *Sparc_insn_name(csh handle, unsigned int id)
310
41.0k
{
311
41.0k
#ifndef CAPSTONE_DIET
312
41.0k
  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
41.0k
  if (id >= SPARC_INS_ENDING)
319
0
    return NULL;
320
321
41.0k
  if (id < ARR_SIZE(insn_name_maps))
322
41.0k
    return insn_name_maps[id];
323
  // not found
324
0
  return NULL;
325
#else
326
  return NULL;
327
#endif
328
41.0k
}
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
87.3k
{
349
87.3k
#ifndef CAPSTONE_DIET
350
87.3k
  return id2name(group_name_maps, ARR_SIZE(group_name_maps), id);
351
#else
352
  return NULL;
353
#endif
354
87.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
21.9k
{
363
21.9k
  if (!detail_is_set(MI))
364
0
    return;
365
21.9k
  CS_ASSERT_RET((map_get_op_type(MI, OpNum) & ~CS_OP_MEM) == CS_OP_IMM);
366
21.9k
  CS_ASSERT_RET(ImmType == SPARC_OP_IMM);
367
368
21.9k
  Sparc_get_detail_op(MI, 0)->type = ImmType;
369
21.9k
  Sparc_get_detail_op(MI, 0)->imm = Imm;
370
21.9k
  Sparc_get_detail_op(MI, 0)->access = map_get_op_access(MI, OpNum);
371
21.9k
  Sparc_inc_op_count(MI);
372
21.9k
}
373
374
void Sparc_set_detail_op_reg(MCInst *MI, unsigned OpNum, sparc_reg Reg)
375
35.3k
{
376
35.3k
  if (!detail_is_set(MI))
377
0
    return;
378
35.3k
  CS_ASSERT_RET((map_get_op_type(MI, OpNum) & ~CS_OP_MEM) == CS_OP_REG);
379
380
35.3k
  switch (Reg) {
381
32.5k
  default:
382
32.5k
    Sparc_get_detail_op(MI, 0)->type = SPARC_OP_REG;
383
32.5k
    Sparc_get_detail_op(MI, 0)->reg = Reg;
384
32.5k
    Sparc_get_detail_op(MI, 0)->access =
385
32.5k
      map_get_op_access(MI, OpNum);
386
32.5k
    Sparc_inc_op_count(MI);
387
32.5k
    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
337
  case SPARC_REG_FCC0:
395
337
    Sparc_get_detail(MI)->cc_field = SPARC_CC_FIELD_FCC0;
396
337
    break;
397
283
  case SPARC_REG_FCC1:
398
283
    Sparc_get_detail(MI)->cc_field = SPARC_CC_FIELD_FCC1;
399
283
    break;
400
1.33k
  case SPARC_REG_FCC2:
401
1.33k
    Sparc_get_detail(MI)->cc_field = SPARC_CC_FIELD_FCC2;
402
1.33k
    break;
403
807
  case SPARC_REG_FCC3:
404
807
    Sparc_get_detail(MI)->cc_field = SPARC_CC_FIELD_FCC3;
405
807
    break;
406
35.3k
  }
407
35.3k
}
408
409
static inline bool is_single_reg_mem_case(MCInst *MI, unsigned OpNo)
410
18.6k
{
411
18.6k
  if (map_get_op_type(MI, OpNo) != CS_OP_MEM_REG) {
412
5.88k
    return false;
413
5.88k
  }
414
12.8k
  cs_sparc_op *prev_op = Sparc_get_detail_op(MI, -1);
415
12.8k
  if (prev_op && prev_op->type == SPARC_OP_MEM) {
416
11.4k
    return false;
417
11.4k
  }
418
1.33k
  if (MI->size == 1) {
419
0
    return true;
420
1.33k
  } else if (MI->size > OpNo + 1 &&
421
995
       Sparc_get_detail(MI)->operands[0].type != SPARC_OP_MEM) {
422
    // Next operand is not a memory operand (disponent or index reg).
423
995
    return !(map_get_op_type(MI, OpNo + 1) & SPARC_OP_MEM);
424
995
  }
425
339
  return false;
426
1.33k
}
427
428
void Sparc_add_cs_detail_0(MCInst *MI, sparc_op_group op_group, unsigned OpNo)
429
96.8k
{
430
96.8k
  if (!detail_is_set(MI) || !map_fill_detail_ops(MI))
431
0
    return;
432
433
96.8k
  cs_op_type op_type = map_get_op_type(MI, OpNo);
434
435
96.8k
  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
76.0k
  case Sparc_OP_GROUP_Operand:
441
76.0k
    if (op_type & CS_OP_MEM) {
442
18.6k
      if (is_single_reg_mem_case(MI, OpNo)) {
443
995
        Sparc_get_detail_op(MI, 0)->type = SPARC_OP_MEM;
444
995
        Sparc_get_detail_op(MI, 0)->mem.base =
445
995
          MCInst_getOpVal(MI, OpNo);
446
995
        Sparc_get_detail_op(MI, 0)->access =
447
995
          map_get_op_access(MI, OpNo);
448
995
        Sparc_inc_op_count(MI);
449
995
      }
450
18.6k
      break;
451
18.6k
    }
452
57.3k
    if (op_type == CS_OP_IMM) {
453
21.9k
      Sparc_set_detail_op_imm(MI, OpNo, SPARC_OP_IMM,
454
21.9k
            MCInst_getOpVal(MI, OpNo));
455
35.3k
    } else if (op_type == CS_OP_REG) {
456
35.3k
      Sparc_set_detail_op_reg(MI, OpNo,
457
35.3k
            MCInst_getOpVal(MI, OpNo));
458
35.3k
    } else {
459
0
      CS_ASSERT_RET(0 && "Op type not handled.");
460
0
    }
461
57.3k
    Sparc_get_detail_op(MI, 0)->access =
462
57.3k
      map_get_op_access(MI, OpNo);
463
57.3k
    break;
464
6.96k
  case Sparc_OP_GROUP_CCOperand: {
465
    // Handled in Sparc_add_bit_details().
466
6.96k
    break;
467
57.3k
  }
468
10.0k
  case Sparc_OP_GROUP_MemOperand: {
469
10.0k
    cs_sparc_op *prev_op = Sparc_get_detail_op(MI, -1);
470
10.0k
    if (prev_op && prev_op->type == SPARC_OP_MEM) {
471
      // Already added.
472
0
      break;
473
0
    }
474
10.0k
    MCOperand *Op1 = MCInst_getOperand(MI, (OpNo));
475
10.0k
    MCOperand *Op2 = MCInst_getOperand(MI, (OpNo + 1));
476
10.0k
    if (!MCOperand_isReg(Op1) ||
477
10.0k
        MCOperand_getReg(Op1) == Sparc_G0) {
478
      // Ignored
479
810
      return;
480
810
    }
481
9.24k
    Sparc_get_detail_op(MI, 0)->type = SPARC_OP_MEM;
482
9.24k
    Sparc_get_detail_op(MI, 0)->access =
483
9.24k
      map_get_op_access(MI, OpNo);
484
9.24k
    Sparc_get_detail_op(MI, 0)->mem.base = MCOperand_getReg(Op1);
485
486
9.24k
    if (MCOperand_isReg(Op2) && MCOperand_getReg(Op2) != Sparc_G0) {
487
2.22k
      Sparc_get_detail_op(MI, 0)->mem.index =
488
2.22k
        MCOperand_getReg(Op2);
489
7.01k
    } else if (MCOperand_isImm(Op2) && MCOperand_getImm(Op2) != 0) {
490
5.83k
      Sparc_get_detail_op(MI, 0)->mem.disp =
491
5.83k
        MCOperand_getImm(Op2);
492
5.83k
    }
493
9.24k
    Sparc_inc_op_count(MI);
494
9.24k
    break;
495
10.0k
  }
496
3.08k
  case Sparc_OP_GROUP_ASITag:
497
3.08k
    Sparc_get_detail_op(MI, 0)->type = SPARC_OP_ASI;
498
3.08k
    Sparc_get_detail_op(MI, 0)->access =
499
3.08k
      map_get_op_access(MI, OpNo);
500
3.08k
    Sparc_get_detail_op(MI, 0)->asi =
501
3.08k
      MCOperand_getImm(MCInst_getOperand(MI, OpNo));
502
3.08k
    Sparc_inc_op_count(MI);
503
3.08k
    break;
504
755
  case Sparc_OP_GROUP_MembarTag:
505
755
    Sparc_get_detail_op(MI, 0)->type = SPARC_OP_MEMBAR_TAG;
506
755
    Sparc_get_detail_op(MI, 0)->access =
507
755
      map_get_op_access(MI, OpNo);
508
755
    Sparc_get_detail_op(MI, 0)->membar_tag =
509
755
      MCOperand_getImm(MCInst_getOperand(MI, OpNo));
510
755
    Sparc_inc_op_count(MI);
511
755
    break;
512
96.8k
  }
513
96.8k
}
514
515
#endif