Coverage Report

Created: 2026-06-15 06:41

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