Coverage Report

Created: 2023-08-28 06:23

/src/binutils-gdb/opcodes/tic54x-dis.c
Line
Count
Source (jump to first uncovered line)
1
/* Disassembly routines for TMS320C54X architecture
2
   Copyright (C) 1999-2023 Free Software Foundation, Inc.
3
   Contributed by Timothy Wall (twall@cygnus.com)
4
5
   This file is part of the GNU opcodes library.
6
7
   This library is free software; you can redistribute it and/or modify
8
   it under the terms of the GNU General Public License as published by
9
   the Free Software Foundation; either version 3, or (at your option)
10
   any later version.
11
12
   It is distributed in the hope that it will be useful, but WITHOUT
13
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
14
   or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
15
   License for more details.
16
17
   You should have received a copy of the GNU General Public License
18
   along with this file; see the file COPYING.  If not, write to the
19
   Free Software Foundation, 51 Franklin Street - Fifth Floor, Boston,
20
   MA 02110-1301, USA.  */
21
22
#include "sysdep.h"
23
#include <errno.h>
24
#include <math.h>
25
#include <stdlib.h>
26
#include "disassemble.h"
27
#include "opcode/tic54x.h"
28
#include "coff/tic54x.h"
29
30
static int has_lkaddr (unsigned short, const insn_template *);
31
static int get_insn_size (unsigned short, const insn_template *);
32
static int print_instruction (disassemble_info *, bfd_vma,
33
                              unsigned short, const char *,
34
                              const enum optype [], int, int);
35
static int print_parallel_instruction (disassemble_info *, bfd_vma,
36
                                       unsigned short,
37
                                       const insn_template *, int);
38
static int sprint_dual_address (disassemble_info *,char [],
39
                                unsigned short);
40
static int sprint_indirect_address (disassemble_info *,char [],
41
                                    unsigned short);
42
static int sprint_direct_address (disassemble_info *,char [],
43
                                  unsigned short);
44
static int sprint_mmr (disassemble_info *,char [],int);
45
static int sprint_condition (disassemble_info *,char *,unsigned short);
46
static int sprint_cc2 (disassemble_info *,char *,unsigned short);
47
48
int
49
print_insn_tic54x (bfd_vma memaddr, disassemble_info *info)
50
0
{
51
0
  bfd_byte opbuf[2];
52
0
  unsigned short opcode;
53
0
  int status, size;
54
0
  const insn_template* tm;
55
56
0
  status = (*info->read_memory_func) (memaddr, opbuf, 2, info);
57
0
  if (status != 0)
58
0
  {
59
0
    (*info->memory_error_func) (status, memaddr, info);
60
0
    return -1;
61
0
  }
62
63
0
  opcode = bfd_getl16 (opbuf);
64
0
  tm = tic54x_get_insn (info, memaddr, opcode, &size);
65
66
0
  info->bytes_per_line = 2;
67
0
  info->bytes_per_chunk = 2;
68
0
  info->octets_per_byte = 2;
69
0
  info->display_endian = BFD_ENDIAN_LITTLE;
70
71
0
  if (tm->flags & FL_PAR)
72
0
  {
73
0
    if (!print_parallel_instruction (info, memaddr, opcode, tm, size))
74
0
      return -1;
75
0
  }
76
0
  else
77
0
  {
78
0
    if (!print_instruction (info, memaddr, opcode,
79
0
                            (char *) tm->name,
80
0
                            tm->operand_types,
81
0
                            size, (tm->flags & FL_EXT)))
82
0
      return -1;
83
0
  }
84
85
0
  return size * 2;
86
0
}
87
88
static int
89
has_lkaddr (unsigned short memdata, const insn_template *tm)
90
0
{
91
0
  return (IS_LKADDR (memdata)
92
0
    && (OPTYPE (tm->operand_types[0]) == OP_Smem
93
0
        || OPTYPE (tm->operand_types[1]) == OP_Smem
94
0
        || OPTYPE (tm->operand_types[2]) == OP_Smem
95
0
        || OPTYPE (tm->operand_types[1]) == OP_Sind
96
0
              || OPTYPE (tm->operand_types[0]) == OP_Lmem
97
0
              || OPTYPE (tm->operand_types[1]) == OP_Lmem));
98
0
}
99
100
/* always returns 1 (whether an insn template was found) since we provide an
101
   "unknown instruction" template */
