Coverage Report

Created: 2025-11-09 07:00

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