Coverage Report

Created: 2026-03-13 06:50

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