Coverage Report

Created: 2025-08-29 06:29

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