102
const insn_template*
103
tic54x_get_insn (disassemble_info *info, bfd_vma addr,
104
                 unsigned short memdata, int *size)
105
0
{
106
0
  const insn_template *tm = NULL;
107
108
0
  for (tm = tic54x_optab; tm->name; tm++)
109
0
  {
110
0
    if (tm->opcode == (memdata & tm->mask))
111
0
    {
112
      /* a few opcodes span two words */
113
0
      if (tm->flags & FL_EXT)
114
0
        {
115
          /* if lk addressing is used, the second half of the opcode gets
116
             pushed one word later */
117
0
          bfd_byte opbuf[2];
118
0
          bfd_vma addr2 = addr + 1 + has_lkaddr (memdata, tm);
119
0
          int status = (*info->read_memory_func) (addr2, opbuf, 2, info);
120
          /* FIXME handle errors.  */
121
0
          if (status == 0)
122
0
            {
123
0
              unsigned short data2 = bfd_getl16 (opbuf);
124
0
              if (tm->opcode2 == (data2 & tm->mask2))
125
0
                {
126
0
                  if (size) *size = get_insn_size (memdata, tm);
127
0
                  return tm;
128
0
                }
129
0
            }
130
0
        }
131
0
      else
132
0
        {
133
0
          if (size) *size = get_insn_size (memdata, tm);
134
0
          return tm;
135
0
        }
136
0
    }
137
0
  }
138
0
  for (tm = (insn_template *) tic54x_paroptab; tm->name; tm++)
139
0
  {
140
0
    if (tm->opcode == (memdata & tm->mask))
141
0
    {
142
0
      if (size) *size = get_insn_size (memdata, tm);
143
0
      return tm;
144
0
    }
145
0
  }
146
147
0
  if (size) *size = 1;
148
0
  return &tic54x_unknown_opcode;
149
0
}
150
151
static int
152
get_insn_size (unsigned short memdata, const insn_template *insn)
153
0
{
154
0
  int size;
155
156
0
  if (insn->flags & FL_PAR)
157
0
    {
158
      /* only non-parallel instructions support lk addressing */
159
0
      size = insn->words;
160
0
    }
161
0
  else
162
0
    {
163
0
      size = insn->words + has_lkaddr (memdata, insn);
164
0
    }
165
166
0
  return size;
167
0
}
168
169
int
170
print_instruction (disassemble_info *info,
171
       bfd_vma memaddr,
172
       unsigned short opcode,
173
       const char *tm_name,
174
       const enum optype tm_operands[],
175
       int size,
176
       int ext)
