Coverage Report

Created: 2026-10-17 07:17

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