177
0
{
178
0
  static int n;
179
  /* string storage for multiple operands */
180
0
  char operand[4][64] = { {0},{0},{0},{0}, };
181
0
  bfd_byte buf[2];
182
0
  unsigned long opcode2 = 0;
183
0
  unsigned long lkaddr = 0;
184
0
  enum optype src = OP_None;
185
0
  enum optype dst = OP_None;
186
0
  int i, shift;
187
0
  char *comma = "";
188
189
0
  info->fprintf_func (info->stream, "%-7s", tm_name);
190
191
0
  if (size > 1)
192
0
    {
193
0
      int status = (*info->read_memory_func) (memaddr + 1, buf, 2, info);
194
0
      if (status != 0)
195
0
        return 0;
196
0
      lkaddr = opcode2 = bfd_getl16 (buf);
197
0
      if (size > 2)
198
0
        {
199
0
          status = (*info->read_memory_func) (memaddr + 2, buf, 2, info);
200
0
          if (status != 0)
201
0
            return 0;
202
0
          opcode2 = bfd_getl16 (buf);
203
0
        }
204
0
    }
205
206
0
  for (i = 0; i < MAX_OPERANDS && OPTYPE (tm_operands[i]) != OP_None; i++)
207
0
    {
208
0
      char *next_comma = ",";
209
0
      int optional = (tm_operands[i] & OPT) != 0;
210
211
0
      switch (OPTYPE (tm_operands[i]))
212
0
        {
213
0
        case OP_Xmem:
214
0
          sprint_dual_address (info, operand[i], XMEM (opcode));
215
0
          info->fprintf_func (info->stream, "%s%s", comma, operand[i]);
216
0
          break;
217
0
        case OP_Ymem:
218
0
          sprint_dual_address (info, operand[i], YMEM (opcode));
219
0
          info->fprintf_func (info->stream, "%s%s", comma, operand[i]);
220
0
          break;
221
0
        case OP_Smem:
222
0
        case OP_Sind:
223
0
        case OP_Lmem:
224
0
          info->fprintf_func (info->stream, "%s", comma);
225
0
          if (INDIRECT (opcode))
226
0
            {
227
0
              if (MOD (opcode) >= 12)
228
0
                {
229
0
                  bfd_vma addr = lkaddr;
230
0
                  int arf = ARF (opcode);
231
0
                  int mod = MOD (opcode);
232
0
                  if (mod == 15)
233
0
                      info->fprintf_func (info->stream, "*(");
234
0
                  else
235
0
                      info->fprintf_func (info->stream, "*%sar%d(",
236
0
                                          (mod == 13 || mod == 14 ? "+" : ""),
237
0
                                          arf);
238
0
                  (*(info->print_address_func)) ((bfd_vma) addr, info);
239
0
                  info->fprintf_func (info->stream, ")%s",
240
0
                                      mod == 14 ? "%" : "");
241
0
                }
242
0
              else
243
0
                {
244
0
                  sprint_indirect_address (info, operand[i], opcode);
245
0
                  info->fprintf_func (info->stream, "%s", operand[i]);
246
0
                }
247
0
            }
248
0
          else
249
0
          {
250
            /* FIXME -- use labels (print_address_func) */
251
            /* in order to do this, we need to guess what DP is */
252
0
            sprint_direct_address (info, operand[i], opcode);
253
0
            info->fprintf_func (info->stream, "%s", operand[i]);
254
0
          }
255
0
          break;
256
0
        case OP_dmad:
257
0
          info->fprintf_func (info->stream, "%s", comma);
258
0
          (*(info->print_address_func)) ((bfd_vma) opcode2, info);
259
0
          break;
260
0
        case OP_xpmad:
261
          /* upper 7 bits of address are in the opcode */
262
0
          opcode2 += ((unsigned long) opcode & 0x7F) << 16;
263
          /* fall through */
264
0
        case OP_pmad:
265
0
          info->fprintf_func (info->stream, "%s", comma);
266
0
          (*(info->print_address_func)) ((bfd_vma) opcode2, info);
267
0
          break;
268
0
        case OP_MMRX:
269
0
          sprint_mmr (info, operand[i], MMRX (opcode));
270
0
          info->fprintf_func (info->stream, "%s%s", comma, operand[i]);
271
0
          break;
272
0
        case OP_MMRY:
273
0
          sprint_mmr (info, operand[i], MMRY (opcode));
274
0
          info->fprintf_func (info->stream, "%s%s", comma, operand[i]);
275
0
          break;
276
0
        case OP_MMR:
277
0
          sprint_mmr (info, operand[i], MMR (opcode));
278
0
          info->fprintf_func (info->stream, "%s%s", comma, operand[i]);
279
0
          break;
280
0
        case OP_PA:
281
0
          sprintf (operand[i], "pa%d", (unsigned) opcode2);
282
0
          info->fprintf_func (info->stream, "%s%s", comma, operand[i]);
283
0
          break;
284
0
        case OP_SRC:
285
0
          src = SRC (ext ? opcode2 : opcode) ? OP_B : OP_A;
286
0
          sprintf (operand[i], (src == OP_B) ? "b" : "a");
287
0
          info->fprintf_func (info->stream, "%s%s", comma, operand[i]);
288
0
          break;
289
0
        case OP_SRC1:
290
0
          src = SRC1 (ext ? opcode2 : opcode) ? OP_B : OP_A;
291
0
          sprintf (operand[i], (src == OP_B) ? "b" : "a");
292
0
          info->fprintf_func (info->stream, "%s%s", comma, operand[i]);
293
0
          break;
294
0
        case OP_RND:
295
0
          dst = DST (opcode) ? OP_B : OP_A;
296
0
          sprintf (operand[i], (dst == OP_B) ? "a" : "b");
297
0
          info->fprintf_func (info->stream, "%s%s", comma, operand[i]);
298
0
          break;
299
0
        case OP_DST:
300
0
          dst = DST (ext ? opcode2 : opcode) ? OP_B : OP_A;
301
0
          if (!optional || dst != src)
302
0
            {
303
0
              sprintf (operand[i], (dst == OP_B) ? "b" : "a");
304
0
              info->fprintf_func (info->stream, "%s%s", comma, operand[i]);
305
0
            }
306
0
          else
307
0
            next_comma = comma;
308
0
          break;
309
0
        case OP_B:
310
0
          sprintf (operand[i], "b");
311
0
          info->fprintf_func (info->stream, "%s%s", comma, operand[i]);
312
0
          break;
313
0
        case OP_A:
314
0
          sprintf (operand[i], "a");
315
0
          info->fprintf_func (info->stream, "%s%s", comma, operand[i]);
316
0
          break;
317
0
        case OP_ARX:
318
0
          sprintf (operand[i], "ar%d", (int) ARX (opcode));
319
0
          info->fprintf_func (info->stream, "%s%s", comma, operand[i]);
320
0
          break;
321
0
        case OP_SHIFT:
322
0
          shift = SHIFT (ext ? opcode2 : opcode);
323
0
          if (!optional || shift != 0)
324
0
            {
325
0
              sprintf (operand[i], "%d", shift);
326
0
              info->fprintf_func (info->stream, "%s%s", comma, operand[i]);
327
0
            }
328
0
          else
329
0
            next_comma = comma;
330
0
          break;
331
0
        case OP_SHFT:
332
0
          shift = SHFT (opcode);
333
0
          if (!optional || shift != 0)
334
0
            {
335
0
              sprintf (operand[i], "%d", (unsigned) shift);
336
0
              info->fprintf_func (info->stream, "%s%s", comma, operand[i]);
337
0
            }
338
0
          else
339
0
            next_comma = comma;
340
0
          break;
341
0
        case OP_lk:
342
0
          sprintf (operand[i], "#%d", (int) (short) opcode2);
343
0
          info->fprintf_func (info->stream, "%s%s", comma, operand[i]);
344
0
          break;
345
0
        case OP_T:
346
0
          sprintf (operand[i], "t");
347
0
          info->fprintf_func (info->stream, "%s%s", comma, operand[i]);
348
0
          break;
349
0
        case OP_TS:
350
0
          sprintf (operand[i], "ts");
351
0
          info->fprintf_func (info->stream, "%s%s", comma, operand[i]);
352
0
          break;
353
0
        case OP_k8:
354
0
          sprintf (operand[i], "%d", (int) ((signed char) (opcode & 0xFF)));
355
0
          info->fprintf_func (info->stream, "%s%s", comma, operand[i]);
356
0
          break;
357
0
        case OP_16:
358
0
          sprintf (operand[i], "16");
359
0
          info->fprintf_func (info->stream, "%s%s", comma, operand[i]);
360
0
          break;
361
0
        case OP_ASM:
362
0
          sprintf (operand[i], "asm");
363
0
          info->fprintf_func (info->stream, "%s%s", comma, operand[i]);
364
0
          break;
365
0
        case OP_BITC:
366
0
          sprintf (operand[i], "%d", (int) (opcode & 0xF));
367
0
          info->fprintf_func (info->stream, "%s%s", comma, operand[i]);
368
0
          break;
369
0
        case OP_CC:
370
          /* put all CC operands in the same operand */
371
0
          sprint_condition (info, operand[i], opcode);
372
0
          info->fprintf_func (info->stream, "%s%s", comma, operand[i]);
373
0
          i = MAX_OPERANDS;
374
0
          break;
375
0
        case OP_CC2:
376
0
          sprint_cc2 (info, operand[i], opcode);
377
0
          info->fprintf_func (info->stream, "%s%s", comma, operand[i]);
378
0
          break;
379
0
        case OP_CC3:
380
0
        {
381
0
          const char *code[] = { "eq", "lt", "gt", "neq" };
382
383
    /* Do not use sprintf with only two parameters as a
384
       compiler warning could be generated in such conditions.  */
385
0
    sprintf (operand[i], "%s", code[CC3 (opcode)]);
386
0
          info->fprintf_func (info->stream, "%s%s", comma, operand[i]);
387
0
          break;
388
0
        }
389
0
        case OP_123:
390
0
          {
391
0
            int code = (opcode >> 8) & 0x3;
392
0
            sprintf (operand[i], "%d", (code == 0) ? 1 : (code == 2) ? 2 : 3);
393
0
            info->fprintf_func (info->stream, "%s%s", comma, operand[i]);
394
0
            break;
395
0
          }
396
0
        case OP_k5:
397
0
          sprintf (operand[i], "#%d", ((opcode & 0x1F) ^ 0x10) - 0x10);
398
0
          info->fprintf_func (info->stream, "%s%s", comma, operand[i]);
399
0
          break;
400
0
        case OP_k8u:
401
0
          sprintf (operand[i], "#%d", (unsigned) (opcode & 0xFF));
402
0
          info->fprintf_func (info->stream, "%s%s", comma, operand[i]);
403
0
          break;
404
0
        case OP_k3:
405
0
          sprintf (operand[i], "#%d", (int) (opcode & 0x7));
406
0
          info->fprintf_func (info->stream, "%s%s", comma, operand[i]);
407
0
          break;
408
0
        case OP_lku:
409
0
          sprintf (operand[i], "#%d", (unsigned) opcode2);
410
0
          info->fprintf_func (info->stream, "%s%s", comma, operand[i]);
411
0
          break;
412
0
        case OP_N:
413
0
          n = (opcode >> 9) & 0x1;
414
0
          sprintf (operand[i], "st%d", n);
415
0
          info->fprintf_func (info->stream, "%s%s", comma, operand[i]);
416
0
          break;
417
0
        case OP_SBIT:
418
0
        {
419
0
          const char *status0[] = {
420
0
            "0", "1", "2", "3", "4", "5", "6", "7", "8",
421
0
            "ovb", "ova", "c", "tc", "13", "14", "15"
422
0
          };
423
0
          const char *status1[] = {
424
0
            "0", "1", "2", "3", "4",
425
0
            "cmpt", "frct", "c16", "sxm", "ovm", "10",
426
0
            "intm", "hm", "xf", "cpl", "braf"
427
0
          };
428
0
          sprintf (operand[i], "%s",
429
0
                   n ? status1[SBIT (opcode)] : status0[SBIT (opcode)]);
430
0
          info->fprintf_func (info->stream, "%s%s", comma, operand[i]);
431
0
          break;
432
0
        }
433
0
        case OP_12:
434
0
          sprintf (operand[i], "%d", (int) ((opcode >> 9) & 1) + 1);
435
0
          info->fprintf_func (info->stream, "%s%s", comma, operand[i]);
436
0
          break;
437
0
        case OP_TRN:
438
0
          sprintf (operand[i], "trn");
439
0
          info->fprintf_func (info->stream, "%s%s", comma, operand[i]);
440
0
          break;
441
0
        case OP_DP:
442
0
          sprintf (operand[i], "dp");
443
0
          info->fprintf_func (info->stream, "%s%s", comma, operand[i]);
444
0
          break;
445
0
        case OP_k9:
446
          /* FIXME-- this is DP, print the original address? */
447
0
          sprintf (operand[i], "#%d", (int) (opcode & 0x1FF));
448
0
          info->fprintf_func (info->stream, "%s%s", comma, operand[i]);
449
0
          break;
450
0
        case OP_ARP:
451
0
          sprintf (operand[i], "arp");
452
0
          info->fprintf_func (info->stream, "%s%s", comma, operand[i]);
453
0
          break;
454
0
        case OP_031:
455
0
          sprintf (operand[i], "%d", (int) (opcode & 0x1F));
456
0
          info->fprintf_func (info->stream, "%s%s", comma, operand[i]);
457
0
          break;
458
0
        default:
459
0
          sprintf (operand[i], "??? (0x%x)", tm_operands[i]);
460
0
          info->fprintf_func (info->stream, "%s%s", comma, operand[i]);
461
0
          break;
462
0
        }
463
0
      comma = next_comma;
464
0
    }
465
0
  return 1;
466
0
}
467
468
static int
469
print_parallel_instruction (disassemble_info *info,
470
          bfd_vma memaddr,
471
          unsigned short opcode,
472
          const insn_template *ptm,
473
          int size)
474
0
{
475
0
  print_instruction (info, memaddr, opcode,
476
0
                     ptm->name, ptm->operand_types, size, 0);
477
0
  info->fprintf_func (info->stream, " || ");
478
0
  return print_instruction (info, memaddr, opcode,
479
0
                            ptm->parname, ptm->paroperand_types, size, 0);
480
0
}
481
482
static int
483
sprint_dual_address (disassemble_info *info ATTRIBUTE_UNUSED,
484
         char buf[],
485
         unsigned short code)
486
0
{
487
0
  const char *formats[] = {
488
0
    "*ar%d",
489
0
    "*ar%d-",
490
0
    "*ar%d+",
491
0
    "*ar%d+0%%",
492
0
  };
493
0
  return sprintf (buf, formats[XMOD (code)], XARX (code));
494
0
}
495
496
static int
497
sprint_indirect_address (disassemble_info *info ATTRIBUTE_UNUSED,
498
       char buf[],
499
       unsigned short opcode)
500
0
{
501
0
  const char *formats[] = {
502
0
    "*ar%d",
503
0
    "*ar%d-",
504
0
    "*ar%d+",
505
0
    "*+ar%d",
506
0
    "*ar%d-0B",
507
0
    "*ar%d-0",
508
0
    "*ar%d+0",
509
0
    "*ar%d+0B",
510
0
    "*ar%d-%%",
511
0
    "*ar%d-0%%",
512
0
    "*ar%d+%%",
513
0
    "*ar%d+0%%",
514
0
  };
515
0
  return sprintf (buf, formats[MOD (opcode)], ARF (opcode));
516
0
}
517
518
static int
519
sprint_direct_address (disassemble_info *info ATTRIBUTE_UNUSED,
520
           char buf[],
521
           unsigned short opcode)
522
0
{
523
  /* FIXME -- look up relocation if available */
524
0
  return sprintf (buf, "DP+0x%02x", (int) (opcode & 0x7F));
525
0
}
526
527
static int
528
sprint_mmr (disassemble_info *info ATTRIBUTE_UNUSED,
529
      char buf[],
530
      int mmr)
531
0
{
532
0
  const tic54x_symbol *reg = tic54x_mmregs;
533
0
  while (reg->name != NULL)
534
0
    {
535
0
      if (mmr == reg->value)
536
0
        {
537
0
          sprintf (buf, "%s", (reg + 1)->name);
538
0
          return 1;
539
0
        }
540
0
      ++reg;
541
0
    }
542
0
  sprintf (buf, "MMR(%d)", mmr); /* FIXME -- different targets.  */
543
0
  return 0;
544
0
}
545
546
static int
547
sprint_cc2 (disassemble_info *info ATTRIBUTE_UNUSED,
548
      char *buf,
549
      unsigned short opcode)
550
0
{
551
0
  const char *cc2[] = {
552
0
    "??", "??", "ageq", "alt", "aneq", "aeq", "agt", "aleq",
553
0
    "??", "??", "bgeq", "blt", "bneq", "beq", "bgt", "bleq",
554
0
  };
555
0
  return sprintf (buf, "%s", cc2[opcode & 0xF]);
556
0
}
557
558
static int
559
sprint_condition (disassemble_info *info ATTRIBUTE_UNUSED,
560
      char *buf,
561
      unsigned short opcode)
562
0
{
563
0
  char *start = buf;
564
0
  const char *cmp[] = {
565
0
      "??", "??", "geq", "lt", "neq", "eq", "gt", "leq"
566
0
  };
567
0
  if (opcode & 0x40)
568
0
    {
569
0
      char acc = (opcode & 0x8) ? 'b' : 'a';
570
0
      if (opcode & 0x7)
571
0
          buf += sprintf (buf, "%c%s%s", acc, cmp[(opcode & 0x7)],
572
0
                          (opcode & 0x20) ? ", " : "");
573
0
      if (opcode & 0x20)
574
0
          buf += sprintf (buf, "%c%s", acc, (opcode & 0x10) ? "ov" : "nov");
575
0
    }
576
0
  else if (opcode & 0x3F)
577
0
    {
578
0
      if (opcode & 0x30)
579
0
        buf += sprintf (buf, "%s%s",
580
0
                        ((opcode & 0x30) == 0x30) ? "tc" : "ntc",
581
0
                        (opcode & 0x0F) ? ", " : "");
582
0
      if (opcode & 0x0C)
583
0
        buf += sprintf (buf, "%s%s",
584
0
                        ((opcode & 0x0C) == 0x0C) ? "c" : "nc",
585
0
                        (opcode & 0x03) ? ", " : "");
586
0
      if (opcode & 0x03)
587
0
        buf += sprintf (buf, "%s",
588
0
                        ((opcode & 0x03) == 0x03) ? "bio" : "nbio");
589
0
    }
590
0
  else
591
0
    buf += sprintf (buf, "unc");
592
593
0
  return buf - start;
594
0
}