Coverage Report

Created: 2026-09-14 08:07

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/binutils-gdb/opcodes/arm-dis.c
Line
Count
Source
1
/* Instruction printing code for the ARM
2
   Copyright (C) 1994-2026 Free Software Foundation, Inc.
3
   Contributed by Richard Earnshaw (rwe@pegasus.esprit.ec.org)
4
   Modification by James G. Smith (jsmith@cygnus.co.uk)
5
6
   This file is part of libopcodes.
7
8
   This library is free software; you can redistribute it and/or modify
9
   it under the terms of the GNU General Public License as published by
10
   the Free Software Foundation; either version 3 of the License, or
11
   (at your option) any later version.
12
13
   It is distributed in the hope that it will be useful, but WITHOUT
14
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
15
   or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
16
   License for more details.
17
18
   You should have received a copy of the GNU General Public License
19
   along with this program; if not, write to the Free Software
20
   Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
21
   MA 02110-1301, USA.  */
22
23
#include "sysdep.h"
24
#include <assert.h>
25
26
#include "disassemble.h"
27
#include "opcode/arm.h"
28
#include "opintl.h"
29
#include "safe-ctype.h"
30
#include "libiberty.h"
31
#include "floatformat.h"
32
33
/* FIXME: This shouldn't be done here.  */
34
#include "coff/internal.h"
35
#include "libcoff.h"
36
#include "bfd.h"
37
#include "elf-bfd.h"
38
#include "elf/internal.h"
39
#include "elf/arm.h"
40
#include "mach-o.h"
41
42
/* Cached mapping symbol state.  */
43
enum map_type
44
{
45
  MAP_ARM,
46
  MAP_THUMB,
47
  MAP_DATA
48
};
49
50
struct arm_private_data
51
{
52
  /* The features to use when disassembling optional instructions.  */
53
  arm_feature_set features;
54
55
  /* Track the last type (although this doesn't seem to be useful) */
56
  enum map_type last_type;
57
58
  /* Tracking symbol table information */
59
  int last_mapping_sym;
60
61
  /* The end range of the current range being disassembled.  */
62
  bfd_vma last_stop_offset;
63
  bfd_vma last_mapping_addr;
64
};
65
66
enum mve_instructions
67
{
68
  MVE_VPST,
69
  MVE_VPT_FP_T1,
70
  MVE_VPT_FP_T2,
71
  MVE_VPT_VEC_T1,
72
  MVE_VPT_VEC_T2,
73
  MVE_VPT_VEC_T3,
74
  MVE_VPT_VEC_T4,
75
  MVE_VPT_VEC_T5,
76
  MVE_VPT_VEC_T6,
77
  MVE_VCMP_FP_T1,
78
  MVE_VCMP_FP_T2,
79
  MVE_VCMP_VEC_T1,
80
  MVE_VCMP_VEC_T2,
81
  MVE_VCMP_VEC_T3,
82
  MVE_VCMP_VEC_T4,
83
  MVE_VCMP_VEC_T5,
84
  MVE_VCMP_VEC_T6,
85
  MVE_VDUP,
86
  MVE_VEOR,
87
  MVE_VFMAS_FP_SCALAR,
88
  MVE_VFMA_FP_SCALAR,
89
  MVE_VFMA_FP,
90
  MVE_VFMS_FP,
91
  MVE_VHADD_T1,
92
  MVE_VHADD_T2,
93
  MVE_VHSUB_T1,
94
  MVE_VHSUB_T2,
95
  MVE_VRHADD,
96
  MVE_VLD2,
97
  MVE_VLD4,
98
  MVE_VST2,
99
  MVE_VST4,
100
  MVE_VLDRB_T1,
101
  MVE_VLDRH_T2,
102
  MVE_VLDRB_T5,
103
  MVE_VLDRH_T6,
104
  MVE_VLDRW_T7,
105
  MVE_VSTRB_T1,
106
  MVE_VSTRH_T2,
107
  MVE_VSTRB_T5,
108
  MVE_VSTRH_T6,
109
  MVE_VSTRW_T7,
110
  MVE_VLDRB_GATHER_T1,
111
  MVE_VLDRH_GATHER_T2,
112
  MVE_VLDRW_GATHER_T3,
113
  MVE_VLDRD_GATHER_T4,
114
  MVE_VLDRW_GATHER_T5,
115
  MVE_VLDRD_GATHER_T6,
116
  MVE_VSTRB_SCATTER_T1,
117
  MVE_VSTRH_SCATTER_T2,
118
  MVE_VSTRW_SCATTER_T3,
119
  MVE_VSTRD_SCATTER_T4,
120
  MVE_VSTRW_SCATTER_T5,
121
  MVE_VSTRD_SCATTER_T6,
122
  MVE_VCVT_FP_FIX_VEC,
123
  MVE_VCVT_BETWEEN_FP_INT,
124
  MVE_VCVT_FP_HALF_FP,
125
  MVE_VCVT_FROM_FP_TO_INT,
126
  MVE_VRINT_FP,
127
  MVE_VMOV_HFP_TO_GP,
128
  MVE_VMOV_GP_TO_VEC_LANE,
129
  MVE_VMOV_IMM_TO_VEC,
130
  MVE_VMOV_VEC_TO_VEC,
131
  MVE_VMOV2_VEC_LANE_TO_GP,
132
  MVE_VMOV2_GP_TO_VEC_LANE,
133
  MVE_VMOV_VEC_LANE_TO_GP,
134
  MVE_VMVN_IMM,
135
  MVE_VMVN_REG,
136
  MVE_VORR_IMM,
137
  MVE_VORR_REG,
138
  MVE_VORN,
139
  MVE_VBIC_IMM,
140
  MVE_VBIC_REG,
141
  MVE_VMOVX,
142
  MVE_VMOVL,
143
  MVE_VMOVN,
144
  MVE_VMULL_INT,
145
  MVE_VMULL_POLY,
146
  MVE_VQDMULL_T1,
147
  MVE_VQDMULL_T2,
148
  MVE_VQMOVN,
149
  MVE_VQMOVUN,
150
  MVE_VADDV,
151
  MVE_VMLADAV_T1,
152
  MVE_VMLADAV_T2,
153
  MVE_VMLALDAV,
154
  MVE_VMLAS,
155
  MVE_VADDLV,
156
  MVE_VMLSDAV_T1,
157
  MVE_VMLSDAV_T2,
158
  MVE_VMLSLDAV,
159
  MVE_VRMLALDAVH,
160
  MVE_VRMLSLDAVH,
161
  MVE_VQDMLADH,
162
  MVE_VQRDMLADH,
163
  MVE_VQDMLAH,
164
  MVE_VQRDMLAH,
165
  MVE_VQDMLASH,
166
  MVE_VQRDMLASH,
167
  MVE_VQDMLSDH,
168
  MVE_VQRDMLSDH,
169
  MVE_VQDMULH_T1,
170
  MVE_VQRDMULH_T2,
171
  MVE_VQDMULH_T3,
172
  MVE_VQRDMULH_T4,
173
  MVE_VDDUP,
174
  MVE_VDWDUP,
175
  MVE_VIWDUP,
176
  MVE_VIDUP,
177
  MVE_VCADD_FP,
178
  MVE_VCADD_VEC,
179
  MVE_VHCADD,
180
  MVE_VCMLA_FP,
181
  MVE_VCMUL_FP,
182
  MVE_VQRSHL_T1,
183
  MVE_VQRSHL_T2,
184
  MVE_VQRSHRN,
185
  MVE_VQRSHRUN,
186
  MVE_VQSHL_T1,
187
  MVE_VQSHL_T2,
188
  MVE_VQSHLU_T3,
189
  MVE_VQSHL_T4,
190
  MVE_VQSHRN,
191
  MVE_VQSHRUN,
192
  MVE_VRSHL_T1,
193
  MVE_VRSHL_T2,
194
  MVE_VRSHR,
195
  MVE_VRSHRN,
196
  MVE_VSHL_T1,
197
  MVE_VSHL_T2,
198
  MVE_VSHL_T3,
199
  MVE_VSHLC,
200
  MVE_VSHLL_T1,
201
  MVE_VSHLL_T2,
202
  MVE_VSHR,
203
  MVE_VSHRN,
204
  MVE_VSLI,
205
  MVE_VSRI,
206
  MVE_VADC,
207
  MVE_VABAV,
208
  MVE_VABD_FP,
209
  MVE_VABD_VEC,
210
  MVE_VABS_FP,
211
  MVE_VABS_VEC,
212
  MVE_VADD_FP_T1,
213
  MVE_VADD_FP_T2,
214
  MVE_VADD_VEC_T1,
215
  MVE_VADD_VEC_T2,
216
  MVE_VSBC,
217
  MVE_VSUB_FP_T1,
218
  MVE_VSUB_FP_T2,
219
  MVE_VSUB_VEC_T1,
220
  MVE_VSUB_VEC_T2,
221
  MVE_VAND,
222
  MVE_VBRSR,
223
  MVE_VCLS,
224
  MVE_VCLZ,
225
  MVE_VCTP,
226
  MVE_VMAX,
227
  MVE_VMAXA,
228
  MVE_VMAXNM_FP,
229
  MVE_VMAXNMA_FP,
230
  MVE_VMAXNMV_FP,
231
  MVE_VMAXNMAV_FP,
232
  MVE_VMAXV,
233
  MVE_VMAXAV,
234
  MVE_VMIN,
235
  MVE_VMINA,
236
  MVE_VMINNM_FP,
237
  MVE_VMINNMA_FP,
238
  MVE_VMINNMV_FP,
239
  MVE_VMINNMAV_FP,
240
  MVE_VMINV,
241
  MVE_VMINAV,
242
  MVE_VMLA,
243
  MVE_VMUL_FP_T1,
244
  MVE_VMUL_FP_T2,
245
  MVE_VMUL_VEC_T1,
246
  MVE_VMUL_VEC_T2,
247
  MVE_VMULH,
248
  MVE_VRMULH,
249
  MVE_VNEG_FP,
250
  MVE_VNEG_VEC,
251
  MVE_VPNOT,
252
  MVE_VPSEL,
253
  MVE_VQABS,
254
  MVE_VQADD_T1,
255
  MVE_VQADD_T2,
256
  MVE_VQSUB_T1,
257
  MVE_VQSUB_T2,
258
  MVE_VQNEG,
259
  MVE_VREV16,
260
  MVE_VREV32,
261
  MVE_VREV64,
262
  MVE_LSLL,
263
  MVE_LSLLI,
264
  MVE_LSRL,
265
  MVE_ASRL,
266
  MVE_ASRLI,
267
  MVE_SQRSHRL,
268
  MVE_SQRSHR,
269
  MVE_UQRSHL,
270
  MVE_UQRSHLL,
271
  MVE_UQSHL,
272
  MVE_UQSHLL,
273
  MVE_URSHRL,
274
  MVE_URSHR,
275
  MVE_SRSHRL,
276
  MVE_SRSHR,
277
  MVE_SQSHLL,
278
  MVE_SQSHL,
279
  MVE_CINC,
280
  MVE_CINV,
281
  MVE_CNEG,
282
  MVE_CSINC,
283
  MVE_CSINV,
284
  MVE_CSET,
285
  MVE_CSETM,
286
  MVE_CSNEG,
287
  MVE_CSEL,
288
  MVE_NONE
289
};
290
291
enum mve_unpredictable
292
{
293
  UNPRED_IT_BLOCK,    /* Unpredictable because mve insn in it block.
294
         */
295
  UNPRED_FCA_0_FCB_1,   /* Unpredictable because fcA = 0 and
296
           fcB = 1 (vpt).  */
297
  UNPRED_R13,     /* Unpredictable because r13 (sp) or
298
           r15 (sp) used.  */
299
  UNPRED_R15,     /* Unpredictable because r15 (pc) is used.  */
300
  UNPRED_Q_GT_4,    /* Unpredictable because
301
           vec reg start > 4 (vld4/st4).  */
302
  UNPRED_Q_GT_6,    /* Unpredictable because
303
           vec reg start > 6 (vld2/st2).  */
304
  UNPRED_R13_AND_WB,    /* Unpredictable becase gp reg = r13
305
           and WB bit = 1.  */
306
  UNPRED_Q_REGS_EQUAL,    /* Unpredictable because vector registers are
307
           equal.  */
308
  UNPRED_OS,      /* Unpredictable because offset scaled == 1.  */
309
  UNPRED_GP_REGS_EQUAL,   /* Unpredictable because gp registers are the
310
           same.  */
311
  UNPRED_Q_REGS_EQ_AND_SIZE_1,  /* Unpredictable because q regs equal and
312
           size = 1.  */
313
  UNPRED_Q_REGS_EQ_AND_SIZE_2,  /* Unpredictable because q regs equal and
314
           size = 2.  */
315
  UNPRED_NONE     /* No unpredictable behavior.  */
316
};
317
318
enum mve_undefined
319
{
320
  UNDEF_SIZE,     /* undefined size.  */
321
  UNDEF_SIZE_0,     /* undefined because size == 0.  */
322
  UNDEF_SIZE_2,     /* undefined because size == 2.  */
323
  UNDEF_SIZE_3,     /* undefined because size == 3.  */
324
  UNDEF_SIZE_LE_1,    /* undefined because size <= 1.  */
325
  UNDEF_SIZE_NOT_0,   /* undefined because size != 0.  */
326
  UNDEF_SIZE_NOT_2,   /* undefined because size != 2.  */
327
  UNDEF_SIZE_NOT_3,   /* undefined because size != 3.  */
328
  UNDEF_NOT_UNS_SIZE_0,   /* undefined because U == 0 and
329
           size == 0.  */
330
  UNDEF_NOT_UNS_SIZE_1,   /* undefined because U == 0 and
331
           size == 1.  */
332
  UNDEF_NOT_UNSIGNED,   /* undefined because U == 0.  */
333
  UNDEF_VCVT_IMM6,    /* imm6 < 32.  */
334
  UNDEF_VCVT_FSI_IMM6,    /* fsi = 0 and 32 >= imm6 <= 47.  */
335
  UNDEF_BAD_OP1_OP2,    /* undefined with op2 = 2 and
336
           op1 == (0 or 1).  */
337
  UNDEF_BAD_U_OP1_OP2,    /* undefined with U = 1 and
338
           op2 == 0 and op1 == (0 or 1).  */
339
  UNDEF_OP_0_BAD_CMODE,   /* undefined because op == 0 and cmode
340
           in {0xx1, x0x1}.  */
341
  UNDEF_XCHG_UNS,   /* undefined because X == 1 and U == 1.  */
342
  UNDEF_NONE      /* no undefined behavior.  */
343
};
344
345
struct opcode32
346
{
347
  arm_feature_set arch;   /* Architecture defining this insn.  */
348
  unsigned long value;    /* If arch is 0 then value is a sentinel.  */
349
  unsigned long mask;   /* Recognise insn if (op & mask) == value.  */
350
  const char *  assembler;  /* How to disassemble this insn.  */
351
};
352
353
struct cdeopcode32
354
{
355
  arm_feature_set arch;   /* Architecture defining this insn.  */
356
  uint8_t coproc_shift;   /* coproc is this far into op.  */
357
  uint16_t coproc_mask;   /* Length of coproc field in op.  */
358
  unsigned long value;    /* If arch is 0 then value is a sentinel.  */
359
  unsigned long mask;   /* Recognise insn if (op & mask) == value.  */
360
  const char *  assembler;  /* How to disassemble this insn.  */
361
};
362
363
/* MVE opcodes.  */
364
365
struct mopcode32
366
{
367
  arm_feature_set arch;   /* Architecture defining this insn.  */
368
  enum mve_instructions mve_op;  /* Specific mve instruction for faster
369
            decoding.  */
370
  unsigned long value;    /* If arch is 0 then value is a sentinel.  */
371
  unsigned long mask;   /* Recognise insn if (op & mask) == value.  */
372
  const char *  assembler;  /* How to disassemble this insn.  */
373
};
374
375
enum isa {
376
  ANY,
377
  T32,
378
  ARM
379
};
380
381
382
/* Shared (between Arm and Thumb mode) opcode.  */
383
struct sopcode32
384
{
385
  enum isa isa;     /* Execution mode instruction availability.  */
386
  arm_feature_set arch;   /* Architecture defining this insn.  */
387
  unsigned long value;    /* If arch is 0 then value is a sentinel.  */
388
  unsigned long mask;   /* Recognise insn if (op & mask) == value.  */
389
  const char *  assembler;  /* How to disassemble this insn.  */
390
};
391
392
struct opcode16
393
{
394
  arm_feature_set arch;   /* Architecture defining this insn.  */
395
  unsigned short value, mask; /* Recognise insn if (op & mask) == value.  */
396
  const char *assembler;  /* How to disassemble this insn.  */
397
};
398
399
/* print_insn_coprocessor recognizes the following format control codes:
400
401
   %%     %
402
403
   %c     print condition code (always bits 28-31 in ARM mode)
404
   %b     print condition code allowing cp_num == 9
405
   %q     print shifter argument
406
   %u     print condition code (unconditional in ARM mode,
407
                          UNPREDICTABLE if not AL in Thumb)
408
   %A     print address for ldc/stc instruction
409
   %B     print vstm/vldm register list
410
   %C     print vscclrm register list
411
   %J     print register for VLDR instruction
412
   %K     print address for VLDR instruction
413
414
   %<bitfield>c   print as a condition code (for vsel)
415
   %<bitfield>r   print as an ARM register
416
   %<bitfield>R   as %<>r but r15 is UNPREDICTABLE
417
   %<bitfield>ru        as %<>r but each u register must be unique.
418
   %<bitfield>d   print the bitfield in decimal
419
   %<bitfield>k   print immediate for VFPv3 conversion instruction
420
   %<bitfield>x   print the bitfield in hex
421
   %<bitfield>X   print the bitfield as 1 hex digit without leading "0x"
422
   %<bitfield>w         print as an iWMMXt width field - [bhwd]ss/us
423
   %<bitfield>g         print as an iWMMXt 64-bit register
424
   %<bitfield>G         print as an iWMMXt general purpose or control register
425
   %<bitfield>D   print as a NEON D register
426
   %<bitfield>Q   print as a NEON Q register
427
   %<bitfield>V   print as a NEON D or Q register
428
   %<bitfield>E   print a quarter-float immediate value
429
430
   %y<code>   print a single precision VFP reg.
431
        Codes: 0=>Sm, 1=>Sd, 2=>Sn, 3=>multi-list, 4=>Sm pair
432
   %z<code>   print a double precision VFP reg
433
        Codes: 0=>Dm, 1=>Dd, 2=>Dn, 3=>multi-list
434
435
   %<bitfield>'c  print specified char iff bitfield is all ones
436
   %<bitfield>`c  print specified char iff bitfield is all zeroes
437
   %<bitfield>?ab...    select from array of values in big endian order
438
439
   %L     print as an iWMMXt N/M width field.
440
   %Z     print the Immediate of a WSHUFH instruction.
441
   %l     like 'A' except use byte offsets for 'B' & 'H'
442
      versions.
443
   %i     print 5-bit immediate in bits 8,3..0
444
      (print "32" when 0)
445
   %r     print register offset address for wldt/wstr instruction.  */
446
447
enum opcode_sentinel_enum
448
{
449
  SENTINEL_IWMMXT_START = 1,
450
  SENTINEL_IWMMXT_END,
451
  SENTINEL_GENERIC_START
452
} opcode_sentinels;
453
454
#define UNDEFINED_INSTRUCTION      "\t\t@ <UNDEFINED> instruction: %0-31x"
455
1.11k
#define UNKNOWN_INSTRUCTION_32BIT  "\t\t@ <UNDEFINED> instruction: %08x"
456
0
#define UNKNOWN_INSTRUCTION_16BIT  "\t\t@ <UNDEFINED> instruction: %04x"
457
171k
#define UNPREDICTABLE_INSTRUCTION  "\t@ <UNPREDICTABLE>"
458
459
/* Common coprocessor opcodes shared between Arm and Thumb-2.  */
460
461
/* print_insn_cde recognizes the following format control codes:
462
463
   %%     %
464
465
   %a     print 'a' iff bit 28 is 1
466
   %p     print bits 8-10 as coprocessor
467
   %<bitfield>d   print as decimal
468
   %<bitfield>r   print as an ARM register
469
   %<bitfield>n   print as an ARM register but r15 is APSR_nzcv
470
   %<bitfield>T   print as an ARM register + 1
471
   %<bitfield>R   as %r but r13 is UNPREDICTABLE
472
   %<bitfield>S   as %r but rX where X > 10 is UNPREDICTABLE
473
   %j     print immediate taken from bits (16..21,7,0..5)
474
   %k     print immediate taken from bits (20..21,7,0..5).
475
   %l     print immediate taken from bits (20..22,7,4..5).  */
476
477
/* At the moment there is only one valid position for the coprocessor number,
478
   and hence that's encoded in the macro below.  */
479
#define CDE_OPCODE(ARCH, VALUE, MASK, ASM) \
480
  { ARCH, 8, 7, VALUE, MASK, ASM }
481
static const struct cdeopcode32 cde_opcodes[] =
482
{
483
  /* Custom Datapath Extension instructions.  */
484
  CDE_OPCODE (ARM_FEATURE_CORE_HIGH (ARM_EXT2_CDE),
485
        0xee000000, 0xefc00840,
486
        "cx1%a\t%p, %12-15n, %{I:#%0-5,7,16-21d%}"),
487
  CDE_OPCODE (ARM_FEATURE_CORE_HIGH (ARM_EXT2_CDE),
488
        0xee000040, 0xefc00840,
489
        "cx1d%a\t%p, %12-15S, %12-15T, %{I:#%0-5,7,16-21d%}"),
490
491
  CDE_OPCODE (ARM_FEATURE_CORE_HIGH (ARM_EXT2_CDE),
492
        0xee400000, 0xefc00840,
493
        "cx2%a\t%p, %12-15n, %16-19n, %{I:#%0-5,7,20-21d%}"),
494
  CDE_OPCODE (ARM_FEATURE_CORE_HIGH (ARM_EXT2_CDE),
495
        0xee400040, 0xefc00840,
496
        "cx2d%a\t%p, %12-15S, %12-15T, %16-19n, %{I:#%0-5,7,20-21d%}"),
497
498
  CDE_OPCODE (ARM_FEATURE_CORE_HIGH (ARM_EXT2_CDE),
499
        0xee800000, 0xef800840,
500
        "cx3%a\t%p, %0-3n, %16-19n, %12-15n, %{I:#%4-5,7,20-22d%}"),
501
  CDE_OPCODE (ARM_FEATURE_CORE_HIGH (ARM_EXT2_CDE),
502
        0xee800040, 0xef800840,
503
       "cx3d%a\t%p, %0-3S, %0-3T, %16-19n, %12-15n, %{I:#%4-5,7,20-22d%}"),
504
505
  CDE_OPCODE (ARM_FEATURE_CORE_HIGH (ARM_EXT2_CDE),
506
        0xec200000, 0xeeb00840,
507
        "vcx1%a\t%p, %12-15,22V, %{I:#%0-5,7,16-19d%}"),
508
  CDE_OPCODE (ARM_FEATURE_CORE_HIGH (ARM_EXT2_CDE),
509
        0xec200040, 0xeeb00840,
510
        "vcx1%a\t%p, %12-15,22V, %{I:#%0-5,7,16-19,24d%}"),
511
512
  CDE_OPCODE (ARM_FEATURE_CORE_HIGH (ARM_EXT2_CDE),
513
        0xec300000, 0xeeb00840,
514
        "vcx2%a\t%p, %12-15,22V, %0-3,5V, %{I:#%4,7,16-19d%}"),
515
  CDE_OPCODE (ARM_FEATURE_CORE_HIGH (ARM_EXT2_CDE),
516
        0xec300040, 0xeeb00840,
517
        "vcx2%a\t%p, %12-15,22V, %0-3,5V, %{I:#%4,7,16-19,24d%}"),
518
519
  CDE_OPCODE (ARM_FEATURE_CORE_HIGH (ARM_EXT2_CDE),
520
        0xec800000, 0xee800840,
521
        "vcx3%a\t%p, %12-15,22V, %16-19,7V, %0-3,5V, %{I:#%4,20-21d%}"),
522
  CDE_OPCODE (ARM_FEATURE_CORE_HIGH (ARM_EXT2_CDE),
523
        0xec800040, 0xee800840,
524
        "vcx3%a\t%p, %12-15,22V, %16-19,7V, %0-3,5V, %{I:#%4,20-21,24d%}"),
525
526
  CDE_OPCODE (ARM_FEATURE_CORE_LOW (0), 0, 0, 0)
527
528
};
529
530
static const struct sopcode32 coprocessor_opcodes[] =
531
{
532
  /* XScale instructions.  */
533
  {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
534
    0x0e200010, 0x0fff0ff0,
535
    "mia%c\t%{R:acc0%}, %0-3r, %12-15r"},
536
  {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
537
    0x0e280010, 0x0fff0ff0,
538
    "miaph%c\t%{R:acc0%}, %0-3r, %12-15r"},
539
  {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
540
    0x0e2c0010, 0x0ffc0ff0, "mia%17'T%17`B%16'T%16`B%c\t%{R:acc0%}, %0-3r, %12-15r"},
541
  {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
542
    0x0c400000, 0x0ff00fff, "mar%c\t%{R:acc0%}, %12-15r, %16-19r"},
543
  {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
544
    0x0c500000, 0x0ff00fff, "mra%c\t%12-15r, %16-19r, %{R:acc0%}"},
545
546
  /* Intel Wireless MMX technology instructions.  */
547
  {ANY, ARM_FEATURE_CORE_LOW (0), SENTINEL_IWMMXT_START, 0, "" },
548
  {ANY, ARM_FEATURE_COPROC (ARM_CEXT_IWMMXT),
549
    0x0e130130, 0x0f3f0fff, "tandc%22-23w%c\t%12-15r"},
550
  {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
551
    0x0e400010, 0x0ff00f3f, "tbcst%6-7w%c\t%16-19g, %12-15r"},
552
  {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
553
    0x0e130170, 0x0f3f0ff8, "textrc%22-23w%c\t%12-15r, %{I:#%0-2d%}"},
554
  {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
555
    0x0e100070, 0x0f300ff0, "textrm%3?su%22-23w%c\t%12-15r, %16-19g, %{I:#%0-2d%}"},
556
  {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
557
    0x0e600010, 0x0ff00f38, "tinsr%6-7w%c\t%16-19g, %12-15r, %{I:#%0-2d%}"},
558
  {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
559
    0x0e000110, 0x0ff00fff, "tmcr%c\t%16-19G, %12-15r"},
560
  {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
561
    0x0c400000, 0x0ff00ff0, "tmcrr%c\t%0-3g, %12-15r, %16-19r"},
562
  {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
563
    0x0e2c0010, 0x0ffc0e10, "tmia%17?tb%16?tb%c\t%5-8g, %0-3r, %12-15r"},
564
  {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
565
    0x0e200010, 0x0fff0e10, "tmia%c\t%5-8g, %0-3r, %12-15r"},
566
  {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
567
    0x0e280010, 0x0fff0e10, "tmiaph%c\t%5-8g, %0-3r, %12-15r"},
568
  {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
569
    0x0e100030, 0x0f300fff, "tmovmsk%22-23w%c\t%12-15r, %16-19g"},
570
  {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
571
    0x0e100110, 0x0ff00ff0, "tmrc%c\t%12-15r, %16-19G"},
572
  {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
573
    0x0c500000, 0x0ff00ff0, "tmrrc%c\t%12-15r, %16-19r, %0-3g"},
574
  {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
575
    0x0e130150, 0x0f3f0fff, "torc%22-23w%c\t%12-15r"},
576
  {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
577
    0x0e120190, 0x0f3f0fff, "torvsc%22-23w%c\t%12-15r"},
578
  {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
579
    0x0e2001c0, 0x0f300fff, "wabs%22-23w%c\t%12-15g, %16-19g"},
580
  {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
581
    0x0e0001c0, 0x0f300fff, "wacc%22-23w%c\t%12-15g, %16-19g"},
582
  {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
583
    0x0e000180, 0x0f000ff0, "wadd%20-23w%c\t%12-15g, %16-19g, %0-3g"},
584
  {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
585
    0x0e2001a0, 0x0fb00ff0, "waddbhus%22?ml%c\t%12-15g, %16-19g, %0-3g"},
586
  {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
587
    0x0ea001a0, 0x0ff00ff0, "waddsubhx%c\t%12-15g, %16-19g, %0-3g"},
588
  {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
589
    0x0e000020, 0x0f800ff0, "waligni%c\t%12-15g, %16-19g, %0-3g, %{I:#%20-22d%}"},
590
  {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
591
    0x0e800020, 0x0fc00ff0, "walignr%20-21d%c\t%12-15g, %16-19g, %0-3g"},
592
  {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
593
    0x0e200000, 0x0fe00ff0, "wand%20'n%c\t%12-15g, %16-19g, %0-3g"},
594
  {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
595
    0x0e800000, 0x0fa00ff0, "wavg2%22?hb%20'r%c\t%12-15g, %16-19g, %0-3g"},
596
  {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
597
    0x0e400000, 0x0fe00ff0, "wavg4%20'r%c\t%12-15g, %16-19g, %0-3g"},
598
  {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
599
    0x0e000060, 0x0f300ff0, "wcmpeq%22-23w%c\t%12-15g, %16-19g, %0-3g"},
600
  {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
601
    0x0e100060, 0x0f100ff0, "wcmpgt%21?su%22-23w%c\t%12-15g, %16-19g, %0-3g"},
602
  {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
603
    0xfc500100, 0xfe500f00, "wldrd\t%12-15g, %r"},
604
  {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
605
    0xfc100100, 0xfe500f00, "wldrw\t%12-15G, %A"},
606
  {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
607
    0x0c100000, 0x0e100e00, "wldr%L%c\t%12-15g, %l"},
608
  {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
609
    0x0e400100, 0x0fc00ff0, "wmac%21?su%20'z%c\t%12-15g, %16-19g, %0-3g"},
610
  {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
611
    0x0e800100, 0x0fc00ff0, "wmadd%21?su%20'x%c\t%12-15g, %16-19g, %0-3g"},
612
  {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
613
    0x0ec00100, 0x0fd00ff0, "wmadd%21?sun%c\t%12-15g, %16-19g, %0-3g"},
614
  {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
615
    0x0e000160, 0x0f100ff0, "wmax%21?su%22-23w%c\t%12-15g, %16-19g, %0-3g"},
616
  {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
617
    0x0e000080, 0x0f100fe0, "wmerge%c\t%12-15g, %16-19g, %0-3g, %{I:#%21-23d%}"},
618
  {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
619
    0x0e0000a0, 0x0f800ff0, "wmia%21?tb%20?tb%22'n%c\t%12-15g, %16-19g, %0-3g"},
620
  {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
621
    0x0e800120, 0x0f800ff0,
622
    "wmiaw%21?tb%20?tb%22'n%c\t%12-15g, %16-19g, %0-3g"},
623
  {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
624
    0x0e100160, 0x0f100ff0, "wmin%21?su%22-23w%c\t%12-15g, %16-19g, %0-3g"},
625
  {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
626
    0x0e000100, 0x0fc00ff0, "wmul%21?su%20?ml%23'r%c\t%12-15g, %16-19g, %0-3g"},
627
  {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
628
    0x0ed00100, 0x0fd00ff0, "wmul%21?sumr%c\t%12-15g, %16-19g, %0-3g"},
629
  {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
630
    0x0ee000c0, 0x0fe00ff0, "wmulwsm%20`r%c\t%12-15g, %16-19g, %0-3g"},
631
  {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
632
    0x0ec000c0, 0x0fe00ff0, "wmulwum%20`r%c\t%12-15g, %16-19g, %0-3g"},
633
  {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
634
    0x0eb000c0, 0x0ff00ff0, "wmulwl%c\t%12-15g, %16-19g, %0-3g"},
635
  {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
636
    0x0e8000a0, 0x0f800ff0,
637
    "wqmia%21?tb%20?tb%22'n%c\t%12-15g, %16-19g, %0-3g"},
638
  {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
639
    0x0e100080, 0x0fd00ff0, "wqmulm%21'r%c\t%12-15g, %16-19g, %0-3g"},
640
  {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
641
    0x0ec000e0, 0x0fd00ff0, "wqmulwm%21'r%c\t%12-15g, %16-19g, %0-3g"},
642
  {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
643
    0x0e000000, 0x0ff00ff0, "wor%c\t%12-15g, %16-19g, %0-3g"},
644
  {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
645
    0x0e000080, 0x0f000ff0, "wpack%20-23w%c\t%12-15g, %16-19g, %0-3g"},
646
  {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
647
    0xfe300040, 0xff300ef0, "wror%22-23w\t%12-15g, %16-19g, %{I:#%i%}"},
648
  {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
649
    0x0e300040, 0x0f300ff0, "wror%22-23w%c\t%12-15g, %16-19g, %0-3g"},
650
  {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
651
    0x0e300140, 0x0f300ff0, "wror%22-23wg%c\t%12-15g, %16-19g, %0-3G"},
652
  {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
653
    0x0e000120, 0x0fa00ff0, "wsad%22?hb%20'z%c\t%12-15g, %16-19g, %0-3g"},
654
  {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
655
    0x0e0001e0, 0x0f000ff0, "wshufh%c\t%12-15g, %16-19g, %{I:#%Z%}"},
656
  {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
657
    0xfe100040, 0xff300ef0, "wsll%22-23w\t%12-15g, %16-19g, %{I:#%i%}"},
658
  {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
659
    0x0e100040, 0x0f300ff0, "wsll%22-23w%8'g%c\t%12-15g, %16-19g, %0-3g"},
660
  {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
661
    0x0e100148, 0x0f300ffc, "wsll%22-23w%8'g%c\t%12-15g, %16-19g, %0-3G"},
662
  {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
663
    0xfe000040, 0xff300ef0, "wsra%22-23w\t%12-15g, %16-19g, %{I:#%i%}"},
664
  {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
665
    0x0e000040, 0x0f300ff0, "wsra%22-23w%8'g%c\t%12-15g, %16-19g, %0-3g"},
666
  {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
667
    0x0e000148, 0x0f300ffc, "wsra%22-23w%8'g%c\t%12-15g, %16-19g, %0-3G"},
668
  {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
669
    0xfe200040, 0xff300ef0, "wsrl%22-23w\t%12-15g, %16-19g, %{I:#%i%}"},
670
  {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
671
    0x0e200040, 0x0f300ff0, "wsrl%22-23w%8'g%c\t%12-15g, %16-19g, %0-3g"},
672
  {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
673
    0x0e200148, 0x0f300ffc, "wsrl%22-23w%8'g%c\t%12-15g, %16-19g, %0-3G"},
674
  {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
675
    0xfc400100, 0xfe500f00, "wstrd\t%12-15g, %r"},
676
  {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
677
    0xfc000100, 0xfe500f00, "wstrw\t%12-15G, %A"},
678
  {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
679
    0x0c000000, 0x0e100e00, "wstr%L%c\t%12-15g, %l"},
680
  {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
681
    0x0e0001a0, 0x0f000ff0, "wsub%20-23w%c\t%12-15g, %16-19g, %0-3g"},
682
  {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
683
    0x0ed001c0, 0x0ff00ff0, "wsubaddhx%c\t%12-15g, %16-19g, %0-3g"},
684
  {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
685
    0x0e1001c0, 0x0f300ff0, "wabsdiff%22-23w%c\t%12-15g, %16-19g, %0-3g"},
686
  {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
687
    0x0e0000c0, 0x0fd00fff, "wunpckeh%21?sub%c\t%12-15g, %16-19g"},
688
  {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
689
    0x0e4000c0, 0x0fd00fff, "wunpckeh%21?suh%c\t%12-15g, %16-19g"},
690
  {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
691
    0x0e8000c0, 0x0fd00fff, "wunpckeh%21?suw%c\t%12-15g, %16-19g"},
692
  {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
693
    0x0e0000e0, 0x0f100fff, "wunpckel%21?su%22-23w%c\t%12-15g, %16-19g"},
694
  {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
695
    0x0e1000c0, 0x0f300ff0, "wunpckih%22-23w%c\t%12-15g, %16-19g, %0-3g"},
696
  {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
697
    0x0e1000e0, 0x0f300ff0, "wunpckil%22-23w%c\t%12-15g, %16-19g, %0-3g"},
698
  {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
699
    0x0e100000, 0x0ff00ff0, "wxor%c\t%12-15g, %16-19g, %0-3g"},
700
  {ANY, ARM_FEATURE_CORE_LOW (0),
701
    SENTINEL_IWMMXT_END, 0, "" },
702
703
  /* Armv8.1-M Mainline instructions.  */
704
  {T32, ARM_FEATURE_CORE_HIGH (ARM_EXT2_V8_1M_MAIN),
705
    0xec9f0b00, 0xffbf0f01, "vscclrm%c\t%C"},
706
  {T32, ARM_FEATURE_CORE_HIGH (ARM_EXT2_V8_1M_MAIN),
707
    0xec9f0a00, 0xffbf0f00, "vscclrm%c\t%C"},
708
709
  /* ARMv8-M Mainline Security Extensions instructions.  */
710
  {ANY, ARM_FEATURE_CORE_HIGH (ARM_EXT2_V8M_MAIN),
711
    0xec300a00, 0xfff0ffff, "vlldm\t%16-19r"},
712
  {ANY, ARM_FEATURE_CORE_HIGH (ARM_EXT2_V8M_MAIN),
713
    0xec200a00, 0xfff0ffff, "vlstm\t%16-19r"},
714
715
  /* Register load/store.  */
716
  {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1xD | FPU_NEON_EXT_V1),
717
    0x0d2d0b00, 0x0fbf0f01, "vpush%c\t%B"},
718
  {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1xD | FPU_NEON_EXT_V1),
719
    0x0d200b00, 0x0fb00f01, "vstmdb%c\t%16-19r!, %B"},
720
  {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1xD | FPU_NEON_EXT_V1),
721
    0x0d300b00, 0x0fb00f01, "vldmdb%c\t%16-19r!, %B"},
722
  {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1xD | FPU_NEON_EXT_V1),
723
    0x0c800b00, 0x0f900f01, "vstmia%c\t%16-19r%21'!, %B"},
724
  {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1xD | FPU_NEON_EXT_V1),
725
    0x0cbd0b00, 0x0fbf0f01, "vpop%c\t%B"},
726
  {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1xD | FPU_NEON_EXT_V1),
727
    0x0c900b00, 0x0f900f01, "vldmia%c\t%16-19r%21'!, %B"},
728
  {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1xD | FPU_NEON_EXT_V1),
729
    0x0d000b00, 0x0f300f00, "vstr%c\t%12-15,22D, %A"},
730
  {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1xD | FPU_NEON_EXT_V1),
731
    0x0d100b00, 0x0f300f00, "vldr%c\t%12-15,22D, %A"},
732
  {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1xD),
733
    0x0d2d0a00, 0x0fbf0f00, "vpush%c\t%y3"},
734
  {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1xD),
735
    0x0d200a00, 0x0fb00f00, "vstmdb%c\t%16-19r!, %y3"},
736
  {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1xD),
737
    0x0d300a00, 0x0fb00f00, "vldmdb%c\t%16-19r!, %y3"},
738
  {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1xD),
739
    0x0c800a00, 0x0f900f00, "vstmia%c\t%16-19r%21'!, %y3"},
740
  {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1xD),
741
    0x0cbd0a00, 0x0fbf0f00, "vpop%c\t%y3"},
742
  {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1xD),
743
    0x0c900a00, 0x0f900f00, "vldmia%c\t%16-19r%21'!, %y3"},
744
  {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1xD),
745
    0x0d000a00, 0x0f300f00, "vstr%c\t%y1, %A"},
746
  {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1xD),
747
    0x0d100a00, 0x0f300f00, "vldr%c\t%y1, %A"},
748
  {ANY, ARM_FEATURE_COPROC (ARM_EXT2_V8_1M_MAIN),
749
    0xec100f80, 0xfe101f80, "vldr%c\t%J, %K"},
750
  {ANY, ARM_FEATURE_COPROC (ARM_EXT2_V8_1M_MAIN),
751
    0xec000f80, 0xfe101f80, "vstr%c\t%J, %K"},
752
753
  {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1xD),
754
    0x0d200b01, 0x0fb00f01, "fstmdbx%c\t%16-19r!, %z3\t@ Deprecated"},
755
  {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1xD),
756
    0x0d300b01, 0x0fb00f01, "fldmdbx%c\t%16-19r!, %z3\t@ Deprecated"},
757
  {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1xD),
758
    0x0c800b01, 0x0f900f01, "fstmiax%c\t%16-19r%21'!, %z3\t@ Deprecated"},
759
  {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1xD),
760
    0x0c900b01, 0x0f900f01, "fldmiax%c\t%16-19r%21'!, %z3\t@ Deprecated"},
761
762
  /* Data transfer between ARM and NEON registers.  */
763
  {ANY, ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
764
    0x0c400b10, 0x0ff00fd0, "vmov%c\t%0-3,5D, %12-15r, %16-19r"},
765
  {ANY, ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
766
    0x0c500b10, 0x0ff00fd0, "vmov%c\t%12-15r, %16-19r, %0-3,5D"},
767
  {ANY, ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
768
    0x0e000b10, 0x0fd00f70, "vmov%c.32\t%{R:%16-19,7D[%21d]%}, %12-15r"},
769
  {ANY, ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
770
    0x0e100b10, 0x0f500f70, "vmov%c.32\t%12-15r, %{R:%16-19,7D[%21d]%}"},
771
  {ANY, ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
772
    0x0e000b30, 0x0fd00f30, "vmov%c.16\t%{R:%16-19,7D[%6,21d]%}, %12-15r"},
773
  {ANY, ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
774
    0x0e100b30, 0x0f500f30, "vmov%c.%23?us16\t%12-15r, %{R:%16-19,7D[%6,21d]%}"},
775
  {ANY, ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
776
    0x0e400b10, 0x0fd00f10, "vmov%c.8\t%{R:%16-19,7D[%5,6,21d]%}, %12-15r"},
777
  {ANY, ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
778
    0x0e500b10, 0x0f500f10, "vmov%c.%23?us8\t%12-15r, %{R:%16-19,7D[%5,6,21d]%}"},
779
  /* Half-precision conversion instructions.  */
780
  {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_ARMV8),
781
    0x0eb20b40, 0x0fbf0f50, "vcvt%7?tb%c.f64.f16\t%z1, %y0"},
782
  {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_ARMV8),
783
    0x0eb30b40, 0x0fbf0f50, "vcvt%7?tb%c.f16.f64\t%y1, %z0"},
784
  {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_FP16),
785
    0x0eb20a40, 0x0fbf0f50, "vcvt%7?tb%c.f32.f16\t%y1, %y0"},
786
  {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_FP16),
787
    0x0eb30a40, 0x0fbf0f50, "vcvt%7?tb%c.f16.f32\t%y1, %y0"},
788
789
  /* Floating point coprocessor (VFP) instructions.  */
790
  {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1xD),
791
    0x0ee00a10, 0x0fff0fff, "vmsr%c\t%{R:fpsid%}, %12-15r"},
792
  {ANY, ARM_FEATURE (0, ARM_EXT2_V8_1M_MAIN, FPU_VFP_EXT_V1xD),
793
    0x0ee10a10, 0x0fff0fff, "vmsr%c\t%{R:fpscr%}, %12-15r"},
794
  {ANY, ARM_FEATURE_CORE_HIGH (ARM_EXT2_V8_1M_MAIN),
795
    0x0ee20a10, 0x0fff0fff, "vmsr%c\t%{R:fpscr_nzcvqc%}, %12-15r"},
796
  {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1xD),
797
    0x0ee60a10, 0x0fff0fff, "vmsr%c\t%{R:mvfr1%}, %12-15r"},
798
  {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1xD),
799
    0x0ee70a10, 0x0fff0fff, "vmsr%c\t%{R:mvfr0%}, %12-15r"},
800
  {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_ARMV8),
801
    0x0ee50a10, 0x0fff0fff, "vmsr%c\t%{R:mvfr2%}, %12-15r"},
802
  {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1xD),
803
    0x0ee80a10, 0x0fff0fff, "vmsr%c\t%{R:fpexc%}, %12-15r"},
804
  {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1xD),
805
    0x0ee90a10, 0x0fff0fff, "vmsr%c\t%{R:fpinst%}, %12-15r\t@ Impl def"},
806
  {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1xD),
807
    0x0eea0a10, 0x0fff0fff, "vmsr%c\t%{R:fpinst2%}, %12-15r\t@ Impl def"},
808
  {ANY, ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
809
    0x0eec0a10, 0x0fff0fff, "vmsr%c\t%{R:vpr%}, %12-15r"},
810
  {ANY, ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
811
    0x0eed0a10, 0x0fff0fff, "vmsr%c\t%{R:p0%}, %12-15r"},
812
  {ANY, ARM_FEATURE_CORE_HIGH (ARM_EXT2_V8_1M_MAIN),
813
    0x0eee0a10, 0x0fff0fff, "vmsr%c\t%{R:fpcxt_ns%}, %12-15r"},
814
  {ANY, ARM_FEATURE_CORE_HIGH (ARM_EXT2_V8_1M_MAIN),
815
    0x0eef0a10, 0x0fff0fff, "vmsr%c\t%{R:fpcxt_s%}, %12-15r"},
816
  {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1xD),
817
    0x0ef00a10, 0x0fff0fff, "vmrs%c\t%12-15r, %{R:fpsid%}"},
818
  {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1xD),
819
    0x0ef1fa10, 0x0fffffff, "vmrs%c\t%{R:APSR_nzcv%}, %{R:fpscr%}"},
820
  {ANY, ARM_FEATURE (0, ARM_EXT2_V8_1M_MAIN, FPU_VFP_EXT_V1xD),
821
    0x0ef10a10, 0x0fff0fff, "vmrs%c\t%12-15r, %{R:fpscr%}"},
822
  {ANY, ARM_FEATURE_CORE_HIGH (ARM_EXT2_V8_1M_MAIN),
823
    0x0ef20a10, 0x0fff0fff, "vmrs%c\t%12-15r, %{R:fpscr_nzcvqc%}"},
824
  {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_ARMV8),
825
    0x0ef50a10, 0x0fff0fff, "vmrs%c\t%12-15r, %{R:mvfr2%}"},
826
  {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1xD),
827
    0x0ef60a10, 0x0fff0fff, "vmrs%c\t%12-15r, %{R:mvfr1%}"},
828
  {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1xD),
829
    0x0ef70a10, 0x0fff0fff, "vmrs%c\t%12-15r, %{R:mvfr0%}"},
830
  {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1xD),
831
    0x0ef80a10, 0x0fff0fff, "vmrs%c\t%12-15r, %{R:fpexc%}"},
832
  {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1xD),
833
    0x0ef90a10, 0x0fff0fff, "vmrs%c\t%12-15r, %{R:fpinst%}\t@ Impl def"},
834
  {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1xD),
835
    0x0efa0a10, 0x0fff0fff, "vmrs%c\t%12-15r, %{R:fpinst2%}\t@ Impl def"},
836
  {ANY, ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
837
    0x0efc0a10, 0x0fff0fff, "vmrs%c\t%12-15r, %{R:vpr%}"},
838
  {ANY, ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
839
    0x0efd0a10, 0x0fff0fff, "vmrs%c\t%12-15r, %{R:p0%}"},
840
  {ANY, ARM_FEATURE_CORE_HIGH (ARM_EXT2_V8_1M_MAIN),
841
    0x0efe0a10, 0x0fff0fff, "vmrs%c\t%12-15r, %{R:fpcxt_ns%}"},
842
  {ANY, ARM_FEATURE_CORE_HIGH (ARM_EXT2_V8_1M_MAIN),
843
    0x0eff0a10, 0x0fff0fff, "vmrs%c\t%12-15r, %{R:fpcxt_s%}"},
844
  {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1),
845
    0x0e000b10, 0x0fd00fff, "vmov%c.32\t%z2[%{I:%21d%}], %12-15r"},
846
  {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1),
847
    0x0e100b10, 0x0fd00fff, "vmov%c.32\t%12-15r, %z2[%{I:%21d%}]"},
848
  {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1xD),
849
    0x0ee00a10, 0x0ff00fff, "vmsr%c\t<impl def %16-19x>, %12-15r"},
850
  {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1xD),
851
    0x0ef00a10, 0x0ff00fff, "vmrs%c\t%12-15r, <impl def %16-19x>"},
852
  {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1xD),
853
    0x0e000a10, 0x0ff00f7f, "vmov%c\t%y2, %12-15r"},
854
  {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1xD),
855
    0x0e100a10, 0x0ff00f7f, "vmov%c\t%12-15r, %y2"},
856
  {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1xD),
857
    0x0eb50a40, 0x0fbf0f70, "vcmp%7'e%c.f32\t%y1, %{I:#0.0%}"},
858
  {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1),
859
    0x0eb50b40, 0x0fbf0f70, "vcmp%7'e%c.f64\t%z1, %{I:#0.0%}"},
860
  {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1xD),
861
    0x0eb00a40, 0x0fbf0fd0, "vmov%c.f32\t%y1, %y0"},
862
  {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1xD),
863
    0x0eb00ac0, 0x0fbf0fd0, "vabs%c.f32\t%y1, %y0"},
864
  {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1),
865
    0x0eb00b40, 0x0fbf0fd0, "vmov%c.f64\t%z1, %z0"},
866
  {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1),
867
    0x0eb00bc0, 0x0fbf0fd0, "vabs%c.f64\t%z1, %z0"},
868
  {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1xD),
869
    0x0eb10a40, 0x0fbf0fd0, "vneg%c.f32\t%y1, %y0"},
870
  {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1xD),
871
    0x0eb10ac0, 0x0fbf0fd0, "vsqrt%c.f32\t%y1, %y0"},
872
  {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1),
873
    0x0eb10b40, 0x0fbf0fd0, "vneg%c.f64\t%z1, %z0"},
874
  {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1),
875
    0x0eb10bc0, 0x0fbf0fd0, "vsqrt%c.f64\t%z1, %z0"},
876
  {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1),
877
    0x0eb70ac0, 0x0fbf0fd0, "vcvt%c.f64.f32\t%z1, %y0"},
878
  {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1),
879
    0x0eb70bc0, 0x0fbf0fd0, "vcvt%c.f32.f64\t%y1, %z0"},
880
  {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1xD),
881
    0x0eb80a40, 0x0fbf0f50, "vcvt%c.f32.%7?su32\t%y1, %y0"},
882
  {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1),
883
    0x0eb80b40, 0x0fbf0f50, "vcvt%c.f64.%7?su32\t%z1, %y0"},
884
  {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1xD),
885
    0x0eb40a40, 0x0fbf0f50, "vcmp%7'e%c.f32\t%y1, %y0"},
886
  {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1),
887
    0x0eb40b40, 0x0fbf0f50, "vcmp%7'e%c.f64\t%z1, %z0"},
888
  {ANY, ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST | ARM_EXT2_V8_2A),
889
    0x0eba0940, 0x0fbe0f50, "vcvt%c.f16.%16?us%7?31%7?26\t%y1, %y1, %{I:#%5,0-3k%}"},
890
  {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V3xD),
891
    0x0eba0a40, 0x0fbe0f50, "vcvt%c.f32.%16?us%7?31%7?26\t%y1, %y1, %{I:#%5,0-3k%}"},
892
  {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V3),
893
    0x0eba0b40, 0x0fbe0f50, "vcvt%c.f64.%16?us%7?31%7?26\t%z1, %z1, %{I:#%5,0-3k%}"},
894
  {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1xD),
895
    0x0ebc0a40, 0x0fbe0f50, "vcvt%7`r%c.%16?su32.f32\t%y1, %y0"},
896
  {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1),
897
    0x0ebc0b40, 0x0fbe0f50, "vcvt%7`r%c.%16?su32.f64\t%y1, %z0"},
898
  {ANY, ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST | ARM_EXT2_V8_2A),
899
    0x0ebe0940, 0x0fbe0f50, "vcvt%c.%16?us%7?31%7?26.f16\t%y1, %y1, %{I:#%5,0-3k%}"},
900
  {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V3xD),
901
    0x0ebe0a40, 0x0fbe0f50, "vcvt%c.%16?us%7?31%7?26.f32\t%y1, %y1, %{I:#%5,0-3k%}"},
902
  {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V3),
903
    0x0ebe0b40, 0x0fbe0f50, "vcvt%c.%16?us%7?31%7?26.f64\t%z1, %z1, %{I:#%5,0-3k%}"},
904
  {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1),
905
    0x0c500b10, 0x0fb00ff0, "vmov%c\t%12-15r, %16-19r, %z0"},
906
  {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V3xD),
907
    0x0eb00a00, 0x0fb00ff0, "vmov%c.f32\t%y1, %{I:#%0-3,16-19E%}"},
908
  {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V3),
909
    0x0eb00b00, 0x0fb00ff0, "vmov%c.f64\t%z1, %{I:#%0-3,16-19E%}"},
910
  {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V2),
911
    0x0c400a10, 0x0ff00fd0, "vmov%c\t%y4, %12-15r, %16-19r"},
912
  {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V2),
913
    0x0c400b10, 0x0ff00fd0, "vmov%c\t%z0, %12-15r, %16-19r"},
914
  {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V2),
915
    0x0c500a10, 0x0ff00fd0, "vmov%c\t%12-15r, %16-19r, %y4"},
916
  {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1xD),
917
    0x0e000a00, 0x0fb00f50, "vmla%c.f32\t%y1, %y2, %y0"},
918
  {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1xD),
919
    0x0e000a40, 0x0fb00f50, "vmls%c.f32\t%y1, %y2, %y0"},
920
  {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1),
921
    0x0e000b00, 0x0fb00f50, "vmla%c.f64\t%z1, %z2, %z0"},
922
  {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1),
923
    0x0e000b40, 0x0fb00f50, "vmls%c.f64\t%z1, %z2, %z0"},
924
  {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1xD),
925
    0x0e100a00, 0x0fb00f50, "vnmls%c.f32\t%y1, %y2, %y0"},
926
  {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1xD),
927
    0x0e100a40, 0x0fb00f50, "vnmla%c.f32\t%y1, %y2, %y0"},
928
  {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1),
929
    0x0e100b00, 0x0fb00f50, "vnmls%c.f64\t%z1, %z2, %z0"},
930
  {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1),
931
    0x0e100b40, 0x0fb00f50, "vnmla%c.f64\t%z1, %z2, %z0"},
932
  {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1xD),
933
    0x0e200a00, 0x0fb00f50, "vmul%c.f32\t%y1, %y2, %y0"},
934
  {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1xD),
935
    0x0e200a40, 0x0fb00f50, "vnmul%c.f32\t%y1, %y2, %y0"},
936
  {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1),
937
    0x0e200b00, 0x0fb00f50, "vmul%c.f64\t%z1, %z2, %z0"},
938
  {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1),
939
    0x0e200b40, 0x0fb00f50, "vnmul%c.f64\t%z1, %z2, %z0"},
940
  {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1xD),
941
    0x0e300a00, 0x0fb00f50, "vadd%c.f32\t%y1, %y2, %y0"},
942
  {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1xD),
943
    0x0e300a40, 0x0fb00f50, "vsub%c.f32\t%y1, %y2, %y0"},
944
  {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1),
945
    0x0e300b00, 0x0fb00f50, "vadd%c.f64\t%z1, %z2, %z0"},
946
  {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1),
947
    0x0e300b40, 0x0fb00f50, "vsub%c.f64\t%z1, %z2, %z0"},
948
  {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1xD),
949
    0x0e800a00, 0x0fb00f50, "vdiv%c.f32\t%y1, %y2, %y0"},
950
  {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1),
951
    0x0e800b00, 0x0fb00f50, "vdiv%c.f64\t%z1, %z2, %z0"},
952
953
  /* VFP Fused multiply add instructions.  */
954
  {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_FMA),
955
    0x0ea00a00, 0x0fb00f50, "vfma%c.f32\t%y1, %y2, %y0"},
956
  {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_FMA),
957
    0x0ea00b00, 0x0fb00f50, "vfma%c.f64\t%z1, %z2, %z0"},
958
  {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_FMA),
959
    0x0ea00a40, 0x0fb00f50, "vfms%c.f32\t%y1, %y2, %y0"},
960
  {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_FMA),
961
    0x0ea00b40, 0x0fb00f50, "vfms%c.f64\t%z1, %z2, %z0"},
962
  {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_FMA),
963
    0x0e900a40, 0x0fb00f50, "vfnma%c.f32\t%y1, %y2, %y0"},
964
  {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_FMA),
965
    0x0e900b40, 0x0fb00f50, "vfnma%c.f64\t%z1, %z2, %z0"},
966
  {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_FMA),
967
    0x0e900a00, 0x0fb00f50, "vfnms%c.f32\t%y1, %y2, %y0"},
968
  {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_FMA),
969
    0x0e900b00, 0x0fb00f50, "vfnms%c.f64\t%z1, %z2, %z0"},
970
971
  /* FP v5.  */
972
  {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_ARMV8),
973
    0xfe000a00, 0xff800f50, "vsel%20-21c%u.f32\t%y1, %y2, %y0"},
974
  {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_ARMV8),
975
    0xfe000b00, 0xff800f50, "vsel%20-21c%u.f64\t%z1, %z2, %z0"},
976
  {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_ARMV8),
977
    0xfe800a00, 0xffb00f50, "vmaxnm%u.f32\t%y1, %y2, %y0"},
978
  {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_ARMV8),
979
    0xfe800b00, 0xffb00f50, "vmaxnm%u.f64\t%z1, %z2, %z0"},
980
  {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_ARMV8),
981
    0xfe800a40, 0xffb00f50, "vminnm%u.f32\t%y1, %y2, %y0"},
982
  {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_ARMV8),
983
    0xfe800b40, 0xffb00f50, "vminnm%u.f64\t%z1, %z2, %z0"},
984
  {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_ARMV8),
985
    0xfebc0a40, 0xffbc0f50, "vcvt%16-17?mpna%u.%7?su32.f32\t%y1, %y0"},
986
  {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_ARMV8),
987
    0xfebc0b40, 0xffbc0f50, "vcvt%16-17?mpna%u.%7?su32.f64\t%y1, %z0"},
988
  {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_ARMV8),
989
    0x0eb60a40, 0x0fbe0f50, "vrint%7,16??xzr%c.f32\t%y1, %y0"},
990
  {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_ARMV8),
991
    0x0eb60b40, 0x0fbe0f50, "vrint%7,16??xzr%c.f64\t%z1, %z0"},
992
  {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_ARMV8),
993
    0xfeb80a40, 0xffbc0fd0, "vrint%16-17?mpna%u.f32\t%y1, %y0"},
994
  {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_ARMV8),
995
    0xfeb80b40, 0xffbc0fd0, "vrint%16-17?mpna%u.f64\t%z1, %z0"},
996
997
  {ANY, ARM_FEATURE_CORE_LOW (0), SENTINEL_GENERIC_START, 0, "" },
998
  /* ARMv8.3 AdvSIMD instructions in the space of coprocessor 8.  */
999
  {ANY, ARM_FEATURE_CORE_HIGH (ARM_EXT2_V8_3A),
1000
    0xfc800800, 0xfeb00f10, "vcadd%c.f16\t%12-15,22V, %16-19,7V, %0-3,5V, %{I:#%24?29%24'70%}"},
1001
  {ANY, ARM_FEATURE_CORE_HIGH (ARM_EXT2_V8_3A),
1002
    0xfc900800, 0xfeb00f10, "vcadd%c.f32\t%12-15,22V, %16-19,7V, %0-3,5V, %{I:#%24?29%24'70%}"},
1003
  {ANY, ARM_FEATURE_CORE_HIGH (ARM_EXT2_V8_3A),
1004
    0xfc200800, 0xff300f10, "vcmla%c.f16\t%12-15,22V, %16-19,7V, %0-3,5V, %{I:#%23'90%}"},
1005
  {ANY, ARM_FEATURE_CORE_HIGH (ARM_EXT2_V8_3A),
1006
    0xfd200800, 0xff300f10, "vcmla%c.f16\t%12-15,22V, %16-19,7V, %0-3,5V, %{I:#%23?21%23?780%}"},
1007
  {ANY, ARM_FEATURE_CORE_HIGH (ARM_EXT2_V8_3A),
1008
    0xfc300800, 0xff300f10, "vcmla%c.f32\t%12-15,22V, %16-19,7V, %0-3,5V, %{I:#%23'90%}"},
1009
  {ANY, ARM_FEATURE_CORE_HIGH (ARM_EXT2_V8_3A),
1010
    0xfd300800, 0xff300f10, "vcmla%c.f32\t%12-15,22V, %16-19,7V, %0-3,5V, %{I:#%23?21%23?780%}"},
1011
  {ANY, ARM_FEATURE_CORE_HIGH (ARM_EXT2_V8_3A),
1012
    0xfe000800, 0xffa00f10, "vcmla%c.f16\t%12-15,22V, %16-19,7V, %{R:%0-3D[%5?10]%}, %{I:#%20'90%}"},
1013
  {ANY, ARM_FEATURE_CORE_HIGH (ARM_EXT2_V8_3A),
1014
    0xfe200800, 0xffa00f10, "vcmla%c.f16\t%12-15,22V, %16-19,7V, %{R:%0-3D[%5?10]%}, %{I:#%20?21%20?780%}"},
1015
  {ANY, ARM_FEATURE_CORE_HIGH (ARM_EXT2_V8_3A),
1016
    0xfe800800, 0xffa00f10, "vcmla%c.f32\t%12-15,22V, %16-19,7V, %{R:%0-3,5D[0]%}, %{I:#%20'90%}"},
1017
  {ANY, ARM_FEATURE_CORE_HIGH (ARM_EXT2_V8_3A),
1018
    0xfea00800, 0xffa00f10, "vcmla%c.f32\t%12-15,22V, %16-19,7V, %{R:%0-3,5D[0]%}, %{I:#%20?21%20?780%}"},
1019
1020
  /* BFloat16 instructions.  */
1021
  {ANY, ARM_FEATURE_CORE_HIGH (ARM_EXT2_BF16),
1022
    0x0eb30940, 0x0fbf0f50, "vcvt%7?tb%b.bf16.f32\t%y1, %y0"},
1023
1024
  /* Dot Product instructions in the space of coprocessor 13.  */
1025
  {ANY, ARM_FEATURE_COPROC (FPU_NEON_EXT_DOTPROD),
1026
    0xfc200d00, 0xffb00f00, "v%4?usdot.%4?us8\t%12-15,22V, %16-19,7V, %0-3,5V"},
1027
  {ANY, ARM_FEATURE_COPROC (FPU_NEON_EXT_DOTPROD),
1028
    0xfe200d00, 0xff200f00, "v%4?usdot.%4?us8\t%12-15,22V, %16-19,7V, %{R:%0-3D[%5?10]%}"},
1029
1030
  /* ARMv8.2 FMAC Long instructions in the space of coprocessor 8.  */
1031
  {ANY, ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST | ARM_EXT2_V8_2A),
1032
    0xfc200810, 0xffb00f50, "vfmal.f16\t%12-15,22D, %{R:s%7,16-19d%}, %{R:s%5,0-3d%}"},
1033
  {ANY, ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST | ARM_EXT2_V8_2A),
1034
    0xfca00810, 0xffb00f50, "vfmsl.f16\t%12-15,22D, %{R:s%7,16-19d%}, %{R:s%5,0-3d%}"},
1035
  {ANY, ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST | ARM_EXT2_V8_2A),
1036
    0xfc200850, 0xffb00f50, "vfmal.f16\t%12-15,22Q, %{R:d%16-19,7d%}, %{R:d%0-3,5d%}"},
1037
  {ANY, ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST | ARM_EXT2_V8_2A),
1038
    0xfca00850, 0xffb00f50, "vfmsl.f16\t%12-15,22Q, %{R:d%16-19,7d%}, %{R:d%0-3,5d%}"},
1039
  {ANY, ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST | ARM_EXT2_V8_2A),
1040
    0xfe000810, 0xffb00f50, "vfmal.f16\t%12-15,22D, %{R:s%7,16-19d%}, %{R:s%5,0-2d[%3d]%}"},
1041
  {ANY, ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST | ARM_EXT2_V8_2A),
1042
    0xfe100810, 0xffb00f50, "vfmsl.f16\t%12-15,22D, %{R:s%7,16-19d%}, %{R:s%5,0-2d[%3d]%}"},
1043
  {ANY, ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST | ARM_EXT2_V8_2A),
1044
    0xfe000850, 0xffb00f50, "vfmal.f16\t%12-15,22Q, %{R:d%16-19,7d%}, %{R:d%0-2d[%3,5d]%}"},
1045
  {ANY, ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST | ARM_EXT2_V8_2A),
1046
    0xfe100850, 0xffb00f50, "vfmsl.f16\t%12-15,22Q, %{R:d%16-19,7d%}, %{R:d%0-2d[%3,5d]%}"},
1047
1048
  /* ARMv8.2 half-precision Floating point coprocessor 9 (VFP) instructions.
1049
     cp_num: bit <11:8> == 0b1001.
1050
     cond: bit <31:28> == 0b1110, otherwise, it's UNPREDICTABLE.  */
1051
  {ANY, ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST),
1052
    0x0eb009c0, 0x0fbf0fd0, "vabs%c.f16\t%y1, %y0"},
1053
  {ANY, ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST),
1054
    0x0e300900, 0x0fb00f50, "vadd%c.f16\t%y1, %y2, %y0"},
1055
  {ANY, ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST),
1056
    0x0eb40940, 0x0fbf0f50, "vcmp%7'e%c.f16\t%y1, %y0"},
1057
  {ANY, ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST),
1058
    0x0eb50940, 0x0fbf0f70, "vcmp%7'e%c.f16\t%y1, %{I:#0.0%}"},
1059
  {ANY, ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST),
1060
    0x0eba09c0, 0x0fbe0fd0, "vcvt%c.f16.%16?us%7?31%7?26\t%y1, %y1, %{I:#%5,0-3k%}"},
1061
  {ANY, ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST),
1062
    0x0ebe09c0, 0x0fbe0fd0, "vcvt%c.%16?us%7?31%7?26.f16\t%y1, %y1, %{I:#%5,0-3k%}"},
1063
  {ANY, ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST),
1064
    0x0ebc0940, 0x0fbe0f50, "vcvt%7`r%c.%16?su32.f16\t%y1, %y0"},
1065
  {ANY, ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST),
1066
    0x0eb80940, 0x0fbf0f50, "vcvt%c.f16.%7?su32\t%y1, %y0"},
1067
  {ANY, ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST),
1068
    0xfebc0940, 0xffbc0f50, "vcvt%16-17?mpna%u.%7?su32.f16\t%y1, %y0"},
1069
  {ANY, ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST),
1070
    0x0e800900, 0x0fb00f50, "vdiv%c.f16\t%y1, %y2, %y0"},
1071
  {ANY, ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST),
1072
    0x0ea00900, 0x0fb00f50, "vfma%c.f16\t%y1, %y2, %y0"},
1073
  {ANY, ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST),
1074
    0x0ea00940, 0x0fb00f50, "vfms%c.f16\t%y1, %y2, %y0"},
1075
  {ANY, ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST),
1076
    0x0e900940, 0x0fb00f50, "vfnma%c.f16\t%y1, %y2, %y0"},
1077
  {ANY, ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST),
1078
    0x0e900900, 0x0fb00f50, "vfnms%c.f16\t%y1, %y2, %y0"},
1079
  {ANY, ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST),
1080
    0xfeb00ac0, 0xffbf0fd0, "vins.f16\t%y1, %y0"},
1081
  {ANY, ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST),
1082
    0xfeb00a40, 0xffbf0fd0, "vmovx%c.f16\t%y1, %y0"},
1083
  {ANY, ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST),
1084
    0x0d100900, 0x0f300f00, "vldr%c.16\t%y1, %A"},
1085
  {ANY, ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST),
1086
    0x0d000900, 0x0f300f00, "vstr%c.16\t%y1, %A"},
1087
  {ANY, ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST),
1088
    0xfe800900, 0xffb00f50, "vmaxnm%c.f16\t%y1, %y2, %y0"},
1089
  {ANY, ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST),
1090
    0xfe800940, 0xffb00f50, "vminnm%c.f16\t%y1, %y2, %y0"},
1091
  {ANY, ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST),
1092
    0x0e000900, 0x0fb00f50, "vmla%c.f16\t%y1, %y2, %y0"},
1093
  {ANY, ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST),
1094
    0x0e000940, 0x0fb00f50, "vmls%c.f16\t%y1, %y2, %y0"},
1095
  {ANY, ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST),
1096
    0x0e100910, 0x0ff00f7f, "vmov%c.f16\t%12-15r, %y2"},
1097
  {ANY, ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST),
1098
    0x0e000910, 0x0ff00f7f, "vmov%c.f16\t%y2, %12-15r"},
1099
  {ANY, ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST),
1100
    0xeb00900, 0x0fb00ff0, "vmov%c.f16\t%y1, %{I:#%0-3,16-19E%}"},
1101
  {ANY, ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST),
1102
    0x0e200900, 0x0fb00f50, "vmul%c.f16\t%y1, %y2, %y0"},
1103
  {ANY, ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST),
1104
    0x0eb10940, 0x0fbf0fd0, "vneg%c.f16\t%y1, %y0"},
1105
  {ANY, ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST),
1106
    0x0e100940, 0x0fb00f50, "vnmla%c.f16\t%y1, %y2, %y0"},
1107
  {ANY, ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST),
1108
    0x0e100900, 0x0fb00f50, "vnmls%c.f16\t%y1, %y2, %y0"},
1109
  {ANY, ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST),
1110
    0x0e200940, 0x0fb00f50, "vnmul%c.f16\t%y1, %y2, %y0"},
1111
  {ANY, ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST),
1112
    0x0eb60940, 0x0fbe0f50, "vrint%7,16??xzr%c.f16\t%y1, %y0"},
1113
  {ANY, ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST),
1114
    0xfeb80940, 0xffbc0fd0, "vrint%16-17?mpna%u.f16\t%y1, %y0"},
1115
  {ANY, ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST),
1116
    0xfe000900, 0xff800f50, "vsel%20-21c%u.f16\t%y1, %y2, %y0"},
1117
  {ANY, ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST),
1118
    0x0eb109c0, 0x0fbf0fd0, "vsqrt%c.f16\t%y1, %y0"},
1119
  {ANY, ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST),
1120
    0x0e300940, 0x0fb00f50, "vsub%c.f16\t%y1, %y2, %y0"},
1121
1122
  /* ARMv8.3 javascript conversion instruction.  */
1123
  {ANY, ARM_FEATURE_CORE_HIGH (ARM_EXT2_V8_3A),
1124
    0x0eb90bc0, 0x0fbf0fd0, "vjcvt%c.s32.f64\t%y1, %z0"},
1125
1126
  {ANY, ARM_FEATURE_CORE_LOW (0), 0, 0, 0}
1127
};
1128
1129
/* Generic coprocessor instructions.  These are only matched if a more specific
1130
   SIMD or co-processor instruction does not match first.  */
1131
1132
static const struct sopcode32 generic_coprocessor_opcodes[] =
1133
{
1134
  /* Generic coprocessor instructions.  */
1135
  {ANY, ARM_FEATURE_CORE_LOW (ARM_EXT_V5E),
1136
    0x0c400000, 0x0ff00000, "mcrr%c\t%{I:%8-11d%}, %{I:%4-7d%}, %12-15R, %16-19r, %{R:cr%0-3d%}"},
1137
  {ANY, ARM_FEATURE_CORE_LOW (ARM_EXT_V5E),
1138
    0x0c500000, 0x0ff00000,
1139
    "mrrc%c\t%{I:%8-11d%}, %{I:%4-7d%}, %12-15Ru, %16-19Ru, %{R:cr%0-3d%}"},
1140
  {ANY, ARM_FEATURE_CORE_LOW (ARM_EXT_V2),
1141
    0x0e000000, 0x0f000010,
1142
    "cdp%c\t%{I:%8-11d%}, %{I:%20-23d%}, %{R:cr%12-15d%}, %{R:cr%16-19d%}, %{R:cr%0-3d%}, {%{I:%5-7d%}}"},
1143
  {ANY, ARM_FEATURE_CORE_LOW (ARM_EXT_V2),
1144
    0x0e10f010, 0x0f10f010,
1145
    "mrc%c\t%{I:%8-11d%}, %{I:%21-23d%}, %{R:APSR_nzcv%}, %{R:cr%16-19d%}, %{R:cr%0-3d%}, {%{I:%5-7d%}}"},
1146
  {ANY, ARM_FEATURE_CORE_LOW (ARM_EXT_V2),
1147
    0x0e100010, 0x0f100010,
1148
    "mrc%c\t%{I:%8-11d%}, %{I:%21-23d%}, %12-15r, %{R:cr%16-19d%}, %{R:cr%0-3d%}, {%{I:%5-7d%}}"},
1149
  {ANY, ARM_FEATURE_CORE_LOW (ARM_EXT_V2),
1150
    0x0e000010, 0x0f100010,
1151
    "mcr%c\t%{I:%8-11d%}, %{I:%21-23d%}, %12-15R, %{R:cr%16-19d%}, %{R:cr%0-3d%}, {%{I:%5-7d%}}"},
1152
  {ANY, ARM_FEATURE_CORE_LOW (ARM_EXT_V2),
1153
    0x0c000000, 0x0e100000, "stc%22'l%c\t%{I:%8-11d%}, %{R:cr%12-15d%}, %A"},
1154
  {ANY, ARM_FEATURE_CORE_LOW (ARM_EXT_V2),
1155
    0x0c100000, 0x0e100000, "ldc%22'l%c\t%{I:%8-11d%}, %{R:cr%12-15d%}, %A"},
1156
1157
  /* V6 coprocessor instructions.  */
1158
  {ANY, ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
1159
    0xfc500000, 0xfff00000,
1160
    "mrrc2%c\t%{I:%8-11d%}, %{I:%4-7d%}, %12-15Ru, %16-19Ru, %{R:cr%0-3d%}"},
1161
  {ANY, ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
1162
    0xfc400000, 0xfff00000,
1163
    "mcrr2%c\t%{I:%8-11d%}, %{I:%4-7d%}, %12-15R, %16-19R, %{R:cr%0-3d%}"},
1164
1165
  /* V5 coprocessor instructions.  */
1166
  {ANY, ARM_FEATURE_CORE_LOW (ARM_EXT_V5),
1167
    0xfc100000, 0xfe100000, "ldc2%22'l%c\t%{I:%8-11d%}, %{R:cr%12-15d%}, %A"},
1168
  {ANY, ARM_FEATURE_CORE_LOW (ARM_EXT_V5),
1169
    0xfc000000, 0xfe100000, "stc2%22'l%c\t%{I:%8-11d%}, %{R:cr%12-15d%}, %A"},
1170
  {ANY, ARM_FEATURE_CORE_LOW (ARM_EXT_V5),
1171
    0xfe000000, 0xff000010,
1172
    "cdp2%c\t%{I:%8-11d%}, %{I:%20-23d%}, %{R:cr%12-15d%}, %{R:cr%16-19d%}, %{R:cr%0-3d%}, {%{I:%5-7d%}}"},
1173
  {ANY, ARM_FEATURE_CORE_LOW (ARM_EXT_V5),
1174
    0xfe000010, 0xff100010,
1175
    "mcr2%c\t%{I:%8-11d%}, %{I:%21-23d%}, %12-15R, %{R:cr%16-19d%}, %{R:cr%0-3d%}, {%{I:%5-7d%}}"},
1176
  {ANY, ARM_FEATURE_CORE_LOW (ARM_EXT_V5),
1177
    0xfe100010, 0xff100010,
1178
    "mrc2%c\t%{I:%8-11d%}, %{I:%21-23d%}, %12-15r, %{R:cr%16-19d%}, %{R:cr%0-3d%}, {%{I:%5-7d%}}"},
1179
1180
  {ANY, ARM_FEATURE_CORE_LOW (0), 0, 0, 0}
1181
};
1182
1183
/* Neon opcode table:  This does not encode the top byte -- that is
1184
   checked by the print_insn_neon routine, as it depends on whether we are
1185
   doing thumb32 or arm32 disassembly.  */
1186
1187
/* print_insn_neon recognizes the following format control codes:
1188
1189
   %%     %
1190
1191
   %c     print condition code
1192
   %u     print condition code (unconditional in ARM mode,
1193
                          UNPREDICTABLE if not AL in Thumb)
1194
   %A     print v{st,ld}[1234] operands
1195
   %B     print v{st,ld}[1234] any one operands
1196
   %C     print v{st,ld}[1234] single->all operands
1197
   %D     print scalar
1198
   %E     print vmov, vmvn, vorr, vbic encoded constant
1199
   %F     print vtbl,vtbx register list
1200
1201
   %<bitfield>r   print as an ARM register
1202
   %<bitfield>d   print the bitfield in decimal
1203
   %<bitfield>e         print the 2^N - bitfield in decimal
1204
   %<bitfield>D   print as a NEON D register
1205
   %<bitfield>Q   print as a NEON Q register
1206
   %<bitfield>R   print as a NEON D or Q register
1207
   %<bitfield>Sn  print byte scaled width limited by n
1208
   %<bitfield>Tn  print short scaled width limited by n
1209
   %<bitfield>Un  print long scaled width limited by n
1210
1211
   %<bitfield>'c  print specified char iff bitfield is all ones
1212
   %<bitfield>`c  print specified char iff bitfield is all zeroes
1213
   %<bitfield>?ab...    select from array of values in big endian order.  */
1214
1215
static const struct opcode32 neon_opcodes[] =
1216
{
1217
  /* Extract.  */
1218
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1219
    0xf2b00840, 0xffb00850,
1220
    "vext%c.8\t%12-15,22R, %16-19,7R, %0-3,5R, %{I:#%8-11d%}"},
1221
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1222
    0xf2b00000, 0xffb00810,
1223
    "vext%c.8\t%12-15,22R, %16-19,7R, %0-3,5R, %{I:#%8-11d%}"},
1224
1225
  /* Data transfer between ARM and NEON registers.  */
1226
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1227
    0x0e800b10, 0x0ff00f70, "vdup%c.32\t%16-19,7D, %12-15r"},
1228
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1229
    0x0e800b30, 0x0ff00f70, "vdup%c.16\t%16-19,7D, %12-15r"},
1230
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1231
    0x0ea00b10, 0x0ff00f70, "vdup%c.32\t%16-19,7Q, %12-15r"},
1232
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1233
    0x0ea00b30, 0x0ff00f70, "vdup%c.16\t%16-19,7Q, %12-15r"},
1234
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1235
    0x0ec00b10, 0x0ff00f70, "vdup%c.8\t%16-19,7D, %12-15r"},
1236
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1237
    0x0ee00b10, 0x0ff00f70, "vdup%c.8\t%16-19,7Q, %12-15r"},
1238
1239
  /* Move data element to all lanes.  */
1240
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1241
    0xf3b40c00, 0xffb70f90, "vdup%c.32\t%12-15,22R, %{R:%0-3,5D[%19d]%}"},
1242
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1243
    0xf3b20c00, 0xffb30f90, "vdup%c.16\t%12-15,22R, %{R:%0-3,5D[%18-19d]%}"},
1244
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1245
    0xf3b10c00, 0xffb10f90, "vdup%c.8\t%12-15,22R, %{R:%0-3,5D[%17-19d]%}"},
1246
1247
  /* Table lookup.  */
1248
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1249
    0xf3b00800, 0xffb00c50, "vtbl%c.8\t%12-15,22D, %F, %0-3,5D"},
1250
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1251
    0xf3b00840, 0xffb00c50, "vtbx%c.8\t%12-15,22D, %F, %0-3,5D"},
1252
1253
  /* Half-precision conversions.  */
1254
  {ARM_FEATURE_COPROC (FPU_VFP_EXT_FP16),
1255
    0xf3b60600, 0xffbf0fd0, "vcvt%c.f16.f32\t%12-15,22D, %0-3,5Q"},
1256
  {ARM_FEATURE_COPROC (FPU_VFP_EXT_FP16),
1257
    0xf3b60700, 0xffbf0fd0, "vcvt%c.f32.f16\t%12-15,22Q, %0-3,5D"},
1258
1259
  /* NEON fused multiply add instructions.  */
1260
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_FMA),
1261
    0xf2000c10, 0xffb00f10, "vfma%c.f32\t%12-15,22R, %16-19,7R, %0-3,5R"},
1262
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST),
1263
    0xf2100c10, 0xffb00f10, "vfma%c.f16\t%12-15,22R, %16-19,7R, %0-3,5R"},
1264
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_FMA),
1265
    0xf2200c10, 0xffb00f10, "vfms%c.f32\t%12-15,22R, %16-19,7R, %0-3,5R"},
1266
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST),
1267
    0xf2300c10, 0xffb00f10, "vfms%c.f16\t%12-15,22R, %16-19,7R, %0-3,5R"},
1268
1269
  /* BFloat16 instructions.  */
1270
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_BF16),
1271
    0xfc000d00, 0xffb00f10, "vdot.bf16\t%12-15,22R, %16-19,7R, %0-3,5R"},
1272
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_BF16),
1273
    0xfe000d00, 0xffb00f10, "vdot.bf16\t%12-15,22R, %16-19,7R, %{R:d%0-3d[%5d]%}"},
1274
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_BF16),
1275
    0xfc000c40, 0xffb00f50, "vmmla.bf16\t%12-15,22R, %16-19,7R, %0-3,5R"},
1276
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_BF16),
1277
    0xf3b60640, 0xffbf0fd0, "vcvt%c.bf16.f32\t%12-15,22D, %0-3,5Q"},
1278
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_BF16),
1279
    0xfc300810, 0xffb00f10, "vfma%6?tb.bf16\t%12-15,22Q, %16-19,7Q, %0-3,5Q"},
1280
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_BF16),
1281
    0xfe300810, 0xffb00f10, "vfma%6?tb.bf16\t%12-15,22Q, %16-19,7Q, %{R:%0-2D[%3,5d]%}"},
1282
1283
  /* Matrix Multiply instructions.  */
1284
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_I8MM),
1285
    0xfc200c40, 0xffb00f50, "vsmmla.s8\t%12-15,22R, %16-19,7R, %0-3,5R"},
1286
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_I8MM),
1287
    0xfc200c50, 0xffb00f50, "vummla.u8\t%12-15,22R, %16-19,7R, %0-3,5R"},
1288
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_I8MM),
1289
    0xfca00c40, 0xffb00f50, "vusmmla.s8\t%12-15,22R, %16-19,7R, %0-3,5R"},
1290
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_I8MM),
1291
    0xfca00d00, 0xffb00f10, "vusdot.s8\t%12-15,22R, %16-19,7R, %0-3,5R"},
1292
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_I8MM),
1293
    0xfe800d00, 0xffb00f10, "vusdot.s8\t%12-15,22R, %16-19,7R, %{R:d%0-3d[%5d]%}"},
1294
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_I8MM),
1295
    0xfe800d10, 0xffb00f10, "vsudot.u8\t%12-15,22R, %16-19,7R, %{R:d%0-3d[%5d]%}"},
1296
1297
  /* Two registers, miscellaneous.  */
1298
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_ARMV8),
1299
    0xf3ba0400, 0xffbf0c10, "vrint%7-9?p?m?zaxn%u.f32\t%12-15,22R, %0-3,5R"},
1300
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST),
1301
    0xf3b60400, 0xffbf0c10, "vrint%7-9?p?m?zaxn%u.f16\t%12-15,22R, %0-3,5R"},
1302
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_ARMV8),
1303
    0xf3bb0000, 0xffbf0c10, "vcvt%8-9?mpna%u.%7?us32.f32\t%12-15,22R, %0-3,5R"},
1304
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST),
1305
    0xf3b70000, 0xffbf0c10, "vcvt%8-9?mpna%u.%7?us16.f16\t%12-15,22R, %0-3,5R"},
1306
  {ARM_FEATURE_COPROC (FPU_CRYPTO_EXT_ARMV8),
1307
    0xf3b00300, 0xffbf0fd0, "aese%u.8\t%12-15,22Q, %0-3,5Q"},
1308
  {ARM_FEATURE_COPROC (FPU_CRYPTO_EXT_ARMV8),
1309
    0xf3b00340, 0xffbf0fd0, "aesd%u.8\t%12-15,22Q, %0-3,5Q"},
1310
  {ARM_FEATURE_COPROC (FPU_CRYPTO_EXT_ARMV8),
1311
    0xf3b00380, 0xffbf0fd0, "aesmc%u.8\t%12-15,22Q, %0-3,5Q"},
1312
  {ARM_FEATURE_COPROC (FPU_CRYPTO_EXT_ARMV8),
1313
    0xf3b003c0, 0xffbf0fd0, "aesimc%u.8\t%12-15,22Q, %0-3,5Q"},
1314
  {ARM_FEATURE_COPROC (FPU_CRYPTO_EXT_ARMV8),
1315
    0xf3b902c0, 0xffbf0fd0, "sha1h%u.32\t%12-15,22Q, %0-3,5Q"},
1316
  {ARM_FEATURE_COPROC (FPU_CRYPTO_EXT_ARMV8),
1317
    0xf3ba0380, 0xffbf0fd0, "sha1su1%u.32\t%12-15,22Q, %0-3,5Q"},
1318
  {ARM_FEATURE_COPROC (FPU_CRYPTO_EXT_ARMV8),
1319
    0xf3ba03c0, 0xffbf0fd0, "sha256su0%u.32\t%12-15,22Q, %0-3,5Q"},
1320
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1321
    0xf2880a10, 0xfebf0fd0, "vmovl%c.%24?us8\t%12-15,22Q, %0-3,5D"},
1322
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1323
    0xf2900a10, 0xfebf0fd0, "vmovl%c.%24?us16\t%12-15,22Q, %0-3,5D"},
1324
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1325
    0xf2a00a10, 0xfebf0fd0, "vmovl%c.%24?us32\t%12-15,22Q, %0-3,5D"},
1326
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1327
    0xf3b00500, 0xffbf0f90, "vcnt%c.8\t%12-15,22R, %0-3,5R"},
1328
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1329
    0xf3b00580, 0xffbf0f90, "vmvn%c\t%12-15,22R, %0-3,5R"},
1330
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1331
    0xf3b20000, 0xffbf0f90, "vswp%c\t%12-15,22R, %0-3,5R"},
1332
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1333
    0xf3b20200, 0xffb30fd0, "vmovn%c.i%18-19T2\t%12-15,22D, %0-3,5Q"},
1334
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1335
    0xf3b20240, 0xffb30fd0, "vqmovun%c.s%18-19T2\t%12-15,22D, %0-3,5Q"},
1336
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1337
    0xf3b20280, 0xffb30fd0, "vqmovn%c.s%18-19T2\t%12-15,22D, %0-3,5Q"},
1338
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1339
    0xf3b202c0, 0xffb30fd0, "vqmovn%c.u%18-19T2\t%12-15,22D, %0-3,5Q"},
1340
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1341
    0xf3b20300, 0xffb30fd0,
1342
    "vshll%c.i%18-19S2\t%12-15,22Q, %0-3,5D, %{I:#%18-19S2%}"},
1343
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1344
    0xf3bb0400, 0xffbf0e90, "vrecpe%c.%8?fu%18-19S2\t%12-15,22R, %0-3,5R"},
1345
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST),
1346
    0xf3b70400, 0xffbf0e90, "vrecpe%c.%8?fu16\t%12-15,22R, %0-3,5R"},
1347
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1348
    0xf3bb0480, 0xffbf0e90, "vrsqrte%c.%8?fu%18-19S2\t%12-15,22R, %0-3,5R"},
1349
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST),
1350
    0xf3b70480, 0xffbf0e90, "vrsqrte%c.%8?fu16\t%12-15,22R, %0-3,5R"},
1351
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1352
    0xf3b00000, 0xffb30f90, "vrev64%c.%18-19S2\t%12-15,22R, %0-3,5R"},
1353
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1354
    0xf3b00080, 0xffb30f90, "vrev32%c.%18-19S2\t%12-15,22R, %0-3,5R"},
1355
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1356
    0xf3b00100, 0xffb30f90, "vrev16%c.%18-19S2\t%12-15,22R, %0-3,5R"},
1357
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1358
    0xf3b00400, 0xffb30f90, "vcls%c.s%18-19S2\t%12-15,22R, %0-3,5R"},
1359
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1360
    0xf3b00480, 0xffb30f90, "vclz%c.i%18-19S2\t%12-15,22R, %0-3,5R"},
1361
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1362
    0xf3b00700, 0xffb30f90, "vqabs%c.s%18-19S2\t%12-15,22R, %0-3,5R"},
1363
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1364
    0xf3b00780, 0xffb30f90, "vqneg%c.s%18-19S2\t%12-15,22R, %0-3,5R"},
1365
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1366
    0xf3b20080, 0xffb30f90, "vtrn%c.%18-19S2\t%12-15,22R, %0-3,5R"},
1367
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1368
    0xf3b20100, 0xffb30f90, "vuzp%c.%18-19S2\t%12-15,22R, %0-3,5R"},
1369
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1370
    0xf3b20180, 0xffb30f90, "vzip%c.%18-19S2\t%12-15,22R, %0-3,5R"},
1371
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1372
    0xf3b10000, 0xffb30b90, "vcgt%c.%10?fs%18-19S2\t%12-15,22R, %0-3,5R, %{I:#0%}"},
1373
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1374
    0xf3b10080, 0xffb30b90, "vcge%c.%10?fs%18-19S2\t%12-15,22R, %0-3,5R, %{I:#0%}"},
1375
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1376
    0xf3b10100, 0xffb30b90, "vceq%c.%10?fi%18-19S2\t%12-15,22R, %0-3,5R, %{I:#0%}"},
1377
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1378
    0xf3b10180, 0xffb30b90, "vcle%c.%10?fs%18-19S2\t%12-15,22R, %0-3,5R, %{I:#0%}"},
1379
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1380
    0xf3b10200, 0xffb30b90, "vclt%c.%10?fs%18-19S2\t%12-15,22R, %0-3,5R, %{I:#0%}"},
1381
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1382
    0xf3b10300, 0xffb30b90, "vabs%c.%10?fs%18-19S2\t%12-15,22R, %0-3,5R"},
1383
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1384
    0xf3b10380, 0xffb30b90, "vneg%c.%10?fs%18-19S2\t%12-15,22R, %0-3,5R"},
1385
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1386
    0xf3b00200, 0xffb30f10, "vpaddl%c.%7?us%18-19S2\t%12-15,22R, %0-3,5R"},
1387
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1388
    0xf3b00600, 0xffb30f10, "vpadal%c.%7?us%18-19S2\t%12-15,22R, %0-3,5R"},
1389
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1390
    0xf3bb0600, 0xffbf0e10,
1391
    "vcvt%c.%7-8?usff%18-19Sa.%7-8?ffus%18-19Sa\t%12-15,22R, %0-3,5R"},
1392
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST),
1393
    0xf3b70600, 0xffbf0e10,
1394
    "vcvt%c.%7-8?usff16.%7-8?ffus16\t%12-15,22R, %0-3,5R"},
1395
1396
  /* Three registers of the same length.  */
1397
  {ARM_FEATURE_COPROC (FPU_CRYPTO_EXT_ARMV8),
1398
    0xf2000c40, 0xffb00f50, "sha1c%u.32\t%12-15,22Q, %16-19,7Q, %0-3,5Q"},
1399
  {ARM_FEATURE_COPROC (FPU_CRYPTO_EXT_ARMV8),
1400
    0xf2100c40, 0xffb00f50, "sha1p%u.32\t%12-15,22Q, %16-19,7Q, %0-3,5Q"},
1401
  {ARM_FEATURE_COPROC (FPU_CRYPTO_EXT_ARMV8),
1402
    0xf2200c40, 0xffb00f50, "sha1m%u.32\t%12-15,22Q, %16-19,7Q, %0-3,5Q"},
1403
  {ARM_FEATURE_COPROC (FPU_CRYPTO_EXT_ARMV8),
1404
    0xf2300c40, 0xffb00f50, "sha1su0%u.32\t%12-15,22Q, %16-19,7Q, %0-3,5Q"},
1405
  {ARM_FEATURE_COPROC (FPU_CRYPTO_EXT_ARMV8),
1406
    0xf3000c40, 0xffb00f50, "sha256h%u.32\t%12-15,22Q, %16-19,7Q, %0-3,5Q"},
1407
  {ARM_FEATURE_COPROC (FPU_CRYPTO_EXT_ARMV8),
1408
    0xf3100c40, 0xffb00f50, "sha256h2%u.32\t%12-15,22Q, %16-19,7Q, %0-3,5Q"},
1409
  {ARM_FEATURE_COPROC (FPU_CRYPTO_EXT_ARMV8),
1410
    0xf3200c40, 0xffb00f50, "sha256su1%u.32\t%12-15,22Q, %16-19,7Q, %0-3,5Q"},
1411
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_ARMV8),
1412
    0xf3000f10, 0xffb00f10, "vmaxnm%u.f32\t%12-15,22R, %16-19,7R, %0-3,5R"},
1413
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST),
1414
    0xf3100f10, 0xffb00f10, "vmaxnm%u.f16\t%12-15,22R, %16-19,7R, %0-3,5R"},
1415
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_ARMV8),
1416
    0xf3200f10, 0xffb00f10, "vminnm%u.f32\t%12-15,22R, %16-19,7R, %0-3,5R"},
1417
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST),
1418
    0xf3300f10, 0xffb00f10, "vminnm%u.f16\t%12-15,22R, %16-19,7R, %0-3,5R"},
1419
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1420
    0xf2000110, 0xffb00f10, "vand%c\t%12-15,22R, %16-19,7R, %0-3,5R"},
1421
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1422
    0xf2100110, 0xffb00f10, "vbic%c\t%12-15,22R, %16-19,7R, %0-3,5R"},
1423
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1424
    0xf2200110, 0xffb00f10, "vorr%c\t%12-15,22R, %16-19,7R, %0-3,5R"},
1425
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1426
    0xf2300110, 0xffb00f10, "vorn%c\t%12-15,22R, %16-19,7R, %0-3,5R"},
1427
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1428
    0xf3000110, 0xffb00f10, "veor%c\t%12-15,22R, %16-19,7R, %0-3,5R"},
1429
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1430
    0xf3100110, 0xffb00f10, "vbsl%c\t%12-15,22R, %16-19,7R, %0-3,5R"},
1431
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1432
    0xf3200110, 0xffb00f10, "vbit%c\t%12-15,22R, %16-19,7R, %0-3,5R"},
1433
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1434
    0xf3300110, 0xffb00f10, "vbif%c\t%12-15,22R, %16-19,7R, %0-3,5R"},
1435
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1436
    0xf2000d00, 0xffb00f10, "vadd%c.f32\t%12-15,22R, %16-19,7R, %0-3,5R"},
1437
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST),
1438
    0xf2100d00, 0xffb00f10, "vadd%c.f16\t%12-15,22R, %16-19,7R, %0-3,5R"},
1439
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1440
    0xf2000d10, 0xffb00f10, "vmla%c.f32\t%12-15,22R, %16-19,7R, %0-3,5R"},
1441
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST),
1442
    0xf2100d10, 0xffb00f10, "vmla%c.f16\t%12-15,22R, %16-19,7R, %0-3,5R"},
1443
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1444
    0xf2000e00, 0xffb00f10, "vceq%c.f32\t%12-15,22R, %16-19,7R, %0-3,5R"},
1445
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST),
1446
    0xf2100e00, 0xffb00f10, "vceq%c.f16\t%12-15,22R, %16-19,7R, %0-3,5R"},
1447
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1448
    0xf2000f00, 0xffb00f10, "vmax%c.f32\t%12-15,22R, %16-19,7R, %0-3,5R"},
1449
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST),
1450
    0xf2100f00, 0xffb00f10, "vmax%c.f16\t%12-15,22R, %16-19,7R, %0-3,5R"},
1451
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1452
    0xf2000f10, 0xffb00f10, "vrecps%c.f32\t%12-15,22R, %16-19,7R, %0-3,5R"},
1453
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST),
1454
    0xf2100f10, 0xffb00f10, "vrecps%c.f16\t%12-15,22R, %16-19,7R, %0-3,5R"},
1455
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1456
    0xf2200d00, 0xffb00f10, "vsub%c.f32\t%12-15,22R, %16-19,7R, %0-3,5R"},
1457
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST),
1458
    0xf2300d00, 0xffb00f10, "vsub%c.f16\t%12-15,22R, %16-19,7R, %0-3,5R"},
1459
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1460
    0xf2200d10, 0xffb00f10, "vmls%c.f32\t%12-15,22R, %16-19,7R, %0-3,5R"},
1461
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST),
1462
    0xf2300d10, 0xffb00f10, "vmls%c.f16\t%12-15,22R, %16-19,7R, %0-3,5R"},
1463
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1464
    0xf2200f00, 0xffb00f10, "vmin%c.f32\t%12-15,22R, %16-19,7R, %0-3,5R"},
1465
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST),
1466
    0xf2300f00, 0xffb00f10, "vmin%c.f16\t%12-15,22R, %16-19,7R, %0-3,5R"},
1467
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1468
    0xf2200f10, 0xffb00f10, "vrsqrts%c.f32\t%12-15,22R, %16-19,7R, %0-3,5R"},
1469
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST),
1470
    0xf2300f10, 0xffb00f10, "vrsqrts%c.f16\t%12-15,22R, %16-19,7R, %0-3,5R"},
1471
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1472
    0xf3000d00, 0xffb00f10, "vpadd%c.f32\t%12-15,22R, %16-19,7R, %0-3,5R"},
1473
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST),
1474
    0xf3100d00, 0xffb00f10, "vpadd%c.f16\t%12-15,22R, %16-19,7R, %0-3,5R"},
1475
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1476
    0xf3000d10, 0xffb00f10, "vmul%c.f32\t%12-15,22R, %16-19,7R, %0-3,5R"},
1477
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST),
1478
    0xf3100d10, 0xffb00f10, "vmul%c.f16\t%12-15,22R, %16-19,7R, %0-3,5R"},
1479
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1480
    0xf3000e00, 0xffb00f10, "vcge%c.f32\t%12-15,22R, %16-19,7R, %0-3,5R"},
1481
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST),
1482
    0xf3100e00, 0xffb00f10, "vcge%c.f16\t%12-15,22R, %16-19,7R, %0-3,5R"},
1483
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1484
    0xf3000e10, 0xffb00f10, "vacge%c.f32\t%12-15,22R, %16-19,7R, %0-3,5R"},
1485
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST),
1486
    0xf3100e10, 0xffb00f10, "vacge%c.f16\t%12-15,22R, %16-19,7R, %0-3,5R"},
1487
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1488
    0xf3000f00, 0xffb00f10, "vpmax%c.f32\t%12-15,22R, %16-19,7R, %0-3,5R"},
1489
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST),
1490
    0xf3100f00, 0xffb00f10, "vpmax%c.f16\t%12-15,22R, %16-19,7R, %0-3,5R"},
1491
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1492
    0xf3200d00, 0xffb00f10, "vabd%c.f32\t%12-15,22R, %16-19,7R, %0-3,5R"},
1493
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST),
1494
    0xf3300d00, 0xffb00f10, "vabd%c.f16\t%12-15,22R, %16-19,7R, %0-3,5R"},
1495
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1496
    0xf3200e00, 0xffb00f10, "vcgt%c.f32\t%12-15,22R, %16-19,7R, %0-3,5R"},
1497
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST),
1498
    0xf3300e00, 0xffb00f10, "vcgt%c.f16\t%12-15,22R, %16-19,7R, %0-3,5R"},
1499
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1500
    0xf3200e10, 0xffb00f10, "vacgt%c.f32\t%12-15,22R, %16-19,7R, %0-3,5R"},
1501
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST),
1502
    0xf3300e10, 0xffb00f10, "vacgt%c.f16\t%12-15,22R, %16-19,7R, %0-3,5R"},
1503
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1504
    0xf3200f00, 0xffb00f10, "vpmin%c.f32\t%12-15,22R, %16-19,7R, %0-3,5R"},
1505
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST),
1506
    0xf3300f00, 0xffb00f10, "vpmin%c.f16\t%12-15,22R, %16-19,7R, %0-3,5R"},
1507
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1508
    0xf2000800, 0xff800f10, "vadd%c.i%20-21S3\t%12-15,22R, %16-19,7R, %0-3,5R"},
1509
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1510
    0xf2000810, 0xff800f10, "vtst%c.%20-21S2\t%12-15,22R, %16-19,7R, %0-3,5R"},
1511
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1512
    0xf2000900, 0xff800f10, "vmla%c.i%20-21S2\t%12-15,22R, %16-19,7R, %0-3,5R"},
1513
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1514
    0xf2000b00, 0xff800f10,
1515
    "vqdmulh%c.s%20-21S6\t%12-15,22R, %16-19,7R, %0-3,5R"},
1516
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1517
    0xf2000b10, 0xff800f10,
1518
    "vpadd%c.i%20-21S2\t%12-15,22R, %16-19,7R, %0-3,5R"},
1519
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1520
    0xf3000800, 0xff800f10, "vsub%c.i%20-21S3\t%12-15,22R, %16-19,7R, %0-3,5R"},
1521
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1522
    0xf3000810, 0xff800f10, "vceq%c.i%20-21S2\t%12-15,22R, %16-19,7R, %0-3,5R"},
1523
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1524
    0xf3000900, 0xff800f10, "vmls%c.i%20-21S2\t%12-15,22R, %16-19,7R, %0-3,5R"},
1525
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1526
    0xf3000b00, 0xff800f10,
1527
    "vqrdmulh%c.s%20-21S6\t%12-15,22R, %16-19,7R, %0-3,5R"},
1528
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1529
    0xf2000000, 0xfe800f10,
1530
    "vhadd%c.%24?us%20-21S2\t%12-15,22R, %16-19,7R, %0-3,5R"},
1531
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1532
    0xf2000010, 0xfe800f10,
1533
    "vqadd%c.%24?us%20-21S3\t%12-15,22R, %16-19,7R, %0-3,5R"},
1534
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1535
    0xf2000100, 0xfe800f10,
1536
    "vrhadd%c.%24?us%20-21S2\t%12-15,22R, %16-19,7R, %0-3,5R"},
1537
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1538
    0xf2000200, 0xfe800f10,
1539
    "vhsub%c.%24?us%20-21S2\t%12-15,22R, %16-19,7R, %0-3,5R"},
1540
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1541
    0xf2000210, 0xfe800f10,
1542
    "vqsub%c.%24?us%20-21S3\t%12-15,22R, %16-19,7R, %0-3,5R"},
1543
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1544
    0xf2000300, 0xfe800f10,
1545
    "vcgt%c.%24?us%20-21S2\t%12-15,22R, %16-19,7R, %0-3,5R"},
1546
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1547
    0xf2000310, 0xfe800f10,
1548
    "vcge%c.%24?us%20-21S2\t%12-15,22R, %16-19,7R, %0-3,5R"},
1549
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1550
    0xf2000400, 0xfe800f10,
1551
    "vshl%c.%24?us%20-21S3\t%12-15,22R, %0-3,5R, %16-19,7R"},
1552
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1553
    0xf2000410, 0xfe800f10,
1554
    "vqshl%c.%24?us%20-21S3\t%12-15,22R, %0-3,5R, %16-19,7R"},
1555
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1556
    0xf2000500, 0xfe800f10,
1557
    "vrshl%c.%24?us%20-21S3\t%12-15,22R, %0-3,5R, %16-19,7R"},
1558
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1559
    0xf2000510, 0xfe800f10,
1560
    "vqrshl%c.%24?us%20-21S3\t%12-15,22R, %0-3,5R, %16-19,7R"},
1561
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1562
    0xf2000600, 0xfe800f10,
1563
    "vmax%c.%24?us%20-21S2\t%12-15,22R, %16-19,7R, %0-3,5R"},
1564
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1565
    0xf2000610, 0xfe800f10,
1566
    "vmin%c.%24?us%20-21S2\t%12-15,22R, %16-19,7R, %0-3,5R"},
1567
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1568
    0xf2000700, 0xfe800f10,
1569
    "vabd%c.%24?us%20-21S2\t%12-15,22R, %16-19,7R, %0-3,5R"},
1570
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1571
    0xf2000710, 0xfe800f10,
1572
    "vaba%c.%24?us%20-21S2\t%12-15,22R, %16-19,7R, %0-3,5R"},
1573
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1574
    0xf2000910, 0xfe800f10,
1575
    "vmul%c.%24?pi%20-21S2\t%12-15,22R, %16-19,7R, %0-3,5R"},
1576
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1577
    0xf2000a00, 0xfe800f10,
1578
    "vpmax%c.%24?us%20-21S2\t%12-15,22R, %16-19,7R, %0-3,5R"},
1579
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1580
    0xf2000a10, 0xfe800f10,
1581
    "vpmin%c.%24?us%20-21S2\t%12-15,22R, %16-19,7R, %0-3,5R"},
1582
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_RDMA),
1583
    0xf3000b10, 0xff800f10,
1584
    "vqrdmlah%c.s%20-21S6\t%12-15,22R, %16-19,7R, %0-3,5R"},
1585
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_RDMA),
1586
    0xf3000c10, 0xff800f10,
1587
    "vqrdmlsh%c.s%20-21S6\t%12-15,22R, %16-19,7R, %0-3,5R"},
1588
1589
  /* One register and an immediate value.  */
1590
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1591
    0xf2800e10, 0xfeb80fb0, "vmov%c.i8\t%12-15,22R, %E"},
1592
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1593
    0xf2800e30, 0xfeb80fb0, "vmov%c.i64\t%12-15,22R, %E"},
1594
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1595
    0xf2800f10, 0xfeb80fb0, "vmov%c.f32\t%12-15,22R, %E"},
1596
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1597
    0xf2800810, 0xfeb80db0, "vmov%c.i16\t%12-15,22R, %E"},
1598
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1599
    0xf2800830, 0xfeb80db0, "vmvn%c.i16\t%12-15,22R, %E"},
1600
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1601
    0xf2800910, 0xfeb80db0, "vorr%c.i16\t%12-15,22R, %E"},
1602
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1603
    0xf2800930, 0xfeb80db0, "vbic%c.i16\t%12-15,22R, %E"},
1604
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1605
    0xf2800c10, 0xfeb80eb0, "vmov%c.i32\t%12-15,22R, %E"},
1606
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1607
    0xf2800c30, 0xfeb80eb0, "vmvn%c.i32\t%12-15,22R, %E"},
1608
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1609
    0xf2800110, 0xfeb809b0, "vorr%c.i32\t%12-15,22R, %E"},
1610
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1611
    0xf2800130, 0xfeb809b0, "vbic%c.i32\t%12-15,22R, %E"},
1612
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1613
    0xf2800010, 0xfeb808b0, "vmov%c.i32\t%12-15,22R, %E"},
1614
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1615
    0xf2800030, 0xfeb808b0, "vmvn%c.i32\t%12-15,22R, %E"},
1616
1617
  /* Two registers and a shift amount.  */
1618
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1619
    0xf2880810, 0xffb80fd0, "vshrn%c.i16\t%12-15,22D, %0-3,5Q, %{I:#%16-18e%}"},
1620
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1621
    0xf2880850, 0xffb80fd0, "vrshrn%c.i16\t%12-15,22D, %0-3,5Q, %{I:#%16-18e%}"},
1622
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1623
    0xf2880810, 0xfeb80fd0, "vqshrun%c.s16\t%12-15,22D, %0-3,5Q, %{I:#%16-18e%}"},
1624
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1625
    0xf2880850, 0xfeb80fd0, "vqrshrun%c.s16\t%12-15,22D, %0-3,5Q, %{I:#%16-18e%}"},
1626
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1627
    0xf2880910, 0xfeb80fd0, "vqshrn%c.%24?us16\t%12-15,22D, %0-3,5Q, %{I:#%16-18e%}"},
1628
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1629
    0xf2880950, 0xfeb80fd0,
1630
    "vqrshrn%c.%24?us16\t%12-15,22D, %0-3,5Q, %{I:#%16-18e%}"},
1631
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1632
    0xf2880a10, 0xfeb80fd0, "vshll%c.%24?us8\t%12-15,22Q, %0-3,5D, %{I:#%16-18d%}"},
1633
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1634
    0xf2900810, 0xffb00fd0, "vshrn%c.i32\t%12-15,22D, %0-3,5Q, %{I:#%16-19e%}"},
1635
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1636
    0xf2900850, 0xffb00fd0, "vrshrn%c.i32\t%12-15,22D, %0-3,5Q, %{I:#%16-19e%}"},
1637
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1638
    0xf2880510, 0xffb80f90, "vshl%c.%24?us8\t%12-15,22R, %0-3,5R, %{I:#%16-18d%}"},
1639
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1640
    0xf3880410, 0xffb80f90, "vsri%c.8\t%12-15,22R, %0-3,5R, %{I:#%16-18e%}"},
1641
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1642
    0xf3880510, 0xffb80f90, "vsli%c.8\t%12-15,22R, %0-3,5R, %{I:#%16-18d%}"},
1643
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1644
    0xf3880610, 0xffb80f90, "vqshlu%c.s8\t%12-15,22R, %0-3,5R, %{I:#%16-18d%}"},
1645
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1646
    0xf2900810, 0xfeb00fd0, "vqshrun%c.s32\t%12-15,22D, %0-3,5Q, %{I:#%16-19e%}"},
1647
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1648
    0xf2900850, 0xfeb00fd0, "vqrshrun%c.s32\t%12-15,22D, %0-3,5Q, %{I:#%16-19e%}"},
1649
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1650
    0xf2900910, 0xfeb00fd0, "vqshrn%c.%24?us32\t%12-15,22D, %0-3,5Q, %{I:#%16-19e%}"},
1651
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1652
    0xf2900950, 0xfeb00fd0,
1653
    "vqrshrn%c.%24?us32\t%12-15,22D, %0-3,5Q, %{I:#%16-19e%}"},
1654
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1655
    0xf2900a10, 0xfeb00fd0, "vshll%c.%24?us16\t%12-15,22Q, %0-3,5D, %{I:#%16-19d%}"},
1656
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1657
    0xf2880010, 0xfeb80f90, "vshr%c.%24?us8\t%12-15,22R, %0-3,5R, %{I:#%16-18e%}"},
1658
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1659
    0xf2880110, 0xfeb80f90, "vsra%c.%24?us8\t%12-15,22R, %0-3,5R, %{I:#%16-18e%}"},
1660
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1661
    0xf2880210, 0xfeb80f90, "vrshr%c.%24?us8\t%12-15,22R, %0-3,5R, %{I:#%16-18e%}"},
1662
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1663
    0xf2880310, 0xfeb80f90, "vrsra%c.%24?us8\t%12-15,22R, %0-3,5R, %{I:#%16-18e%}"},
1664
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1665
    0xf2880710, 0xfeb80f90, "vqshl%c.%24?us8\t%12-15,22R, %0-3,5R, %{I:#%16-18d%}"},
1666
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1667
    0xf2a00810, 0xffa00fd0, "vshrn%c.i64\t%12-15,22D, %0-3,5Q, %{I:#%16-20e%}"},
1668
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1669
    0xf2a00850, 0xffa00fd0, "vrshrn%c.i64\t%12-15,22D, %0-3,5Q, %{I:#%16-20e%}"},
1670
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1671
    0xf2900510, 0xffb00f90, "vshl%c.%24?us16\t%12-15,22R, %0-3,5R, %{I:#%16-19d%}"},
1672
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1673
    0xf3900410, 0xffb00f90, "vsri%c.16\t%12-15,22R, %0-3,5R, %{I:#%16-19e%}"},
1674
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1675
    0xf3900510, 0xffb00f90, "vsli%c.16\t%12-15,22R, %0-3,5R, %{I:#%16-19d%}"},
1676
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1677
    0xf3900610, 0xffb00f90, "vqshlu%c.s16\t%12-15,22R, %0-3,5R, %{I:#%16-19d%}"},
1678
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1679
    0xf2a00a10, 0xfea00fd0, "vshll%c.%24?us32\t%12-15,22Q, %0-3,5D, %{I:#%16-20d%}"},
1680
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1681
    0xf2900010, 0xfeb00f90, "vshr%c.%24?us16\t%12-15,22R, %0-3,5R, %{I:#%16-19e%}"},
1682
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1683
    0xf2900110, 0xfeb00f90, "vsra%c.%24?us16\t%12-15,22R, %0-3,5R, %{I:#%16-19e%}"},
1684
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1685
    0xf2900210, 0xfeb00f90, "vrshr%c.%24?us16\t%12-15,22R, %0-3,5R, %{I:#%16-19e%}"},
1686
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1687
    0xf2900310, 0xfeb00f90, "vrsra%c.%24?us16\t%12-15,22R, %0-3,5R, %{I:#%16-19e%}"},
1688
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1689
    0xf2900710, 0xfeb00f90, "vqshl%c.%24?us16\t%12-15,22R, %0-3,5R, %{I:#%16-19d%}"},
1690
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1691
    0xf2a00810, 0xfea00fd0, "vqshrun%c.s64\t%12-15,22D, %0-3,5Q, %{I:#%16-20e%}"},
1692
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1693
    0xf2a00850, 0xfea00fd0, "vqrshrun%c.s64\t%12-15,22D, %0-3,5Q, %{I:#%16-20e%}"},
1694
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1695
    0xf2a00910, 0xfea00fd0, "vqshrn%c.%24?us64\t%12-15,22D, %0-3,5Q, %{I:#%16-20e%}"},
1696
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1697
    0xf2a00950, 0xfea00fd0,
1698
    "vqrshrn%c.%24?us64\t%12-15,22D, %0-3,5Q, %{I:#%16-20e%}"},
1699
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1700
    0xf2a00510, 0xffa00f90, "vshl%c.%24?us32\t%12-15,22R, %0-3,5R, %{I:#%16-20d%}"},
1701
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1702
    0xf3a00410, 0xffa00f90, "vsri%c.32\t%12-15,22R, %0-3,5R, %{I:#%16-20e%}"},
1703
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1704
    0xf3a00510, 0xffa00f90, "vsli%c.32\t%12-15,22R, %0-3,5R, %{I:#%16-20d%}"},
1705
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1706
    0xf3a00610, 0xffa00f90, "vqshlu%c.s32\t%12-15,22R, %0-3,5R, %{I:#%16-20d%}"},
1707
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1708
    0xf2a00010, 0xfea00f90, "vshr%c.%24?us32\t%12-15,22R, %0-3,5R, %{I:#%16-20e%}"},
1709
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1710
    0xf2a00110, 0xfea00f90, "vsra%c.%24?us32\t%12-15,22R, %0-3,5R, %{I:#%16-20e%}"},
1711
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1712
    0xf2a00210, 0xfea00f90, "vrshr%c.%24?us32\t%12-15,22R, %0-3,5R, %{I:#%16-20e%}"},
1713
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1714
    0xf2a00310, 0xfea00f90, "vrsra%c.%24?us32\t%12-15,22R, %0-3,5R, %{I:#%16-20e%}"},
1715
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1716
    0xf2a00710, 0xfea00f90, "vqshl%c.%24?us32\t%12-15,22R, %0-3,5R, %{I:#%16-20d%}"},
1717
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1718
    0xf2800590, 0xff800f90, "vshl%c.%24?us64\t%12-15,22R, %0-3,5R, %{I:#%16-21d%}"},
1719
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1720
    0xf3800490, 0xff800f90, "vsri%c.64\t%12-15,22R, %0-3,5R, %{I:#%16-21e%}"},
1721
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1722
    0xf3800590, 0xff800f90, "vsli%c.64\t%12-15,22R, %0-3,5R, %{I:#%16-21d%}"},
1723
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1724
    0xf3800690, 0xff800f90, "vqshlu%c.s64\t%12-15,22R, %0-3,5R, %{I:#%16-21d%}"},
1725
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1726
    0xf2800090, 0xfe800f90, "vshr%c.%24?us64\t%12-15,22R, %0-3,5R, %{I:#%16-21e%}"},
1727
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1728
    0xf2800190, 0xfe800f90, "vsra%c.%24?us64\t%12-15,22R, %0-3,5R, %{I:#%16-21e%}"},
1729
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1730
    0xf2800290, 0xfe800f90, "vrshr%c.%24?us64\t%12-15,22R, %0-3,5R, %{I:#%16-21e%}"},
1731
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1732
    0xf2800390, 0xfe800f90, "vrsra%c.%24?us64\t%12-15,22R, %0-3,5R, %{I:#%16-21e%}"},
1733
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1734
    0xf2800790, 0xfe800f90, "vqshl%c.%24?us64\t%12-15,22R, %0-3,5R, %{I:#%16-21d%}"},
1735
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1736
    0xf2a00e10, 0xfea00e90,
1737
    "vcvt%c.%24,8?usff32.%24,8?ffus32\t%12-15,22R, %0-3,5R, %{I:#%16-20e%}"},
1738
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST),
1739
    0xf2a00c10, 0xfea00e90,
1740
    "vcvt%c.%24,8?usff16.%24,8?ffus16\t%12-15,22R, %0-3,5R, %{I:#%16-20e%}"},
1741
1742
  /* Three registers of different lengths.  */
1743
  {ARM_FEATURE_COPROC (FPU_CRYPTO_EXT_ARMV8),
1744
    0xf2a00e00, 0xfeb00f50, "vmull%c.p64\t%12-15,22Q, %16-19,7D, %0-3,5D"},
1745
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1746
    0xf2800e00, 0xfea00f50, "vmull%c.p%20S0\t%12-15,22Q, %16-19,7D, %0-3,5D"},
1747
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1748
    0xf2800400, 0xff800f50,
1749
    "vaddhn%c.i%20-21T2\t%12-15,22D, %16-19,7Q, %0-3,5Q"},
1750
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1751
    0xf2800600, 0xff800f50,
1752
    "vsubhn%c.i%20-21T2\t%12-15,22D, %16-19,7Q, %0-3,5Q"},
1753
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1754
    0xf2800900, 0xff800f50,
1755
    "vqdmlal%c.s%20-21S6\t%12-15,22Q, %16-19,7D, %0-3,5D"},
1756
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1757
    0xf2800b00, 0xff800f50,
1758
    "vqdmlsl%c.s%20-21S6\t%12-15,22Q, %16-19,7D, %0-3,5D"},
1759
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1760
    0xf2800d00, 0xff800f50,
1761
    "vqdmull%c.s%20-21S6\t%12-15,22Q, %16-19,7D, %0-3,5D"},
1762
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1763
    0xf3800400, 0xff800f50,
1764
    "vraddhn%c.i%20-21T2\t%12-15,22D, %16-19,7Q, %0-3,5Q"},
1765
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1766
    0xf3800600, 0xff800f50,
1767
    "vrsubhn%c.i%20-21T2\t%12-15,22D, %16-19,7Q, %0-3,5Q"},
1768
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1769
    0xf2800000, 0xfe800f50,
1770
    "vaddl%c.%24?us%20-21S2\t%12-15,22Q, %16-19,7D, %0-3,5D"},
1771
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1772
    0xf2800100, 0xfe800f50,
1773
    "vaddw%c.%24?us%20-21S2\t%12-15,22Q, %16-19,7Q, %0-3,5D"},
1774
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1775
    0xf2800200, 0xfe800f50,
1776
    "vsubl%c.%24?us%20-21S2\t%12-15,22Q, %16-19,7D, %0-3,5D"},
1777
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1778
    0xf2800300, 0xfe800f50,
1779
    "vsubw%c.%24?us%20-21S2\t%12-15,22Q, %16-19,7Q, %0-3,5D"},
1780
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1781
    0xf2800500, 0xfe800f50,
1782
    "vabal%c.%24?us%20-21S2\t%12-15,22Q, %16-19,7D, %0-3,5D"},
1783
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1784
    0xf2800700, 0xfe800f50,
1785
    "vabdl%c.%24?us%20-21S2\t%12-15,22Q, %16-19,7D, %0-3,5D"},
1786
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1787
    0xf2800800, 0xfe800f50,
1788
    "vmlal%c.%24?us%20-21S2\t%12-15,22Q, %16-19,7D, %0-3,5D"},
1789
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1790
    0xf2800a00, 0xfe800f50,
1791
    "vmlsl%c.%24?us%20-21S2\t%12-15,22Q, %16-19,7D, %0-3,5D"},
1792
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1793
    0xf2800c00, 0xfe800f50,
1794
    "vmull%c.%24?us%20-21S2\t%12-15,22Q, %16-19,7D, %0-3,5D"},
1795
1796
  /* Two registers and a scalar.  */
1797
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1798
    0xf2800040, 0xff800f50, "vmla%c.i%20-21S6\t%12-15,22D, %16-19,7D, %D"},
1799
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1800
    0xf2800140, 0xff900f50, "vmla%c.f%20-21Sa\t%12-15,22D, %16-19,7D, %D"},
1801
  {ARM_FEATURE_COPROC (ARM_EXT2_FP16_INST),
1802
    0xf2900140, 0xffb00f50, "vmla%c.f16\t%12-15,22D, %16-19,7D, %D"},
1803
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1804
    0xf2800340, 0xff800f50, "vqdmlal%c.s%20-21S6\t%12-15,22Q, %16-19,7D, %D"},
1805
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1806
    0xf2800440, 0xff800f50, "vmls%c.i%20-21S6\t%12-15,22D, %16-19,7D, %D"},
1807
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1808
    0xf2800540, 0xff900f50, "vmls%c.f%20-21S6\t%12-15,22D, %16-19,7D, %D"},
1809
  {ARM_FEATURE_COPROC (ARM_EXT2_FP16_INST),
1810
    0xf2900540, 0xffb00f50, "vmls%c.f16\t%12-15,22D, %16-19,7D, %D"},
1811
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1812
    0xf2800740, 0xff800f50, "vqdmlsl%c.s%20-21S6\t%12-15,22Q, %16-19,7D, %D"},
1813
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1814
    0xf2800840, 0xff800f50, "vmul%c.i%20-21S6\t%12-15,22D, %16-19,7D, %D"},
1815
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1816
    0xf2800940, 0xff900f50, "vmul%c.f%20-21Sa\t%12-15,22D, %16-19,7D, %D"},
1817
  {ARM_FEATURE_COPROC (ARM_EXT2_FP16_INST),
1818
    0xf2900940, 0xffb00f50, "vmul%c.f16\t%12-15,22D, %16-19,7D, %D"},
1819
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1820
    0xf2800b40, 0xff800f50, "vqdmull%c.s%20-21S6\t%12-15,22Q, %16-19,7D, %D"},
1821
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1822
    0xf2800c40, 0xff800f50, "vqdmulh%c.s%20-21S6\t%12-15,22D, %16-19,7D, %D"},
1823
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1824
    0xf2800d40, 0xff800f50, "vqrdmulh%c.s%20-21S6\t%12-15,22D, %16-19,7D, %D"},
1825
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1826
    0xf3800040, 0xff800f50, "vmla%c.i%20-21S6\t%12-15,22Q, %16-19,7Q, %D"},
1827
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1828
    0xf3800140, 0xff900f50, "vmla%c.f%20-21Sa\t%12-15,22Q, %16-19,7Q, %D"},
1829
  {ARM_FEATURE_COPROC (ARM_EXT2_FP16_INST),
1830
    0xf3900140, 0xffb00f50, "vmla%c.f16\t%12-15,22Q, %16-19,7Q, %D"},
1831
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1832
    0xf3800440, 0xff800f50, "vmls%c.i%20-21S6\t%12-15,22Q, %16-19,7Q, %D"},
1833
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1834
    0xf3800540, 0xff900f50, "vmls%c.f%20-21Sa\t%12-15,22Q, %16-19,7Q, %D"},
1835
  {ARM_FEATURE_COPROC (ARM_EXT2_FP16_INST),
1836
    0xf3900540, 0xffb00f50, "vmls%c.f16\t%12-15,22Q, %16-19,7Q, %D"},
1837
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1838
    0xf3800840, 0xff800f50, "vmul%c.i%20-21S6\t%12-15,22Q, %16-19,7Q, %D"},
1839
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1840
    0xf3800940, 0xff900f50, "vmul%c.f%20-21Sa\t%12-15,22Q, %16-19,7Q, %D"},
1841
  {ARM_FEATURE_COPROC (ARM_EXT2_FP16_INST),
1842
    0xf3900940, 0xffb00f50, "vmul%c.f16\t%12-15,22Q, %16-19,7Q, %D"},
1843
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1844
    0xf3800c40, 0xff800f50, "vqdmulh%c.s%20-21S6\t%12-15,22Q, %16-19,7Q, %D"},
1845
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1846
    0xf3800d40, 0xff800f50, "vqrdmulh%c.s%20-21S6\t%12-15,22Q, %16-19,7Q, %D"},
1847
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1848
    0xf2800240, 0xfe800f50,
1849
    "vmlal%c.%24?us%20-21S6\t%12-15,22Q, %16-19,7D, %D"},
1850
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1851
    0xf2800640, 0xfe800f50,
1852
    "vmlsl%c.%24?us%20-21S6\t%12-15,22Q, %16-19,7D, %D"},
1853
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1854
    0xf2800a40, 0xfe800f50,
1855
    "vmull%c.%24?us%20-21S6\t%12-15,22Q, %16-19,7D, %D"},
1856
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_RDMA),
1857
    0xf2800e40, 0xff800f50,
1858
   "vqrdmlah%c.s%20-21S6\t%12-15,22D, %16-19,7D, %D"},
1859
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_RDMA),
1860
    0xf2800f40, 0xff800f50,
1861
   "vqrdmlsh%c.s%20-21S6\t%12-15,22D, %16-19,7D, %D"},
1862
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_RDMA),
1863
    0xf3800e40, 0xff800f50,
1864
   "vqrdmlah%c.s%20-21S6\t%12-15,22Q, %16-19,7Q, %D"},
1865
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_RDMA),
1866
    0xf3800f40, 0xff800f50,
1867
   "vqrdmlsh%c.s%20-21S6\t%12-15,22Q, %16-19,7Q, %D"
1868
  },
1869
1870
  /* Element and structure load/store.  */
1871
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1872
    0xf4a00fc0, 0xffb00fc0, "vld4%c.32\t%C"},
1873
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1874
    0xf4a00c00, 0xffb00f00, "vld1%c.%6-7S2\t%C"},
1875
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1876
    0xf4a00d00, 0xffb00f00, "vld2%c.%6-7S2\t%C"},
1877
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1878
    0xf4a00e00, 0xffb00f00, "vld3%c.%6-7S2\t%C"},
1879
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1880
    0xf4a00f00, 0xffb00f00, "vld4%c.%6-7S2\t%C"},
1881
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1882
    0xf4000200, 0xff900f00, "v%21?ls%21?dt1%c.%6-7S3\t%A"},
1883
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1884
    0xf4000300, 0xff900f00, "v%21?ls%21?dt2%c.%6-7S2\t%A"},
1885
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1886
    0xf4000400, 0xff900f00, "v%21?ls%21?dt3%c.%6-7S2\t%A"},
1887
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1888
    0xf4000500, 0xff900f00, "v%21?ls%21?dt3%c.%6-7S2\t%A"},
1889
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1890
    0xf4000600, 0xff900f00, "v%21?ls%21?dt1%c.%6-7S3\t%A"},
1891
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1892
    0xf4000700, 0xff900f00, "v%21?ls%21?dt1%c.%6-7S3\t%A"},
1893
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1894
    0xf4000800, 0xff900f00, "v%21?ls%21?dt2%c.%6-7S2\t%A"},
1895
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1896
    0xf4000900, 0xff900f00, "v%21?ls%21?dt2%c.%6-7S2\t%A"},
1897
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1898
    0xf4000a00, 0xff900f00, "v%21?ls%21?dt1%c.%6-7S3\t%A"},
1899
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1900
    0xf4000000, 0xff900e00, "v%21?ls%21?dt4%c.%6-7S2\t%A"},
1901
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1902
    0xf4800000, 0xff900300, "v%21?ls%21?dt1%c.%10-11S2\t%B"},
1903
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1904
    0xf4800100, 0xff900300, "v%21?ls%21?dt2%c.%10-11S2\t%B"},
1905
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1906
    0xf4800200, 0xff900300, "v%21?ls%21?dt3%c.%10-11S2\t%B"},
1907
  {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1908
    0xf4800300, 0xff900300, "v%21?ls%21?dt4%c.%10-11S2\t%B"},
1909
1910
  {ARM_FEATURE_CORE_LOW (0), 0 ,0, 0}
1911
};
1912
1913
/* mve opcode table.  */
1914
1915
/* print_insn_mve recognizes the following format control codes:
1916
1917
   %%     %
1918
1919
   %a     print '+' or '-' or imm offset in vldr[bhwd] and
1920
      vstr[bhwd]
1921
   %c     print condition code
1922
   %d     print addr mode of MVE vldr[bhw] and vstr[bhw]
1923
   %u     print 'U' (unsigned) or 'S' for various mve instructions
1924
   %i     print MVE predicate(s) for vpt and vpst
1925
   %j     print a 5-bit immediate from hw2[14:12,7:6]
1926
   %k     print 48 if the 7th position bit is set else print 64.
1927
   %m     print rounding mode for vcvt and vrint
1928
   %n     print vector comparison code for predicated instruction
1929
   %s     print size for various vcvt instructions
1930
   %v     print vector predicate for instruction in predicated
1931
      block
1932
   %o     print offset scaled for vldr[hwd] and vstr[hwd]
1933
   %w     print writeback mode for MVE v{st,ld}[24]
1934
   %B     print v{st,ld}[24] any one operands
1935
   %E     print vmov, vmvn, vorr, vbic encoded constant
1936
   %N     print generic index for vmov
1937
   %T     print bottom ('b') or top ('t') of source register
1938
   %X     print exchange field in vmla* instructions
1939
1940
   %<bitfield>r   print as an ARM register
1941
   %<bitfield>d   print the bitfield in decimal
1942
   %<bitfield>A   print accumulate or not
1943
   %<bitfield>c   print bitfield as a condition code
1944
   %<bitfield>C   print bitfield as an inverted condition code
1945
   %<bitfield>Q   print as a MVE Q register
1946
   %<bitfield>F   print as a MVE S register
1947
   %<bitfield>Z   as %<>r but r15 is ZR instead of PC and r13 is
1948
      UNPREDICTABLE
1949
1950
   %<bitfield>S   as %<>r but r15 or r13 is UNPREDICTABLE
1951
   %<bitfield>s   print size for vector predicate & non VMOV instructions
1952
   %<bitfield>I   print carry flag or not
1953
   %<bitfield>i   print immediate for vstr/vldr reg +/- imm
1954
   %<bitfield>h   print high half of 64-bit destination reg
1955
   %<bitfield>k   print immediate for vector conversion instruction
1956
   %<bitfield>l   print low half of 64-bit destination reg
1957
   %<bitfield>o   print rotate value for vcmul
1958
   %<bitfield>u   print immediate value for vddup/vdwdup
1959
   %<bitfield>x   print the bitfield in hex.
1960
  */
1961
1962
static const struct mopcode32 mve_opcodes[] =
1963
{
1964
  /* MVE.  */
1965
1966
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
1967
   MVE_VPST,
1968
   0xfe310f4d, 0xffbf1fff,
1969
   "vpst%i"
1970
  },
1971
1972
  /* Floating point VPT T1.  */
1973
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE_FP),
1974
   MVE_VPT_FP_T1,
1975
   0xee310f00, 0xefb10f50,
1976
   "vpt%i.f%28s\t%n, %17-19Q, %1-3,5Q"},
1977
  /* Floating point VPT T2.  */
1978
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE_FP),
1979
   MVE_VPT_FP_T2,
1980
   0xee310f40, 0xefb10f50,
1981
   "vpt%i.f%28s\t%n, %17-19Q, %0-3Z"},
1982
1983
  /* Vector VPT T1.  */
1984
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
1985
   MVE_VPT_VEC_T1,
1986
   0xfe010f00, 0xff811f51,
1987
   "vpt%i.i%20-21s\t%n, %17-19Q, %1-3,5Q"},
1988
  /* Vector VPT T2.  */
1989
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
1990
   MVE_VPT_VEC_T2,
1991
   0xfe010f01, 0xff811f51,
1992
   "vpt%i.u%20-21s\t%n, %17-19Q, %1-3,5Q"},
1993
  /* Vector VPT T3.  */
1994
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
1995
   MVE_VPT_VEC_T3,
1996
   0xfe011f00, 0xff811f50,
1997
   "vpt%i.s%20-21s\t%n, %17-19Q, %1-3,5Q"},
1998
  /* Vector VPT T4.  */
1999
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
2000
   MVE_VPT_VEC_T4,
2001
   0xfe010f40, 0xff811f70,
2002
   "vpt%i.i%20-21s\t%n, %17-19Q, %0-3Z"},
2003
  /* Vector VPT T5.  */
2004
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
2005
   MVE_VPT_VEC_T5,
2006
   0xfe010f60, 0xff811f70,
2007
   "vpt%i.u%20-21s\t%n, %17-19Q, %0-3Z"},
2008
  /* Vector VPT T6.  */
2009
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
2010
   MVE_VPT_VEC_T6,
2011
   0xfe011f40, 0xff811f50,
2012
   "vpt%i.s%20-21s\t%n, %17-19Q, %0-3Z"},
2013
2014
  /* Vector VBIC immediate.  */
2015
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
2016
   MVE_VBIC_IMM,
2017
   0xef800070, 0xefb81070,
2018
   "vbic%v.i%8-11s\t%13-15,22Q, %E"},
2019
2020
  /* Vector VBIC register.  */
2021
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
2022
   MVE_VBIC_REG,
2023
   0xef100150, 0xffb11f51,
2024
   "vbic%v\t%13-15,22Q, %17-19,7Q, %1-3,5Q"},
2025
2026
  /* Vector VABAV.  */
2027
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
2028
   MVE_VABAV,
2029
   0xee800f01, 0xefc10f51,
2030
   "vabav%v.%u%20-21s\t%12-15r, %17-19,7Q, %1-3,5Q"},
2031
2032
  /* Vector VABD floating point.  */
2033
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE_FP),
2034
   MVE_VABD_FP,
2035
   0xff200d40, 0xffa11f51,
2036
   "vabd%v.f%20s\t%13-15,22Q, %17-19,7Q, %1-3,5Q"},
2037
2038
  /* Vector VABD.  */
2039
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
2040
   MVE_VABD_VEC,
2041
   0xef000740, 0xef811f51,
2042
   "vabd%v.%u%20-21s\t%13-15,22Q, %17-19,7Q, %1-3,5Q"},
2043
2044
  /* Vector VABS floating point.  */
2045
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE_FP),
2046
   MVE_VABS_FP,
2047
   0xFFB10740, 0xFFB31FD1,
2048
   "vabs%v.f%18-19s\t%13-15,22Q, %1-3,5Q"},
2049
  /* Vector VABS.  */
2050
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
2051
   MVE_VABS_VEC,
2052
   0xffb10340, 0xffb31fd1,
2053
   "vabs%v.s%18-19s\t%13-15,22Q, %1-3,5Q"},
2054
2055
  /* Vector VADD floating point T1.  */
2056
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE_FP),
2057
   MVE_VADD_FP_T1,
2058
   0xef000d40, 0xffa11f51,
2059
   "vadd%v.f%20s\t%13-15,22Q, %17-19,7Q, %1-3,5Q"},
2060
  /* Vector VADD floating point T2.  */
2061
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE_FP),
2062
   MVE_VADD_FP_T2,
2063
   0xee300f40, 0xefb11f70,
2064
   "vadd%v.f%28s\t%13-15,22Q, %17-19,7Q, %0-3r"},
2065
  /* Vector VADD T1.  */
2066
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
2067
   MVE_VADD_VEC_T1,
2068
   0xef000840, 0xff811f51,
2069
   "vadd%v.i%20-21s\t%13-15,22Q, %17-19,7Q, %1-3,5Q"},
2070
  /* Vector VADD T2.  */
2071
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
2072
   MVE_VADD_VEC_T2,
2073
   0xee010f40, 0xff811f70,
2074
   "vadd%v.i%20-21s\t%13-15,22Q, %17-19,7Q, %0-3r"},
2075
2076
  /* Vector VADDLV.  */
2077
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
2078
   MVE_VADDLV,
2079
   0xee890f00, 0xef8f1fd1,
2080
   "vaddlv%5A%v.%u32\t%13-15l, %20-22h, %1-3Q"},
2081
2082
  /* Vector VADDV.  */
2083
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
2084
   MVE_VADDV,
2085
   0xeef10f00, 0xeff31fd1,
2086
   "vaddv%5A%v.%u%18-19s\t%13-15l, %1-3Q"},
2087
2088
  /* Vector VADC.  */
2089
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
2090
   MVE_VADC,
2091
   0xee300f00, 0xffb10f51,
2092
   "vadc%12I%v.i32\t%13-15,22Q, %17-19,7Q, %1-3,5Q"},
2093
2094
  /* Vector VAND.  */
2095
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
2096
   MVE_VAND,
2097
   0xef000150, 0xffb11f51,
2098
   "vand%v\t%13-15,22Q, %17-19,7Q, %1-3,5Q"},
2099
2100
  /* Vector VBRSR register.  */
2101
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
2102
   MVE_VBRSR,
2103
   0xfe011e60, 0xff811f70,
2104
   "vbrsr%v.%20-21s\t%13-15,22Q, %17-19,7Q, %0-3r"},
2105
2106
  /* Vector VCADD floating point.  */
2107
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE_FP),
2108
   MVE_VCADD_FP,
2109
   0xfc800840, 0xfea11f51,
2110
   "vcadd%v.f%20s\t%13-15,22Q, %17-19,7Q, %1-3,5Q, %{I:#%24o%}"},
2111
2112
  /* Vector VCADD.  */
2113
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
2114
   MVE_VCADD_VEC,
2115
   0xfe000f00, 0xff810f51,
2116
   "vcadd%v.i%20-21s\t%13-15,22Q, %17-19,7Q, %1-3,5Q, %{I:#%12o%}"},
2117
2118
  /* Vector VCLS.  */
2119
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
2120
   MVE_VCLS,
2121
   0xffb00440, 0xffb31fd1,
2122
   "vcls%v.s%18-19s\t%13-15,22Q, %1-3,5Q"},
2123
2124
  /* Vector VCLZ.  */
2125
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
2126
   MVE_VCLZ,
2127
   0xffb004c0, 0xffb31fd1,
2128
   "vclz%v.i%18-19s\t%13-15,22Q, %1-3,5Q"},
2129
2130
  /* Vector VCMLA.  */
2131
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE_FP),
2132
   MVE_VCMLA_FP,
2133
   0xfc200840, 0xfe211f51,
2134
   "vcmla%v.f%20s\t%13-15,22Q, %17-19,7Q, %1-3,5Q, %{I:#%23-24o%}"},
2135
2136
  /* Vector VCMP floating point T1.  */
2137
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE_FP),
2138
   MVE_VCMP_FP_T1,
2139
   0xee310f00, 0xeff1ef50,
2140
   "vcmp%v.f%28s\t%n, %17-19Q, %1-3,5Q"},
2141
2142
  /* Vector VCMP floating point T2.  */
2143
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE_FP),
2144
   MVE_VCMP_FP_T2,
2145
   0xee310f40, 0xeff1ef50,
2146
   "vcmp%v.f%28s\t%n, %17-19Q, %0-3Z"},
2147
2148
  /* Vector VCMP T1.  */
2149
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
2150
   MVE_VCMP_VEC_T1,
2151
   0xfe010f00, 0xffc1ff51,
2152
   "vcmp%v.i%20-21s\t%n, %17-19Q, %1-3,5Q"},
2153
  /* Vector VCMP T2.  */
2154
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
2155
   MVE_VCMP_VEC_T2,
2156
   0xfe010f01, 0xffc1ff51,
2157
   "vcmp%v.u%20-21s\t%n, %17-19Q, %1-3,5Q"},
2158
  /* Vector VCMP T3.  */
2159
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
2160
   MVE_VCMP_VEC_T3,
2161
   0xfe011f00, 0xffc1ff50,
2162
   "vcmp%v.s%20-21s\t%n, %17-19Q, %1-3,5Q"},
2163
  /* Vector VCMP T4.  */
2164
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
2165
   MVE_VCMP_VEC_T4,
2166
   0xfe010f40, 0xffc1ff70,
2167
   "vcmp%v.i%20-21s\t%n, %17-19Q, %0-3Z"},
2168
  /* Vector VCMP T5.  */
2169
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
2170
   MVE_VCMP_VEC_T5,
2171
   0xfe010f60, 0xffc1ff70,
2172
   "vcmp%v.u%20-21s\t%n, %17-19Q, %0-3Z"},
2173
  /* Vector VCMP T6.  */
2174
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
2175
   MVE_VCMP_VEC_T6,
2176
   0xfe011f40, 0xffc1ff50,
2177
   "vcmp%v.s%20-21s\t%n, %17-19Q, %0-3Z"},
2178
2179
  /* Vector VDUP.  */
2180
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
2181
   MVE_VDUP,
2182
   0xeea00b10, 0xffb10f5f,
2183
   "vdup%v.%5,22s\t%17-19,7Q, %12-15r"},
2184
2185
  /* Vector VEOR.  */
2186
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
2187
   MVE_VEOR,
2188
   0xff000150, 0xffd11f51,
2189
   "veor%v\t%13-15,22Q, %17-19,7Q, %1-3,5Q"},
2190
2191
  /* Vector VFMA, vector * scalar.  */
2192
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE_FP),
2193
   MVE_VFMA_FP_SCALAR,
2194
   0xee310e40, 0xefb11f70,
2195
   "vfma%v.f%28s\t%13-15,22Q, %17-19,7Q, %0-3r"},
2196
2197
  /* Vector VFMA floating point.  */
2198
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE_FP),
2199
   MVE_VFMA_FP,
2200
   0xef000c50, 0xffa11f51,
2201
   "vfma%v.f%20s\t%13-15,22Q, %17-19,7Q, %1-3,5Q"},
2202
2203
  /* Vector VFMS floating point.  */
2204
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE_FP),
2205
   MVE_VFMS_FP,
2206
   0xef200c50, 0xffa11f51,
2207
   "vfms%v.f%20s\t%13-15,22Q, %17-19,7Q, %1-3,5Q"},
2208
2209
  /* Vector VFMAS, vector * scalar.  */
2210
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE_FP),
2211
   MVE_VFMAS_FP_SCALAR,
2212
   0xee311e40, 0xefb11f70,
2213
   "vfmas%v.f%28s\t%13-15,22Q, %17-19,7Q, %0-3r"},
2214
2215
  /* Vector VHADD T1.  */
2216
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
2217
   MVE_VHADD_T1,
2218
   0xef000040, 0xef811f51,
2219
   "vhadd%v.%u%20-21s\t%13-15,22Q, %17-19,7Q, %1-3,5Q"},
2220
2221
  /* Vector VHADD T2.  */
2222
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
2223
   MVE_VHADD_T2,
2224
   0xee000f40, 0xef811f70,
2225
   "vhadd%v.%u%20-21s\t%13-15,22Q, %17-19,7Q, %0-3r"},
2226
2227
  /* Vector VHSUB T1.  */
2228
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
2229
   MVE_VHSUB_T1,
2230
   0xef000240, 0xef811f51,
2231
   "vhsub%v.%u%20-21s\t%13-15,22Q, %17-19,7Q, %1-3,5Q"},
2232
2233
  /* Vector VHSUB T2.  */
2234
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
2235
   MVE_VHSUB_T2,
2236
   0xee001f40, 0xef811f70,
2237
   "vhsub%v.%u%20-21s\t%13-15,22Q, %17-19,7Q, %0-3r"},
2238
2239
  /* Vector VCMUL.  */
2240
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE_FP),
2241
   MVE_VCMUL_FP,
2242
   0xee300e00, 0xefb10f50,
2243
   "vcmul%v.f%28s\t%13-15,22Q, %17-19,7Q, %1-3,5Q, %{I:#%0,12o%}"},
2244
2245
   /* Vector VCTP.  */
2246
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
2247
   MVE_VCTP,
2248
   0xf000e801, 0xffc0ffff,
2249
   "vctp%v.%20-21s\t%16-19r"},
2250
2251
  /* Vector VDUP.  */
2252
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
2253
   MVE_VDUP,
2254
   0xeea00b10, 0xffb10f5f,
2255
   "vdup%v.%5,22s\t%17-19,7Q, %12-15r"},
2256
2257
  /* Vector VRHADD.  */
2258
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
2259
   MVE_VRHADD,
2260
   0xef000140, 0xef811f51,
2261
   "vrhadd%v.%u%20-21s\t%13-15,22Q, %17-19,7Q, %1-3,5Q"},
2262
2263
  /* Vector VCVT.  */
2264
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE_FP),
2265
   MVE_VCVT_FP_FIX_VEC,
2266
   0xef800c50, 0xef801cd1,
2267
   "vcvt%v.%s\t%13-15,22Q, %1-3,5Q, %{I:#%16-21k%}"},
2268
2269
  /* Vector VCVT.  */
2270
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE_FP),
2271
   MVE_VCVT_BETWEEN_FP_INT,
2272
   0xffb30640, 0xffb31e51,
2273
   "vcvt%v.%s\t%13-15,22Q, %1-3,5Q"},
2274
2275
  /* Vector VCVT between single and half-precision float, bottom half.  */
2276
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE_FP),
2277
   MVE_VCVT_FP_HALF_FP,
2278
   0xee3f0e01, 0xefbf1fd1,
2279
   "vcvtb%v.%s\t%13-15,22Q, %1-3,5Q"},
2280
2281
  /* Vector VCVT between single and half-precision float, top half.  */
2282
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE_FP),
2283
   MVE_VCVT_FP_HALF_FP,
2284
   0xee3f1e01, 0xefbf1fd1,
2285
   "vcvtt%v.%s\t%13-15,22Q, %1-3,5Q"},
2286
2287
  /* Vector VCVT.  */
2288
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE_FP),
2289
   MVE_VCVT_FROM_FP_TO_INT,
2290
   0xffb30040, 0xffb31c51,
2291
   "vcvt%m%v.%s\t%13-15,22Q, %1-3,5Q"},
2292
2293
  /* Vector VDDUP.  */
2294
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
2295
   MVE_VDDUP,
2296
   0xee011f6e, 0xff811f7e,
2297
   "vddup%v.u%20-21s\t%13-15,22Q, %17-19l, %{I:#%0,7u%}"},
2298
2299
  /* Vector VDWDUP.  */
2300
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
2301
   MVE_VDWDUP,
2302
   0xee011f60, 0xff811f70,
2303
   "vdwdup%v.u%20-21s\t%13-15,22Q, %17-19l, %1-3h, %{I:#%0,7u%}"},
2304
2305
  /* Vector VHCADD.  */
2306
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
2307
   MVE_VHCADD,
2308
   0xee000f00, 0xff810f51,
2309
   "vhcadd%v.s%20-21s\t%13-15,22Q, %17-19,7Q, %1-3,5Q, %{I:#%12o%}"},
2310
2311
  /* Vector VIWDUP.  */
2312
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
2313
   MVE_VIWDUP,
2314
   0xee010f60, 0xff811f70,
2315
   "viwdup%v.u%20-21s\t%13-15,22Q, %17-19l, %1-3h, %{I:#%0,7u%}"},
2316
2317
  /* Vector VIDUP.  */
2318
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
2319
   MVE_VIDUP,
2320
   0xee010f6e, 0xff811f7e,
2321
   "vidup%v.u%20-21s\t%13-15,22Q, %17-19l, %{I:#%0,7u%}"},
2322
2323
  /* Vector VLD2.  */
2324
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
2325
   MVE_VLD2,
2326
   0xfc901e00, 0xff901e5f,
2327
   "vld2%5d.%7-8s\t%B, [%16-19r]%w"},
2328
2329
  /* Vector VLD4.  */
2330
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
2331
   MVE_VLD4,
2332
   0xfc901e01, 0xff901e1f,
2333
   "vld4%5-6d.%7-8s\t%B, [%16-19r]%w"},
2334
2335
  /* Vector VLDRB gather load.  */
2336
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
2337
   MVE_VLDRB_GATHER_T1,
2338
   0xec900e00, 0xefb01e50,
2339
   "vldrb%v.%u%7-8s\t%13-15,22Q, [%16-19r, %1-3,5Q]"},
2340
2341
  /* Vector VLDRH gather load.  */
2342
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
2343
   MVE_VLDRH_GATHER_T2,
2344
   0xec900e10, 0xefb01e50,
2345
   "vldrh%v.%u%7-8s\t%13-15,22Q, [%16-19r, %1-3,5Q%o]"},
2346
2347
  /* Vector VLDRW gather load.  */
2348
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
2349
   MVE_VLDRW_GATHER_T3,
2350
   0xfc900f40, 0xffb01fd0,
2351
   "vldrw%v.u32\t%13-15,22Q, [%16-19r, %1-3,5Q%o]"},
2352
2353
  /* Vector VLDRD gather load.  */
2354
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
2355
   MVE_VLDRD_GATHER_T4,
2356
   0xec900fd0, 0xefb01fd0,
2357
   "vldrd%v.u64\t%13-15,22Q, [%16-19r, %1-3,5Q%o]"},
2358
2359
  /* Vector VLDRW gather load.  */
2360
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
2361
   MVE_VLDRW_GATHER_T5,
2362
   0xfd101e00, 0xff111f00,
2363
   "vldrw%v.u32\t%13-15,22Q, [%17-19,7Q, %{I:#%a%0-6i%}]%w"},
2364
2365
  /* Vector VLDRD gather load, variant T6.  */
2366
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
2367
   MVE_VLDRD_GATHER_T6,
2368
   0xfd101f00, 0xff111f00,
2369
   "vldrd%v.u64\t%13-15,22Q, [%17-19,7Q, %{I:#%a%0-6i%}]%w"},
2370
2371
  /* Vector VLDRB.  */
2372
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
2373
   MVE_VLDRB_T1,
2374
   0xec100e00, 0xee581e00,
2375
   "vldrb%v.%u%7-8s\t%13-15Q, %d"},
2376
2377
  /* Vector VLDRH.  */
2378
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
2379
   MVE_VLDRH_T2,
2380
   0xec180e00, 0xee581e00,
2381
   "vldrh%v.%u%7-8s\t%13-15Q, %d"},
2382
2383
  /* Vector VLDRB unsigned, variant T5.  */
2384
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
2385
   MVE_VLDRB_T5,
2386
   0xec101e00, 0xfe101f80,
2387
   "vldrb%v.u8\t%13-15,22Q, %d"},
2388
2389
  /* Vector VLDRH unsigned, variant T6.  */
2390
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
2391
   MVE_VLDRH_T6,
2392
   0xec101e80, 0xfe101f80,
2393
   "vldrh%v.u16\t%13-15,22Q, %d"},
2394
2395
  /* Vector VLDRW unsigned, variant T7.  */
2396
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
2397
   MVE_VLDRW_T7,
2398
   0xec101f00, 0xfe101f80,
2399
   "vldrw%v.u32\t%13-15,22Q, %d"},
2400
2401
  /* Vector VMAX.  */
2402
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
2403
   MVE_VMAX,
2404
   0xef000640, 0xef811f51,
2405
   "vmax%v.%u%20-21s\t%13-15,22Q, %17-19,7Q, %1-3,5Q"},
2406
2407
  /* Vector VMAXA.  */
2408
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
2409
   MVE_VMAXA,
2410
   0xee330e81, 0xffb31fd1,
2411
   "vmaxa%v.s%18-19s\t%13-15,22Q, %1-3,5Q"},
2412
2413
  /* Vector VMAXNM floating point.  */
2414
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE_FP),
2415
   MVE_VMAXNM_FP,
2416
   0xff000f50, 0xffa11f51,
2417
   "vmaxnm%v.f%20s\t%13-15,22Q, %17-19,7Q, %1-3,5Q"},
2418
2419
  /* Vector VMAXNMA floating point.  */
2420
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE_FP),
2421
   MVE_VMAXNMA_FP,
2422
   0xee3f0e81, 0xefbf1fd1,
2423
   "vmaxnma%v.f%28s\t%13-15,22Q, %1-3,5Q"},
2424
2425
  /* Vector VMAXNMV floating point.  */
2426
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE_FP),
2427
   MVE_VMAXNMV_FP,
2428
   0xeeee0f00, 0xefff0fd1,
2429
   "vmaxnmv%v.f%28s\t%12-15r, %1-3,5Q"},
2430
2431
  /* Vector VMAXNMAV floating point.  */
2432
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE_FP),
2433
   MVE_VMAXNMAV_FP,
2434
   0xeeec0f00, 0xefff0fd1,
2435
   "vmaxnmav%v.f%28s\t%12-15r, %1-3,5Q"},
2436
2437
  /* Vector VMAXV.  */
2438
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
2439
   MVE_VMAXV,
2440
   0xeee20f00, 0xeff30fd1,
2441
   "vmaxv%v.%u%18-19s\t%12-15r, %1-3,5Q"},
2442
2443
  /* Vector VMAXAV.  */
2444
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
2445
   MVE_VMAXAV,
2446
   0xeee00f00, 0xfff30fd1,
2447
   "vmaxav%v.s%18-19s\t%12-15r, %1-3,5Q"},
2448
2449
  /* Vector VMIN.  */
2450
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
2451
   MVE_VMIN,
2452
   0xef000650, 0xef811f51,
2453
   "vmin%v.%u%20-21s\t%13-15,22Q, %17-19,7Q, %1-3,5Q"},
2454
2455
  /* Vector VMINA.  */
2456
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
2457
   MVE_VMINA,
2458
   0xee331e81, 0xffb31fd1,
2459
   "vmina%v.s%18-19s\t%13-15,22Q, %1-3,5Q"},
2460
2461
  /* Vector VMINNM floating point.  */
2462
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE_FP),
2463
   MVE_VMINNM_FP,
2464
   0xff200f50, 0xffa11f51,
2465
   "vminnm%v.f%20s\t%13-15,22Q, %17-19,7Q, %1-3,5Q"},
2466
2467
  /* Vector VMINNMA floating point.  */
2468
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE_FP),
2469
   MVE_VMINNMA_FP,
2470
   0xee3f1e81, 0xefbf1fd1,
2471
   "vminnma%v.f%28s\t%13-15,22Q, %1-3,5Q"},
2472
2473
  /* Vector VMINNMV floating point.  */
2474
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE_FP),
2475
   MVE_VMINNMV_FP,
2476
   0xeeee0f80, 0xefff0fd1,
2477
   "vminnmv%v.f%28s\t%12-15r, %1-3,5Q"},
2478
2479
  /* Vector VMINNMAV floating point.  */
2480
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE_FP),
2481
   MVE_VMINNMAV_FP,
2482
   0xeeec0f80, 0xefff0fd1,
2483
   "vminnmav%v.f%28s\t%12-15r, %1-3,5Q"},
2484
2485
  /* Vector VMINV.  */
2486
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
2487
   MVE_VMINV,
2488
   0xeee20f80, 0xeff30fd1,
2489
   "vminv%v.%u%18-19s\t%12-15r, %1-3,5Q"},
2490
2491
  /* Vector VMINAV.  */
2492
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
2493
   MVE_VMINAV,
2494
   0xeee00f80, 0xfff30fd1,
2495
   "vminav%v.s%18-19s\t%12-15r, %1-3,5Q"},
2496
2497
  /* Vector VMLA.  */
2498
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
2499
   MVE_VMLA,
2500
   0xee010e40, 0xef811f70,
2501
   "vmla%v.i%20-21s\t%13-15,22Q, %17-19,7Q, %0-3r"},
2502
2503
  /* Vector VMLALDAV.  Note must appear before VMLADAV due to instruction
2504
     opcode aliasing.  */
2505
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
2506
   MVE_VMLALDAV,
2507
   0xee801e00, 0xef801f51,
2508
   "vmlaldav%5Ax%v.%u%16s\t%13-15l, %20-22h, %17-19,7Q, %1-3Q"},
2509
2510
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
2511
   MVE_VMLALDAV,
2512
   0xee800e00, 0xef801f51,
2513
   "vmlalv%5A%v.%u%16s\t%13-15l, %20-22h, %17-19,7Q, %1-3Q"},
2514
2515
  /* Vector VMLAV T1 variant, same as VMLADAV but with X == 0.  */
2516
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
2517
   MVE_VMLADAV_T1,
2518
   0xeef00e00, 0xeff01f51,
2519
   "vmlav%5A%v.%u%16s\t%13-15l, %17-19,7Q, %1-3Q"},
2520
2521
  /* Vector VMLAV T2 variant, same as VMLADAV but with X == 0.  */
2522
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
2523
   MVE_VMLADAV_T2,
2524
   0xeef00f00, 0xeff11f51,
2525
   "vmlav%5A%v.%u8\t%13-15l, %17-19,7Q, %1-3Q"},
2526
2527
  /* Vector VMLADAV T1 variant.  */
2528
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
2529
   MVE_VMLADAV_T1,
2530
   0xeef01e00, 0xeff01f51,
2531
   "vmladav%5Ax%v.%u%16s\t%13-15l, %17-19,7Q, %1-3Q"},
2532
2533
  /* Vector VMLADAV T2 variant.  */
2534
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
2535
   MVE_VMLADAV_T2,
2536
   0xeef01f00, 0xeff11f51,
2537
   "vmladav%5Ax%v.%u8\t%13-15l, %17-19,7Q, %1-3Q"},
2538
2539
  /* Vector VMLAS.  */
2540
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
2541
   MVE_VMLAS,
2542
   0xee011e40, 0xef811f70,
2543
   "vmlas%v.i%20-21s\t%13-15,22Q, %17-19,7Q, %0-3r"},
2544
2545
  /* Vector VRMLSLDAVH.  Note must appear before VMLSDAV due to instruction
2546
     opcode aliasing.  */
2547
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
2548
   MVE_VRMLSLDAVH,
2549
   0xfe800e01, 0xff810f51,
2550
   "vrmlsldavh%5A%X%v.s32\t%13-15l, %20-22h, %17-19,7Q, %1-3Q"},
2551
2552
  /* Vector VMLSLDAV.  Note must appear before VMLSDAV due to instruction
2553
     opcdoe aliasing.  */
2554
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
2555
   MVE_VMLSLDAV,
2556
   0xee800e01, 0xff800f51,
2557
   "vmlsldav%5A%X%v.%u%16s\t%13-15l, %20-22h, %17-19,7Q, %1-3Q"},
2558
2559
  /* Vector VMLSDAV T1 Variant.  */
2560
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
2561
   MVE_VMLSDAV_T1,
2562
   0xeef00e01, 0xfff00f51,
2563
   "vmlsdav%5A%X%v.s%16s\t%13-15l, %17-19,7Q, %1-3Q"},
2564
2565
  /* Vector VMLSDAV T2 Variant.  */
2566
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
2567
   MVE_VMLSDAV_T2,
2568
   0xfef00e01, 0xfff10f51,
2569
   "vmlsdav%5A%X%v.s8\t%13-15l, %17-19,7Q, %1-3Q"},
2570
2571
  /* Vector VMOV between gpr and half precision register, op == 0.  */
2572
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE_FP),
2573
   MVE_VMOV_HFP_TO_GP,
2574
   0xee000910, 0xfff00f7f,
2575
   "vmov.f16\t%7,16-19F, %12-15r"},
2576
2577
  /* Vector VMOV between gpr and half precision register, op == 1.  */
2578
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE_FP),
2579
   MVE_VMOV_HFP_TO_GP,
2580
   0xee100910, 0xfff00f7f,
2581
   "vmov.f16\t%12-15r, %7,16-19F"},
2582
2583
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE_FP),
2584
   MVE_VMOV_GP_TO_VEC_LANE,
2585
   0xee000b10, 0xff900f1f,
2586
   "vmov%c.%5-6,21-22s\t%{R:%17-19,7Q[%N]%}, %12-15r"},
2587
2588
  /* Vector VORR immediate to vector.
2589
     NOTE: MVE_VORR_IMM must appear in the table
2590
     before MVE_VMOV_IMM_TO_VEC due to opcode aliasing.  */
2591
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
2592
   MVE_VORR_IMM,
2593
   0xef800050, 0xefb810f0,
2594
   "vorr%v.i%8-11s\t%13-15,22Q, %E"},
2595
2596
  /* Vector VQSHL T2 Variant.
2597
     NOTE: MVE_VQSHL_T2 must appear in the table before
2598
     before MVE_VMOV_IMM_TO_VEC due to opcode aliasing.  */
2599
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
2600
   MVE_VQSHL_T2,
2601
   0xef800750, 0xef801fd1,
2602
   "vqshl%v.%u%19-21s\t%13-15,22Q, %1-3,5Q, %{I:#%16-18d%}"},
2603
2604
  /* Vector VQSHLU T3 Variant
2605
     NOTE: MVE_VQSHL_T2 must appear in the table before
2606
     before MVE_VMOV_IMM_TO_VEC due to opcode aliasing.  */
2607
2608
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
2609
   MVE_VQSHLU_T3,
2610
   0xff800650, 0xff801fd1,
2611
   "vqshlu%v.s%19-21s\t%13-15,22Q, %1-3,5Q, %{I:#%16-18d%}"},
2612
2613
  /* Vector VRSHR
2614
     NOTE: MVE_VRSHR must appear in the table before
2615
     before MVE_VMOV_IMM_TO_VEC due to opcode aliasing.  */
2616
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
2617
   MVE_VRSHR,
2618
   0xef800250, 0xef801fd1,
2619
   "vrshr%v.%u%19-21s\t%13-15,22Q, %1-3,5Q, %{I:#%16-18d%}"},
2620
2621
  /* Vector VSHL.
2622
     NOTE: MVE_VSHL must appear in the table before
2623
     before MVE_VMOV_IMM_TO_VEC due to opcode aliasing.  */
2624
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
2625
   MVE_VSHL_T1,
2626
   0xef800550, 0xff801fd1,
2627
   "vshl%v.i%19-21s\t%13-15,22Q, %1-3,5Q, %{I:#%16-18d%}"},
2628
2629
  /* Vector VSHR
2630
     NOTE: MVE_VSHR must appear in the table before
2631
     before MVE_VMOV_IMM_TO_VEC due to opcode aliasing.  */
2632
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
2633
   MVE_VSHR,
2634
   0xef800050, 0xef801fd1,
2635
   "vshr%v.%u%19-21s\t%13-15,22Q, %1-3,5Q, %{I:#%16-18d%}"},
2636
2637
  /* Vector VSLI
2638
     NOTE: MVE_VSLI must appear in the table before
2639
     before MVE_VMOV_IMM_TO_VEC due to opcode aliasing.  */
2640
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
2641
   MVE_VSLI,
2642
   0xff800550, 0xff801fd1,
2643
   "vsli%v.%19-21s\t%13-15,22Q, %1-3,5Q, %{I:#%16-18d%}"},
2644
2645
  /* Vector VSRI
2646
     NOTE: MVE_VSRI must appear in the table before
2647
     before MVE_VMOV_IMM_TO_VEC due to opcode aliasing.  */
2648
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
2649
   MVE_VSRI,
2650
   0xff800450, 0xff801fd1,
2651
   "vsri%v.%19-21s\t%13-15,22Q, %1-3,5Q, %{I:#%16-18d%}"},
2652
2653
  /* Vector VMOV immediate to vector,
2654
     undefinded for cmode == 1111 */
2655
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
2656
   MVE_VMVN_IMM, 0xef800f70, 0xefb81ff0, UNDEFINED_INSTRUCTION},
2657
2658
  /* Vector VMOV immediate to vector,
2659
     cmode == 1101 */
2660
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
2661
   MVE_VMOV_IMM_TO_VEC, 0xef800d50, 0xefb81fd0,
2662
   "vmov%v.%5,8-11s\t%13-15,22Q, %E"},
2663
2664
  /* Vector VMOV immediate to vector.  */
2665
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
2666
   MVE_VMOV_IMM_TO_VEC,
2667
   0xef800050, 0xefb810d0,
2668
   "vmov%v.%5,8-11s\t%13-15,22Q, %E"},
2669
2670
  /* Vector VMOV two 32-bit lanes to two gprs, idx = 0.  */
2671
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
2672
   MVE_VMOV2_VEC_LANE_TO_GP,
2673
   0xec000f00, 0xffb01ff0,
2674
   "vmov%c\t%0-3r, %16-19r, %{R:%13-15,22Q[2]%}, %{R:%13-15,22Q[0]%}"},
2675
2676
  /* Vector VMOV two 32-bit lanes to two gprs, idx = 1.  */
2677
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
2678
   MVE_VMOV2_VEC_LANE_TO_GP,
2679
   0xec000f10, 0xffb01ff0,
2680
   "vmov%c\t%0-3r, %16-19r, %{R:%13-15,22Q[3]%}, %{R:%13-15,22Q[1]%}"},
2681
2682
  /* Vector VMOV Two gprs to two 32-bit lanes, idx = 0.  */
2683
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
2684
   MVE_VMOV2_GP_TO_VEC_LANE,
2685
   0xec100f00, 0xffb01ff0,
2686
   "vmov%c\t%{R:%13-15,22Q[2]%}, %{R:%13-15,22Q[0]%}, %0-3r, %16-19r"},
2687
2688
  /* Vector VMOV Two gprs to two 32-bit lanes, idx = 1.  */
2689
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
2690
   MVE_VMOV2_GP_TO_VEC_LANE,
2691
   0xec100f10, 0xffb01ff0,
2692
   "vmov%c\t%{R:%13-15,22Q[3]%}, %{R:%13-15,22Q[1]%}, %0-3r, %16-19r"},
2693
2694
  /* Vector VMOV Vector lane to gpr.  */
2695
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE_FP),
2696
   MVE_VMOV_VEC_LANE_TO_GP,
2697
   0xee100b10, 0xff100f1f,
2698
   "vmov%c.%u%5-6,21-22s\t%12-15r, %{R:%17-19,7Q[%N]%}"},
2699
2700
  /* Vector VSHLL T1 Variant.  Note: VSHLL T1 must appear before MVE_VMOVL due
2701
     to instruction opcode aliasing.  */
2702
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
2703
   MVE_VSHLL_T1,
2704
   0xeea00f40, 0xefa00fd1,
2705
   "vshll%T%v.%u%19-20s\t%13-15,22Q, %1-3,5Q, %{I:#%16-18d%}"},
2706
2707
  /* Vector VMOVL long.  */
2708
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
2709
   MVE_VMOVL,
2710
   0xeea00f40, 0xefa70fd1,
2711
   "vmovl%T%v.%u%19-20s\t%13-15,22Q, %1-3,5Q"},
2712
2713
  /* Vector VMOV and narrow.  */
2714
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
2715
   MVE_VMOVN,
2716
   0xfe310e81, 0xffb30fd1,
2717
   "vmovn%T%v.i%18-19s\t%13-15,22Q, %1-3,5Q"},
2718
2719
  /* Floating point move extract.  */
2720
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE_FP),
2721
   MVE_VMOVX,
2722
   0xfeb00a40, 0xffbf0fd0,
2723
   "vmovx.f16\t%22,12-15F, %5,0-3F"},
2724
2725
  /* Vector VMUL floating-point T1 variant.  */
2726
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE_FP),
2727
   MVE_VMUL_FP_T1,
2728
   0xff000d50, 0xffa11f51,
2729
   "vmul%v.f%20s\t%13-15,22Q, %17-19,7Q, %1-3,5Q"},
2730
2731
  /* Vector VMUL floating-point T2 variant.  */
2732
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE_FP),
2733
   MVE_VMUL_FP_T2,
2734
   0xee310e60, 0xefb11f70,
2735
   "vmul%v.f%28s\t%13-15,22Q, %17-19,7Q, %0-3r"},
2736
2737
  /* Vector VMUL T1 variant.  */
2738
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
2739
   MVE_VMUL_VEC_T1,
2740
   0xef000950, 0xff811f51,
2741
   "vmul%v.i%20-21s\t%13-15,22Q, %17-19,7Q, %1-3,5Q"},
2742
2743
  /* Vector VMUL T2 variant.  */
2744
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
2745
   MVE_VMUL_VEC_T2,
2746
   0xee011e60, 0xff811f70,
2747
   "vmul%v.i%20-21s\t%13-15,22Q, %17-19,7Q, %0-3r"},
2748
2749
  /* Vector VMULH.  */
2750
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
2751
   MVE_VMULH,
2752
   0xee010e01, 0xef811f51,
2753
   "vmulh%v.%u%20-21s\t%13-15,22Q, %17-19,7Q, %1-3,5Q"},
2754
2755
  /* Vector VRMULH.  */
2756
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
2757
   MVE_VRMULH,
2758
   0xee011e01, 0xef811f51,
2759
   "vrmulh%v.%u%20-21s\t%13-15,22Q, %17-19,7Q, %1-3,5Q"},
2760
2761
  /* Vector VMULL integer.  */
2762
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
2763
   MVE_VMULL_INT,
2764
   0xee010e00, 0xef810f51,
2765
   "vmull%T%v.%u%20-21s\t%13-15,22Q, %17-19,7Q, %1-3,5Q"},
2766
2767
  /* Vector VMULL polynomial.  */
2768
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
2769
   MVE_VMULL_POLY,
2770
   0xee310e00, 0xefb10f51,
2771
   "vmull%T%v.%28s\t%13-15,22Q, %17-19,7Q, %1-3,5Q"},
2772
2773
  /* Vector VMVN immediate to vector.  */
2774
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
2775
   MVE_VMVN_IMM,
2776
   0xef800070, 0xefb810f0,
2777
   "vmvn%v.i%8-11s\t%13-15,22Q, %E"},
2778
2779
  /* Vector VMVN register.  */
2780
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
2781
   MVE_VMVN_REG,
2782
   0xffb005c0, 0xffbf1fd1,
2783
   "vmvn%v\t%13-15,22Q, %1-3,5Q"},
2784
2785
  /* Vector VNEG floating point.  */
2786
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE_FP),
2787
   MVE_VNEG_FP,
2788
   0xffb107c0, 0xffb31fd1,
2789
   "vneg%v.f%18-19s\t%13-15,22Q, %1-3,5Q"},
2790
2791
  /* Vector VNEG.  */
2792
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
2793
   MVE_VNEG_VEC,
2794
   0xffb103c0, 0xffb31fd1,
2795
   "vneg%v.s%18-19s\t%13-15,22Q, %1-3,5Q"},
2796
2797
  /* Vector VORN, vector bitwise or not.  */
2798
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
2799
   MVE_VORN,
2800
   0xef300150, 0xffb11f51,
2801
   "vorn%v\t%13-15,22Q, %17-19,7Q, %1-3,5Q"},
2802
2803
  /* Vector VORR register.  */
2804
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
2805
   MVE_VORR_REG,
2806
   0xef200150, 0xffb11f51,
2807
   "vorr%v\t%13-15,22Q, %17-19,7Q, %1-3,5Q"},
2808
2809
  /* Vector VMOV, vector to vector move. While decoding MVE_VORR_REG if
2810
     "Qm==Qn", VORR should replaced by its alias VMOV. For that to happen
2811
     MVE_VMOV_VEC_TO_VEC need to placed after MVE_VORR_REG in this mve_opcodes
2812
     array.  */
2813
2814
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
2815
   MVE_VMOV_VEC_TO_VEC,
2816
   0xef200150, 0xffb11f51,
2817
   "vmov%v\t%13-15,22Q, %17-19,7Q"},
2818
2819
  /* Vector VQDMULL T1 variant.  */
2820
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
2821
   MVE_VQDMULL_T1,
2822
   0xee300f01, 0xefb10f51,
2823
   "vqdmull%T%v.s%28s\t%13-15,22Q, %17-19,7Q, %1-3,5Q"},
2824
2825
  /* Vector VPNOT.  */
2826
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
2827
   MVE_VPNOT,
2828
   0xfe310f4d, 0xffffffff,
2829
   "vpnot%v"},
2830
2831
  /* Vector VPSEL.  */
2832
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
2833
   MVE_VPSEL,
2834
   0xfe310f01, 0xffb11f51,
2835
   "vpsel%v\t%13-15,22Q, %17-19,7Q, %1-3,5Q"},
2836
2837
  /* Vector VQABS.  */
2838
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
2839
   MVE_VQABS,
2840
   0xffb00740, 0xffb31fd1,
2841
   "vqabs%v.s%18-19s\t%13-15,22Q, %17-19,7Q, %1-3,5Q"},
2842
2843
  /* Vector VQADD T1 variant.  */
2844
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
2845
   MVE_VQADD_T1,
2846
   0xef000050, 0xef811f51,
2847
   "vqadd%v.%u%20-21s\t%13-15,22Q, %17-19,7Q, %1-3,5Q"},
2848
2849
  /* Vector VQADD T2 variant.  */
2850
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
2851
   MVE_VQADD_T2,
2852
   0xee000f60, 0xef811f70,
2853
   "vqadd%v.%u%20-21s\t%13-15,22Q, %17-19,7Q, %0-3r"},
2854
2855
  /* Vector VQDMULL T2 variant.  */
2856
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
2857
   MVE_VQDMULL_T2,
2858
   0xee300f60, 0xefb10f70,
2859
   "vqdmull%T%v.s%28s\t%13-15,22Q, %17-19,7Q, %0-3r"},
2860
2861
  /* Vector VQMOVN.  */
2862
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
2863
   MVE_VQMOVN,
2864
   0xee330e01, 0xefb30fd1,
2865
   "vqmovn%T%v.%u%18-19s\t%13-15,22Q, %1-3,5Q"},
2866
2867
  /* Vector VQMOVUN.  */
2868
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
2869
   MVE_VQMOVUN,
2870
   0xee310e81, 0xffb30fd1,
2871
   "vqmovun%T%v.s%18-19s\t%13-15,22Q, %1-3,5Q"},
2872
2873
  /* Vector VQDMLADH.  */
2874
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
2875
   MVE_VQDMLADH,
2876
   0xee000e00, 0xff810f51,
2877
   "vqdmladh%X%v.s%20-21s\t%13-15,22Q, %17-19,7Q, %1-3,5Q"},
2878
2879
  /* Vector VQRDMLADH.  */
2880
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
2881
   MVE_VQRDMLADH,
2882
   0xee000e01, 0xff810f51,
2883
   "vqrdmladh%X%v.s%20-21s\t%13-15,22Q, %17-19,7Q, %1-3,5Q"},
2884
2885
  /* Vector VQDMLAH.  */
2886
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
2887
   MVE_VQDMLAH,
2888
   0xee000e60, 0xff811f70,
2889
   "vqdmlah%v.%u%20-21s\t%13-15,22Q, %17-19,7Q, %0-3r"},
2890
2891
  /* Vector VQRDMLAH.  */
2892
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
2893
   MVE_VQRDMLAH,
2894
   0xee000e40, 0xff811f70,
2895
   "vqrdmlah%v.%u%20-21s\t%13-15,22Q, %17-19,7Q, %0-3r"},
2896
2897
  /* Vector VQDMLASH.  */
2898
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
2899
   MVE_VQDMLASH,
2900
   0xee001e60, 0xff811f70,
2901
   "vqdmlash%v.%u%20-21s\t%13-15,22Q, %17-19,7Q, %0-3r"},
2902
2903
  /* Vector VQRDMLASH.  */
2904
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
2905
   MVE_VQRDMLASH,
2906
   0xee001e40, 0xff811f70,
2907
   "vqrdmlash%v.%u%20-21s\t%13-15,22Q, %17-19,7Q, %0-3r"},
2908
2909
  /* Vector VQDMLSDH.  */
2910
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
2911
   MVE_VQDMLSDH,
2912
   0xfe000e00, 0xff810f51,
2913
   "vqdmlsdh%X%v.s%20-21s\t%13-15,22Q, %17-19,7Q, %1-3,5Q"},
2914
2915
  /* Vector VQRDMLSDH.  */
2916
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
2917
   MVE_VQRDMLSDH,
2918
   0xfe000e01, 0xff810f51,
2919
   "vqrdmlsdh%X%v.s%20-21s\t%13-15,22Q, %17-19,7Q, %1-3,5Q"},
2920
2921
  /* Vector VQDMULH T1 variant.  */
2922
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
2923
   MVE_VQDMULH_T1,
2924
   0xef000b40, 0xff811f51,
2925
   "vqdmulh%v.s%20-21s\t%13-15,22Q, %17-19,7Q, %1-3,5Q"},
2926
2927
  /* Vector VQRDMULH T2 variant.  */
2928
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
2929
   MVE_VQRDMULH_T2,
2930
   0xff000b40, 0xff811f51,
2931
   "vqrdmulh%v.s%20-21s\t%13-15,22Q, %17-19,7Q, %1-3,5Q"},
2932
2933
  /* Vector VQDMULH T3 variant.  */
2934
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
2935
   MVE_VQDMULH_T3,
2936
   0xee010e60, 0xff811f70,
2937
   "vqdmulh%v.s%20-21s\t%13-15,22Q, %17-19,7Q, %0-3r"},
2938
2939
  /* Vector VQRDMULH T4 variant.  */
2940
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
2941
   MVE_VQRDMULH_T4,
2942
   0xfe010e60, 0xff811f70,
2943
   "vqrdmulh%v.s%20-21s\t%13-15,22Q, %17-19,7Q, %0-3r"},
2944
2945
  /* Vector VQNEG.  */
2946
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
2947
   MVE_VQNEG,
2948
   0xffb007c0, 0xffb31fd1,
2949
   "vqneg%v.s%18-19s\t%13-15,22Q, %1-3,5Q"},
2950
2951
  /* Vector VQRSHL T1 variant.  */
2952
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
2953
   MVE_VQRSHL_T1,
2954
   0xef000550, 0xef811f51,
2955
   "vqrshl%v.%u%20-21s\t%13-15,22Q, %1-3,5Q, %17-19,7Q"},
2956
2957
  /* Vector VQRSHL T2 variant.  */
2958
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
2959
   MVE_VQRSHL_T2,
2960
   0xee331ee0, 0xefb31ff0,
2961
   "vqrshl%v.%u%18-19s\t%13-15,22Q, %0-3r"},
2962
2963
  /* Vector VQRSHRN.  */
2964
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
2965
   MVE_VQRSHRN,
2966
   0xee800f41, 0xefa00fd1,
2967
   "vqrshrn%T%v.%u%19-20s\t%13-15,22Q, %1-3,5Q, %{I:#%16-18d%}"},
2968
2969
  /* Vector VQRSHRUN.  */
2970
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
2971
   MVE_VQRSHRUN,
2972
   0xfe800fc0, 0xffa00fd1,
2973
   "vqrshrun%T%v.s%19-20s\t%13-15,22Q, %1-3,5Q, %{I:#%16-18d%}"},
2974
2975
  /* Vector VQSHL T1 Variant.  */
2976
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
2977
   MVE_VQSHL_T1,
2978
   0xee311ee0, 0xefb31ff0,
2979
   "vqshl%v.%u%18-19s\t%13-15,22Q, %0-3r"},
2980
2981
  /* Vector VQSHL T4 Variant.  */
2982
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
2983
   MVE_VQSHL_T4,
2984
   0xef000450, 0xef811f51,
2985
   "vqshl%v.%u%20-21s\t%13-15,22Q, %1-3,5Q, %17-19,7Q"},
2986
2987
  /* Vector VQSHRN.  */
2988
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
2989
   MVE_VQSHRN,
2990
   0xee800f40, 0xefa00fd1,
2991
   "vqshrn%T%v.%u%19-20s\t%13-15,22Q, %1-3,5Q, %{I:#%16-18d%}"},
2992
2993
  /* Vector VQSHRUN.  */
2994
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
2995
   MVE_VQSHRUN,
2996
   0xee800fc0, 0xffa00fd1,
2997
   "vqshrun%T%v.s%19-20s\t%13-15,22Q, %1-3,5Q, %{I:#%16-18d%}"},
2998
2999
  /* Vector VQSUB T1 Variant.  */
3000
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
3001
   MVE_VQSUB_T1,
3002
   0xef000250, 0xef811f51,
3003
   "vqsub%v.%u%20-21s\t%13-15,22Q, %17-19,7Q, %1-3,5Q"},
3004
3005
  /* Vector VQSUB T2 Variant.  */
3006
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
3007
   MVE_VQSUB_T2,
3008
   0xee001f60, 0xef811f70,
3009
   "vqsub%v.%u%20-21s\t%13-15,22Q, %17-19,7Q, %0-3r"},
3010
3011
  /* Vector VREV16.  */
3012
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
3013
   MVE_VREV16,
3014
   0xffb00140, 0xffb31fd1,
3015
   "vrev16%v.8\t%13-15,22Q, %1-3,5Q"},
3016
3017
  /* Vector VREV32.  */
3018
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
3019
   MVE_VREV32,
3020
   0xffb000c0, 0xffb31fd1,
3021
   "vrev32%v.%18-19s\t%13-15,22Q, %1-3,5Q"},
3022
3023
  /* Vector VREV64.  */
3024
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
3025
   MVE_VREV64,
3026
   0xffb00040, 0xffb31fd1,
3027
   "vrev64%v.%18-19s\t%13-15,22Q, %1-3,5Q"},
3028
3029
  /* Vector VRINT floating point.  */
3030
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE_FP),
3031
   MVE_VRINT_FP,
3032
   0xffb20440, 0xffb31c51,
3033
   "vrint%m%v.f%18-19s\t%13-15,22Q, %1-3,5Q"},
3034
3035
  /* Vector VRMLALDAVH.  */
3036
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
3037
   MVE_VRMLALDAVH,
3038
   0xee800f00, 0xef811f51,
3039
   "vrmlalvh%5A%v.%u32\t%13-15l, %20-22h, %17-19,7Q, %1-3Q"},
3040
3041
  /* Vector VRMLALDAVH.  */
3042
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
3043
   MVE_VRMLALDAVH,
3044
   0xee801f00, 0xef811f51,
3045
   "vrmlaldavh%5Ax%v.%u32\t%13-15l, %20-22h, %17-19,7Q, %1-3Q"},
3046
3047
  /* Vector VRSHL T1 Variant.  */
3048
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
3049
   MVE_VRSHL_T1,
3050
   0xef000540, 0xef811f51,
3051
   "vrshl%v.%u%20-21s\t%13-15,22Q, %1-3,5Q, %17-19,7Q"},
3052
3053
  /* Vector VRSHL T2 Variant.  */
3054
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
3055
   MVE_VRSHL_T2,
3056
   0xee331e60, 0xefb31ff0,
3057
   "vrshl%v.%u%18-19s\t%13-15,22Q, %0-3r"},
3058
3059
  /* Vector VRSHRN.  */
3060
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
3061
   MVE_VRSHRN,
3062
   0xfe800fc1, 0xffa00fd1,
3063
   "vrshrn%T%v.i%19-20s\t%13-15,22Q, %1-3,5Q, %{I:#%16-18d%}"},
3064
3065
  /* Vector VSBC.  */
3066
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
3067
   MVE_VSBC,
3068
   0xfe300f00, 0xffb10f51,
3069
   "vsbc%12I%v.i32\t%13-15,22Q, %17-19,7Q, %1-3,5Q"},
3070
3071
  /* Vector VSHL T2 Variant.  */
3072
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
3073
   MVE_VSHL_T2,
3074
   0xee311e60, 0xefb31ff0,
3075
   "vshl%v.%u%18-19s\t%13-15,22Q, %0-3r"},
3076
3077
  /* Vector VSHL T3 Variant.  */
3078
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
3079
   MVE_VSHL_T3,
3080
   0xef000440, 0xef811f51,
3081
   "vshl%v.%u%20-21s\t%13-15,22Q, %1-3,5Q, %17-19,7Q"},
3082
3083
  /* Vector VSHLC.  */
3084
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
3085
   MVE_VSHLC,
3086
   0xeea00fc0, 0xffa01ff0,
3087
   "vshlc%v\t%13-15,22Q, %0-3r, %{I:#%16-20d%}"},
3088
3089
  /* Vector VSHLL T2 Variant.  */
3090
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
3091
   MVE_VSHLL_T2,
3092
   0xee310e01, 0xefb30fd1,
3093
   "vshll%T%v.%u%18-19s\t%13-15,22Q, %1-3,5Q, %{I:#%18-19d%}"},
3094
3095
  /* Vector VSHRN.  */
3096
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
3097
   MVE_VSHRN,
3098
   0xee800fc1, 0xffa00fd1,
3099
   "vshrn%T%v.i%19-20s\t%13-15,22Q, %1-3,5Q, %{I:#%16-18d%}"},
3100
3101
  /* Vector VST2 no writeback.  */
3102
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
3103
   MVE_VST2,
3104
   0xfc801e00, 0xffb01e5f,
3105
   "vst2%5d.%7-8s\t%B, [%16-19r]"},
3106
3107
  /* Vector VST2 writeback.  */
3108
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
3109
   MVE_VST2,
3110
   0xfca01e00, 0xffb01e5f,
3111
   "vst2%5d.%7-8s\t%B, [%16-19r]!"},
3112
3113
  /* Vector VST4 no writeback.  */
3114
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
3115
   MVE_VST4,
3116
   0xfc801e01, 0xffb01e1f,
3117
   "vst4%5-6d.%7-8s\t%B, [%16-19r]"},
3118
3119
  /* Vector VST4 writeback.  */
3120
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
3121
   MVE_VST4,
3122
   0xfca01e01, 0xffb01e1f,
3123
   "vst4%5-6d.%7-8s\t%B, [%16-19r]!"},
3124
3125
  /* Vector VSTRB scatter store, T1 variant.  */
3126
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
3127
   MVE_VSTRB_SCATTER_T1,
3128
   0xec800e00, 0xffb01e50,
3129
   "vstrb%v.%7-8s\t%13-15,22Q, [%16-19r, %1-3,5Q]"},
3130
3131
  /* Vector VSTRH scatter store, T2 variant.  */
3132
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
3133
   MVE_VSTRH_SCATTER_T2,
3134
   0xec800e10, 0xffb01e50,
3135
   "vstrh%v.%7-8s\t%13-15,22Q, [%16-19r, %1-3,5Q%o]"},
3136
3137
  /* Vector VSTRW scatter store, T3 variant.  */
3138
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
3139
   MVE_VSTRW_SCATTER_T3,
3140
   0xec800e40, 0xffb01e50,
3141
   "vstrw%v.%7-8s\t%13-15,22Q, [%16-19r, %1-3,5Q%o]"},
3142
3143
  /* Vector VSTRD scatter store, T4 variant.  */
3144
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
3145
   MVE_VSTRD_SCATTER_T4,
3146
   0xec800fd0, 0xffb01fd0,
3147
   "vstrd%v.64\t%13-15,22Q, [%16-19r, %1-3,5Q%o]"},
3148
3149
  /* Vector VSTRW scatter store, T5 variant.  */
3150
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
3151
   MVE_VSTRW_SCATTER_T5,
3152
   0xfd001e00, 0xff111f00,
3153
   "vstrw%v.32\t%13-15,22Q, [%17-19,7Q, %{I:#%a%0-6i%}]%w"},
3154
3155
  /* Vector VSTRD scatter store, T6 variant.  */
3156
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
3157
   MVE_VSTRD_SCATTER_T6,
3158
   0xfd001f00, 0xff111f00,
3159
   "vstrd%v.64\t%13-15,22Q, [%17-19,7Q, %{I:#%a%0-6i%}]%w"},
3160
3161
  /* Vector VSTRB.  */
3162
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
3163
   MVE_VSTRB_T1,
3164
   0xec000e00, 0xfe581e00,
3165
   "vstrb%v.%7-8s\t%13-15Q, %d"},
3166
3167
  /* Vector VSTRH.  */
3168
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
3169
   MVE_VSTRH_T2,
3170
   0xec080e00, 0xfe581e00,
3171
   "vstrh%v.%7-8s\t%13-15Q, %d"},
3172
3173
  /* Vector VSTRB variant T5.  */
3174
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
3175
   MVE_VSTRB_T5,
3176
   0xec001e00, 0xfe101f80,
3177
   "vstrb%v.8\t%13-15,22Q, %d"},
3178
3179
  /* Vector VSTRH variant T6.  */
3180
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
3181
   MVE_VSTRH_T6,
3182
   0xec001e80, 0xfe101f80,
3183
   "vstrh%v.16\t%13-15,22Q, %d"},
3184
3185
  /* Vector VSTRW variant T7.  */
3186
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
3187
   MVE_VSTRW_T7,
3188
   0xec001f00, 0xfe101f80,
3189
   "vstrw%v.32\t%13-15,22Q, %d"},
3190
3191
  /* Vector VSUB floating point T1 variant.  */
3192
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE_FP),
3193
   MVE_VSUB_FP_T1,
3194
   0xef200d40, 0xffa11f51,
3195
   "vsub%v.f%20s\t%13-15,22Q, %17-19,7Q, %1-3,5Q"},
3196
3197
  /* Vector VSUB floating point T2 variant.  */
3198
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE_FP),
3199
   MVE_VSUB_FP_T2,
3200
   0xee301f40, 0xefb11f70,
3201
   "vsub%v.f%28s\t%13-15,22Q, %17-19,7Q, %0-3r"},
3202
3203
  /* Vector VSUB T1 variant.  */
3204
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
3205
   MVE_VSUB_VEC_T1,
3206
   0xff000840, 0xff811f51,
3207
   "vsub%v.i%20-21s\t%13-15,22Q, %17-19,7Q, %1-3,5Q"},
3208
3209
  /* Vector VSUB T2 variant.  */
3210
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
3211
   MVE_VSUB_VEC_T2,
3212
   0xee011f40, 0xff811f70,
3213
   "vsub%v.i%20-21s\t%13-15,22Q, %17-19,7Q, %0-3r"},
3214
3215
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
3216
   MVE_ASRLI,
3217
   0xea50012f, 0xfff1813f,
3218
   "asrl%c\t%17-19l, %9-11h, %j"},
3219
3220
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
3221
   MVE_ASRL,
3222
   0xea50012d, 0xfff101ff,
3223
   "asrl%c\t%17-19l, %9-11h, %12-15S"},
3224
3225
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
3226
   MVE_LSLLI,
3227
   0xea50010f, 0xfff1813f,
3228
   "lsll%c\t%17-19l, %9-11h, %j"},
3229
3230
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
3231
   MVE_LSLL,
3232
   0xea50010d, 0xfff101ff,
3233
   "lsll%c\t%17-19l, %9-11h, %12-15S"},
3234
3235
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
3236
   MVE_LSRL,
3237
   0xea50011f, 0xfff1813f,
3238
   "lsrl%c\t%17-19l, %9-11h, %j"},
3239
3240
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
3241
   MVE_SQRSHRL,
3242
   0xea51012d, 0xfff1017f,
3243
   "sqrshrl%c\t%17-19l, %9-11h, %k, %12-15S"},
3244
3245
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
3246
   MVE_SQRSHR,
3247
   0xea500f2d, 0xfff00fff,
3248
   "sqrshr%c\t%16-19S, %12-15S"},
3249
3250
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
3251
   MVE_SQSHLL,
3252
   0xea51013f, 0xfff1813f,
3253
   "sqshll%c\t%17-19l, %9-11h, %j"},
3254
3255
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
3256
   MVE_SQSHL,
3257
   0xea500f3f, 0xfff08f3f,
3258
   "sqshl%c\t%16-19S, %j"},
3259
3260
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
3261
   MVE_SRSHRL,
3262
   0xea51012f, 0xfff1813f,
3263
   "srshrl%c\t%17-19l, %9-11h, %j"},
3264
3265
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
3266
   MVE_SRSHR,
3267
   0xea500f2f, 0xfff08f3f,
3268
   "srshr%c\t%16-19S, %j"},
3269
3270
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
3271
   MVE_UQRSHLL,
3272
   0xea51010d, 0xfff1017f,
3273
   "uqrshll%c\t%17-19l, %9-11h, %k, %12-15S"},
3274
3275
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
3276
   MVE_UQRSHL,
3277
   0xea500f0d, 0xfff00fff,
3278
   "uqrshl%c\t%16-19S, %12-15S"},
3279
3280
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
3281
   MVE_UQSHLL,
3282
    0xea51010f, 0xfff1813f,
3283
   "uqshll%c\t%17-19l, %9-11h, %j"},
3284
3285
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
3286
   MVE_UQSHL,
3287
   0xea500f0f, 0xfff08f3f,
3288
   "uqshl%c\t%16-19S, %j"},
3289
3290
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
3291
   MVE_URSHRL,
3292
    0xea51011f, 0xfff1813f,
3293
   "urshrl%c\t%17-19l, %9-11h, %j"},
3294
3295
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE),
3296
   MVE_URSHR,
3297
   0xea500f1f, 0xfff08f3f,
3298
   "urshr%c\t%16-19S, %j"},
3299
3300
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_V8_1M_MAIN),
3301
   MVE_CSINC,
3302
   0xea509000, 0xfff0f000,
3303
   "csinc\t%8-11S, %16-19Z, %0-3Z, %4-7c"},
3304
3305
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_V8_1M_MAIN),
3306
   MVE_CSINV,
3307
   0xea50a000, 0xfff0f000,
3308
   "csinv\t%8-11S, %16-19Z, %0-3Z, %4-7c"},
3309
3310
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_V8_1M_MAIN),
3311
   MVE_CSET,
3312
   0xea5f900f, 0xfffff00f,
3313
   "cset\t%8-11S, %4-7C"},
3314
3315
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_V8_1M_MAIN),
3316
   MVE_CSETM,
3317
   0xea5fa00f, 0xfffff00f,
3318
   "csetm\t%8-11S, %4-7C"},
3319
3320
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_V8_1M_MAIN),
3321
   MVE_CSEL,
3322
   0xea508000, 0xfff0f000,
3323
   "csel\t%8-11S, %16-19Z, %0-3Z, %4-7c"},
3324
3325
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_V8_1M_MAIN),
3326
   MVE_CSNEG,
3327
   0xea50b000, 0xfff0f000,
3328
   "csneg\t%8-11S, %16-19Z, %0-3Z, %4-7c"},
3329
3330
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_V8_1M_MAIN),
3331
   MVE_CINC,
3332
   0xea509000, 0xfff0f000,
3333
   "cinc\t%8-11S, %16-19Z, %4-7C"},
3334
3335
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_V8_1M_MAIN),
3336
   MVE_CINV,
3337
   0xea50a000, 0xfff0f000,
3338
   "cinv\t%8-11S, %16-19Z, %4-7C"},
3339
3340
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_V8_1M_MAIN),
3341
   MVE_CNEG,
3342
   0xea50b000, 0xfff0f000,
3343
   "cneg\t%8-11S, %16-19Z, %4-7C"},
3344
3345
  {ARM_FEATURE_CORE_LOW (0),
3346
   MVE_NONE,
3347
   0x00000000, 0x00000000, 0}
3348
};
3349
3350
/* Opcode tables: ARM, 16-bit Thumb, 32-bit Thumb.  All three are partially
3351
   ordered: they must be searched linearly from the top to obtain a correct
3352
   match.  */
3353
3354
/* print_insn_arm recognizes the following format control codes:
3355
3356
   %%     %
3357
3358
   %a     print address for ldr/str instruction
3359
   %s                   print address for ldr/str halfword/signextend instruction
3360
   %S                   like %s but allow UNPREDICTABLE addressing
3361
   %b     print branch destination
3362
   %c     print condition code (always bits 28-31)
3363
   %m     print register mask for ldm/stm instruction
3364
   %o     print operand2 (immediate or register + shift)
3365
   %p     print 'p' iff bits 12-15 are 15
3366
   %O     print 'OBSOLETE' iff bits 12-15 are 15
3367
   %t     print 't' iff bit 21 set and bit 24 clear
3368
   %B     print arm BLX(1) destination
3369
   %C     print the PSR sub type.
3370
   %U     print barrier type.
3371
   %P     print address for pli instruction.
3372
   %T     print 'from Armv4T onwards'
3373
3374
   %<bitfield>r   print as an ARM register
3375
   %<bitfield>T   print as an ARM register + 1
3376
   %<bitfield>R   as %r but r15 is UNPREDICTABLE
3377
   %<bitfield>{r|R}u    as %{r|R} but if matches the other %u field then is UNPREDICTABLE
3378
   %<bitfield>{r|R}U    as %{r|R} but if matches the other %U field then is UNPREDICTABLE
3379
   %<bitfield>d   print the bitfield in decimal
3380
   %<bitfield>W         print the bitfield plus one in decimal
3381
   %<bitfield>x   print the bitfield in hex
3382
   %<bitfield>X   print the bitfield as 1 hex digit without leading "0x"
3383
3384
   %<bitfield>'c  print specified char iff bitfield is all ones
3385
   %<bitfield>`c  print specified char iff bitfield is all zeroes
3386
   %<bitfield>?ab...    select from array of values in big endian order
3387
3388
   %e                   print arm SMI operand (bits 0..7,8..19).
3389
   %E     print the LSB and WIDTH fields of a BFI or BFC instruction.
3390
   %V                   print the 16-bit immediate field of a MOVT or MOVW instruction.
3391
   %R     print the SPSR/CPSR or banked register of an MRS.  */
3392
3393
static const struct opcode32 arm_opcodes[] =
3394
{
3395
  /* ARM instructions.  */
3396
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
3397
    0xe1a00000, 0xffffffff, "nop\t\t\t@ (mov r0, r0)"},
3398
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
3399
    0xe7f000f0, 0xfff000f0, "udf\t%{I:#%e%}"},
3400
3401
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V4),
3402
    0x012FFF10, 0x0ffffff0, "bx%c\t%0-3r%T"},
3403
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V2),
3404
    0x00000090, 0x0fe000f0, "mul%20's%c\t%16-19R, %0-3R, %8-11R"},
3405
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V2),
3406
    0x00200090, 0x0fe000f0, "mla%20's%c\t%16-19R, %0-3R, %8-11R, %12-15R"},
3407
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V2S),
3408
    0x01000090, 0x0fb00ff0, "swp%22'b%c\t%12-15RU, %0-3Ru, [%16-19RuU]"},
3409
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V3M),
3410
    0x00800090, 0x0fa000f0,
3411
    "%22?sumull%20's%c\t%12-15Ru, %16-19Ru, %0-3R, %8-11R"},
3412
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V3M),
3413
    0x00a00090, 0x0fa000f0,
3414
    "%22?sumlal%20's%c\t%12-15Ru, %16-19Ru, %0-3R, %8-11R"},
3415
3416
  /* V8.2 RAS extension instructions.  */
3417
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_RAS),
3418
    0xe320f010, 0xffffffff, "esb"},
3419
3420
  /* V8-R instructions.  */
3421
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_V8R),
3422
    0xf57ff04c, 0xffffffff, "dfb"},
3423
3424
  /* V8 instructions.  */
3425
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V8),
3426
    0x0320f005, 0x0fffffff, "sevl"},
3427
  /* Defined in V8 but is in NOP space so available to all arch.  */
3428
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
3429
    0xe1000070, 0xfff000f0, "hlt\t%{I:0x%16-19X%12-15X%8-11X%0-3X%}"},
3430
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_ATOMICS),
3431
    0x01800e90, 0x0ff00ff0, "stlex%c\t%12-15r, %0-3r, [%16-19R]"},
3432
  {ARM_FEATURE_CORE_LOW (ARM_EXT2_ATOMICS),
3433
    0x01900e9f, 0x0ff00fff, "ldaex%c\t%12-15r, [%16-19R]"},
3434
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V8),
3435
    0x01a00e90, 0x0ff00ff0, "stlexd%c\t%12-15r, %0-3r, %0-3T, [%16-19R]"},
3436
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V8),
3437
    0x01b00e9f, 0x0ff00fff, "ldaexd%c\t%12-15r, %12-15T, [%16-19R]"},
3438
  {ARM_FEATURE_CORE_LOW (ARM_EXT2_ATOMICS),
3439
    0x01c00e90, 0x0ff00ff0, "stlexb%c\t%12-15r, %0-3r, [%16-19R]"},
3440
  {ARM_FEATURE_CORE_LOW (ARM_EXT2_ATOMICS),
3441
    0x01d00e9f, 0x0ff00fff, "ldaexb%c\t%12-15r, [%16-19R]"},
3442
  {ARM_FEATURE_CORE_LOW (ARM_EXT2_ATOMICS),
3443
    0x01e00e90, 0x0ff00ff0, "stlexh%c\t%12-15r, %0-3r, [%16-19R]"},
3444
  {ARM_FEATURE_CORE_LOW (ARM_EXT2_ATOMICS),
3445
    0x01f00e9f, 0x0ff00fff, "ldaexh%c\t%12-15r, [%16-19R]"},
3446
  {ARM_FEATURE_CORE_LOW (ARM_EXT2_ATOMICS),
3447
    0x0180fc90, 0x0ff0fff0, "stl%c\t%0-3r, [%16-19R]"},
3448
  {ARM_FEATURE_CORE_LOW (ARM_EXT2_ATOMICS),
3449
    0x01900c9f, 0x0ff00fff, "lda%c\t%12-15r, [%16-19R]"},
3450
  {ARM_FEATURE_CORE_LOW (ARM_EXT2_ATOMICS),
3451
    0x01c0fc90, 0x0ff0fff0, "stlb%c\t%0-3r, [%16-19R]"},
3452
  {ARM_FEATURE_CORE_LOW (ARM_EXT2_ATOMICS),
3453
    0x01d00c9f, 0x0ff00fff, "ldab%c\t%12-15r, [%16-19R]"},
3454
  {ARM_FEATURE_CORE_LOW (ARM_EXT2_ATOMICS),
3455
    0x01e0fc90, 0x0ff0fff0, "stlh%c\t%0-3r, [%16-19R]"},
3456
  {ARM_FEATURE_CORE_LOW (ARM_EXT2_ATOMICS),
3457
    0x01f00c9f, 0x0ff00fff, "ldah%c\t%12-15r, [%16-19R]"},
3458
  /* CRC32 instructions.  */
3459
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_CRC),
3460
    0xe1000040, 0xfff00ff0, "crc32b\t%12-15R, %16-19R, %0-3R"},
3461
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_CRC),
3462
    0xe1200040, 0xfff00ff0, "crc32h\t%12-15R, %16-19R, %0-3R"},
3463
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_CRC),
3464
    0xe1400040, 0xfff00ff0, "crc32w\t%12-15R, %16-19R, %0-3R"},
3465
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_CRC),
3466
    0xe1000240, 0xfff00ff0, "crc32cb\t%12-15R, %16-19R, %0-3R"},
3467
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_CRC),
3468
    0xe1200240, 0xfff00ff0, "crc32ch\t%12-15R, %16-19R, %0-3R"},
3469
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_CRC),
3470
    0xe1400240, 0xfff00ff0, "crc32cw\t%12-15R, %16-19R, %0-3R"},
3471
3472
  /* Privileged Access Never extension instructions.  */
3473
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_PAN),
3474
    0xf1100000, 0xfffffdff, "setpan\t%{I:#%9-9d%}"},
3475
3476
  /* Virtualization Extension instructions.  */
3477
  {ARM_FEATURE_CORE_LOW (ARM_EXT_VIRT), 0x0160006e, 0x0fffffff, "eret%c"},
3478
  {ARM_FEATURE_CORE_LOW (ARM_EXT_VIRT), 0x01400070, 0x0ff000f0, "hvc%c\t%e"},
3479
3480
  /* Integer Divide Extension instructions.  */
3481
  {ARM_FEATURE_CORE_LOW (ARM_EXT_ADIV),
3482
    0x0710f010, 0x0ff0f0f0, "sdiv%c\t%16-19r, %0-3r, %8-11r"},
3483
  {ARM_FEATURE_CORE_LOW (ARM_EXT_ADIV),
3484
    0x0730f010, 0x0ff0f0f0, "udiv%c\t%16-19r, %0-3r, %8-11r"},
3485
3486
  /* MP Extension instructions.  */
3487
  {ARM_FEATURE_CORE_LOW (ARM_EXT_MP), 0xf410f000, 0xfc70f000, "pldw\t%a"},
3488
3489
  /* Speculation Barriers.  */
3490
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V3), 0xe320f014, 0xffffffff, "csdb"},
3491
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V3), 0xf57ff040, 0xffffffff, "ssbb"},
3492
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V3), 0xf57ff044, 0xffffffff, "pssbb"},
3493
3494
  /* V7 instructions.  */
3495
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V7), 0xf450f000, 0xfd70f000, "pli\t%P"},
3496
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V7), 0x0320f0f0, 0x0ffffff0, "dbg%c\t%{I:#%0-3d%}"},
3497
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V8), 0xf57ff051, 0xfffffff3, "dmb\t%U"},
3498
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V8), 0xf57ff041, 0xfffffff3, "dsb\t%U"},
3499
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V7), 0xf57ff050, 0xfffffff0, "dmb\t%U"},
3500
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V7), 0xf57ff040, 0xfffffff0, "dsb\t%U"},
3501
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V7), 0xf57ff060, 0xfffffff0, "isb\t%U"},
3502
   {ARM_FEATURE_CORE_LOW (ARM_EXT_V7),
3503
    0x0320f000, 0x0fffffff, "nop%c\t{%{I:%0-7d%}}"},
3504
3505
  /* ARM V6T2 instructions.  */
3506
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3507
    0x07c0001f, 0x0fe0007f, "bfc%c\t%12-15R, %E"},
3508
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3509
    0x07c00010, 0x0fe00070, "bfi%c\t%12-15R, %0-3r, %E"},
3510
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3511
    0x00600090, 0x0ff000f0, "mls%c\t%16-19R, %0-3R, %8-11R, %12-15R"},
3512
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3513
    0x002000b0, 0x0f3000f0, "strht%c\t%12-15R, %S"},
3514
3515
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3516
    0x00300090, 0x0f3000f0, UNDEFINED_INSTRUCTION },
3517
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3518
    0x00300090, 0x0f300090, "ldr%6's%5?hbt%c\t%12-15R, %S"},
3519
3520
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_V6T2_V8M),
3521
    0x03000000, 0x0ff00000, "movw%c\t%12-15R, %V"},
3522
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_V6T2_V8M),
3523
    0x03400000, 0x0ff00000, "movt%c\t%12-15R, %V"},
3524
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3525
    0x06ff0f30, 0x0fff0ff0, "rbit%c\t%12-15R, %0-3R"},
3526
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3527
    0x07a00050, 0x0fa00070, "%22?usbfx%c\t%12-15r, %0-3r, %{I:#%7-11d%}, %{I:#%16-20W%}"},
3528
3529
  /* ARM Security extension instructions.  */
3530
  {ARM_FEATURE_CORE_LOW (ARM_EXT_SEC),
3531
    0x01600070, 0x0ff000f0, "smc%c\t%e"},
3532
3533
  /* ARM V6K instructions.  */
3534
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6K),
3535
    0xf57ff01f, 0xffffffff, "clrex"},
3536
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6K),
3537
    0x01d00f9f, 0x0ff00fff, "ldrexb%c\t%12-15R, [%16-19R]"},
3538
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6K),
3539
    0x01b00f9f, 0x0ff00fff, "ldrexd%c\t%12-15r, [%16-19R]"},
3540
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6K),
3541
    0x01f00f9f, 0x0ff00fff, "ldrexh%c\t%12-15R, [%16-19R]"},
3542
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6K),
3543
    0x01c00f90, 0x0ff00ff0, "strexb%c\t%12-15R, %0-3R, [%16-19R]"},
3544
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6K),
3545
    0x01a00f90, 0x0ff00ff0, "strexd%c\t%12-15R, %0-3r, [%16-19R]"},
3546
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6K),
3547
    0x01e00f90, 0x0ff00ff0, "strexh%c\t%12-15R, %0-3R, [%16-19R]"},
3548
3549
  /* ARMv8.5-A instructions.  */
3550
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_SB), 0xf57ff070, 0xffffffff, "sb"},
3551
3552
  /* ARM V6K NOP hints.  */
3553
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6K),
3554
    0x0320f001, 0x0fffffff, "yield%c"},
3555
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6K),
3556
    0x0320f002, 0x0fffffff, "wfe%c"},
3557
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6K),
3558
    0x0320f003, 0x0fffffff, "wfi%c"},
3559
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6K),
3560
    0x0320f004, 0x0fffffff, "sev%c"},
3561
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6K),
3562
    0x0320f000, 0x0fffff00, "nop%c\t{%{I:%0-7d%}}"},
3563
3564
  /* ARM V6 instructions.  */
3565
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
3566
    0xf1080000, 0xfffffe3f, "cpsie\t%{B:%8'a%7'i%6'f%}"},
3567
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
3568
    0xf10a0000, 0xfffffe20, "cpsie\t%{B:%8'a%7'i%6'f%}, %{I:#%0-4d%}"},
3569
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
3570
    0xf10C0000, 0xfffffe3f, "cpsid\t%{B:%8'a%7'i%6'f%}"},
3571
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
3572
    0xf10e0000, 0xfffffe20, "cpsid\t%{B:%8'a%7'i%6'f%}, %{I:#%0-4d%}"},
3573
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
3574
    0xf1000000, 0xfff1fe20, "cps\t%{I:#%0-4d%}"},
3575
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
3576
    0x06800010, 0x0ff00ff0, "pkhbt%c\t%12-15R, %16-19R, %0-3R"},
3577
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
3578
    0x06800010, 0x0ff00070, "pkhbt%c\t%12-15R, %16-19R, %0-3R, %{B:lsl%} %{I:#%7-11d%}"},
3579
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
3580
    0x06800050, 0x0ff00ff0, "pkhtb%c\t%12-15R, %16-19R, %0-3R, %{B:asr%} %{I:#32%}"},
3581
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
3582
    0x06800050, 0x0ff00070, "pkhtb%c\t%12-15R, %16-19R, %0-3R, %{B:asr%} %{I:#%7-11d%}"},
3583
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
3584
    0x01900f9f, 0x0ff00fff, "ldrex%c\t%{R:r%12-15d%}, [%16-19R]"},
3585
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
3586
    0x06200f10, 0x0ff00ff0, "qadd16%c\t%12-15R, %16-19R, %0-3R"},
3587
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
3588
    0x06200f90, 0x0ff00ff0, "qadd8%c\t%12-15R, %16-19R, %0-3R"},
3589
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
3590
    0x06200f30, 0x0ff00ff0, "qasx%c\t%12-15R, %16-19R, %0-3R"},
3591
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
3592
    0x06200f70, 0x0ff00ff0, "qsub16%c\t%12-15R, %16-19R, %0-3R"},
3593
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
3594
    0x06200ff0, 0x0ff00ff0, "qsub8%c\t%12-15R, %16-19R, %0-3R"},
3595
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
3596
    0x06200f50, 0x0ff00ff0, "qsax%c\t%12-15R, %16-19R, %0-3R"},
3597
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
3598
    0x06100f10, 0x0ff00ff0, "sadd16%c\t%12-15R, %16-19R, %0-3R"},
3599
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
3600
    0x06100f90, 0x0ff00ff0, "sadd8%c\t%12-15R, %16-19R, %0-3R"},
3601
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
3602
    0x06100f30, 0x0ff00ff0, "sasx%c\t%12-15R, %16-19R, %0-3R"},
3603
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
3604
    0x06300f10, 0x0ff00ff0, "shadd16%c\t%12-15R, %16-19R, %0-3R"},
3605
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
3606
    0x06300f90, 0x0ff00ff0, "shadd8%c\t%12-15R, %16-19R, %0-3R"},
3607
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
3608
    0x06300f30, 0x0ff00ff0, "shasx%c\t%12-15R, %16-19R, %0-3R"},
3609
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
3610
    0x06300f70, 0x0ff00ff0, "shsub16%c\t%12-15R, %16-19R, %0-3R"},
3611
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
3612
    0x06300ff0, 0x0ff00ff0, "shsub8%c\t%12-15R, %16-19R, %0-3R"},
3613
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
3614
    0x06300f50, 0x0ff00ff0, "shsax%c\t%12-15R, %16-19R, %0-3R"},
3615
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
3616
    0x06100f70, 0x0ff00ff0, "ssub16%c\t%12-15R, %16-19R, %0-3R"},
3617
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
3618
    0x06100ff0, 0x0ff00ff0, "ssub8%c\t%12-15R, %16-19R, %0-3R"},
3619
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
3620
    0x06100f50, 0x0ff00ff0, "ssax%c\t%12-15R, %16-19R, %0-3R"},
3621
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
3622
    0x06500f10, 0x0ff00ff0, "uadd16%c\t%12-15R, %16-19R, %0-3R"},
3623
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
3624
    0x06500f90, 0x0ff00ff0, "uadd8%c\t%12-15R, %16-19R, %0-3R"},
3625
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
3626
    0x06500f30, 0x0ff00ff0, "uasx%c\t%12-15R, %16-19R, %0-3R"},
3627
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
3628
    0x06700f10, 0x0ff00ff0, "uhadd16%c\t%12-15R, %16-19R, %0-3R"},
3629
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
3630
    0x06700f90, 0x0ff00ff0, "uhadd8%c\t%12-15R, %16-19R, %0-3R"},
3631
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
3632
    0x06700f30, 0x0ff00ff0, "uhasx%c\t%12-15R, %16-19R, %0-3R"},
3633
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
3634
    0x06700f70, 0x0ff00ff0, "uhsub16%c\t%12-15R, %16-19R, %0-3R"},
3635
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
3636
    0x06700ff0, 0x0ff00ff0, "uhsub8%c\t%12-15R, %16-19R, %0-3R"},
3637
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
3638
    0x06700f50, 0x0ff00ff0, "uhsax%c\t%12-15R, %16-19R, %0-3R"},
3639
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
3640
    0x06600f10, 0x0ff00ff0, "uqadd16%c\t%12-15R, %16-19R, %0-3R"},
3641
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
3642
    0x06600f90, 0x0ff00ff0, "uqadd8%c\t%12-15R, %16-19R, %0-3R"},
3643
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
3644
    0x06600f30, 0x0ff00ff0, "uqasx%c\t%12-15R, %16-19R, %0-3R"},
3645
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
3646
    0x06600f70, 0x0ff00ff0, "uqsub16%c\t%12-15R, %16-19R, %0-3R"},
3647
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
3648
    0x06600ff0, 0x0ff00ff0, "uqsub8%c\t%12-15R, %16-19R, %0-3R"},
3649
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
3650
    0x06600f50, 0x0ff00ff0, "uqsax%c\t%12-15R, %16-19R, %0-3R"},
3651
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
3652
    0x06500f70, 0x0ff00ff0, "usub16%c\t%12-15R, %16-19R, %0-3R"},
3653
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
3654
    0x06500ff0, 0x0ff00ff0, "usub8%c\t%12-15R, %16-19R, %0-3R"},
3655
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
3656
    0x06500f50, 0x0ff00ff0, "usax%c\t%12-15R, %16-19R, %0-3R"},
3657
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
3658
    0x06bf0f30, 0x0fff0ff0, "rev%c\t%12-15R, %0-3R"},
3659
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
3660
    0x06bf0fb0, 0x0fff0ff0, "rev16%c\t%12-15R, %0-3R"},
3661
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
3662
    0x06ff0fb0, 0x0fff0ff0, "revsh%c\t%12-15R, %0-3R"},
3663
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
3664
    0xf8100a00, 0xfe50ffff, "rfe%23?id%24?ba\t%16-19r%21'!"},
3665
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
3666
    0x06bf0070, 0x0fff0ff0, "sxth%c\t%12-15R, %0-3R"},
3667
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
3668
    0x06bf0470, 0x0fff0ff0, "sxth%c\t%12-15R, %0-3R, %{B:ror%} %{I:#8%}"},
3669
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
3670
    0x06bf0870, 0x0fff0ff0, "sxth%c\t%12-15R, %0-3R, %{B:ror%} %{I:#16%}"},
3671
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
3672
    0x06bf0c70, 0x0fff0ff0, "sxth%c\t%12-15R, %0-3R, %{B:ror%} %{I:#24%}"},
3673
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
3674
    0x068f0070, 0x0fff0ff0, "sxtb16%c\t%12-15R, %0-3R"},
3675
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
3676
    0x068f0470, 0x0fff0ff0, "sxtb16%c\t%12-15R, %0-3R, %{B:ror%} %{I:#8%}"},
3677
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
3678
    0x068f0870, 0x0fff0ff0, "sxtb16%c\t%12-15R, %0-3R, %{B:ror%} %{I:#16%}"},
3679
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
3680
    0x068f0c70, 0x0fff0ff0, "sxtb16%c\t%12-15R, %0-3R, %{B:ror%} %{I:#24%}"},
3681
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
3682
    0x06af0070, 0x0fff0ff0, "sxtb%c\t%12-15R, %0-3R"},
3683
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
3684
    0x06af0470, 0x0fff0ff0, "sxtb%c\t%12-15R, %0-3R, %{B:ror%} %{I:#8%}"},
3685
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
3686
    0x06af0870, 0x0fff0ff0, "sxtb%c\t%12-15R, %0-3R, %{B:ror%} %{I:#16%}"},
3687
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
3688
    0x06af0c70, 0x0fff0ff0, "sxtb%c\t%12-15R, %0-3R, %{B:ror%} %{I:#24%}"},
3689
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
3690
    0x06ff0070, 0x0fff0ff0, "uxth%c\t%12-15R, %0-3R"},
3691
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
3692
    0x06ff0470, 0x0fff0ff0, "uxth%c\t%12-15R, %0-3R, %{B:ror%} %{I:#8%}"},
3693
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
3694
    0x06ff0870, 0x0fff0ff0, "uxth%c\t%12-15R, %0-3R, %{B:ror%} %{I:#16%}"},
3695
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
3696
    0x06ff0c70, 0x0fff0ff0, "uxth%c\t%12-15R, %0-3R, %{B:ror%} %{I:#24%}"},
3697
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
3698
    0x06cf0070, 0x0fff0ff0, "uxtb16%c\t%12-15R, %0-3R"},
3699
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
3700
    0x06cf0470, 0x0fff0ff0, "uxtb16%c\t%12-15R, %0-3R, %{B:ror%} %{I:#8%}"},
3701
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
3702
    0x06cf0870, 0x0fff0ff0, "uxtb16%c\t%12-15R, %0-3R, %{B:ror%} %{I:#16%}"},
3703
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
3704
    0x06cf0c70, 0x0fff0ff0, "uxtb16%c\t%12-15R, %0-3R, %{B:ror%} %{I:#24%}"},
3705
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
3706
    0x06ef0070, 0x0fff0ff0, "uxtb%c\t%12-15R, %0-3R"},
3707
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
3708
    0x06ef0470, 0x0fff0ff0, "uxtb%c\t%12-15R, %0-3R, %{B:ror%} %{I:#8%}"},
3709
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
3710
    0x06ef0870, 0x0fff0ff0, "uxtb%c\t%12-15R, %0-3R, %{B:ror%} %{I:#16%}"},
3711
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
3712
    0x06ef0c70, 0x0fff0ff0, "uxtb%c\t%12-15R, %0-3R, %{B:ror%} %{I:#24%}"},
3713
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
3714
    0x06b00070, 0x0ff00ff0, "sxtah%c\t%12-15R, %16-19r, %0-3R"},
3715
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
3716
    0x06b00470, 0x0ff00ff0, "sxtah%c\t%12-15R, %16-19r, %0-3R, %{B:ror%} %{I:#8%}"},
3717
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
3718
    0x06b00870, 0x0ff00ff0, "sxtah%c\t%12-15R, %16-19r, %0-3R, %{B:ror%} %{I:#16%}"},
3719
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
3720
    0x06b00c70, 0x0ff00ff0, "sxtah%c\t%12-15R, %16-19r, %0-3R, %{B:ror%} %{I:#24%}"},
3721
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
3722
    0x06800070, 0x0ff00ff0, "sxtab16%c\t%12-15R, %16-19r, %0-3R"},
3723
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
3724
    0x06800470, 0x0ff00ff0, "sxtab16%c\t%12-15R, %16-19r, %0-3R, %{B:ror%} %{I:#8%}"},
3725
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
3726
    0x06800870, 0x0ff00ff0, "sxtab16%c\t%12-15R, %16-19r, %0-3R, %{B:ror%} %{I:#16%}"},
3727
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
3728
    0x06800c70, 0x0ff00ff0, "sxtab16%c\t%12-15R, %16-19r, %0-3R, %{B:ror%} %{I:#24%}"},
3729
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
3730
    0x06a00070, 0x0ff00ff0, "sxtab%c\t%12-15R, %16-19r, %0-3R"},
3731
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
3732
    0x06a00470, 0x0ff00ff0, "sxtab%c\t%12-15R, %16-19r, %0-3R, %{B:ror%} %{I:#8%}"},
3733
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
3734
    0x06a00870, 0x0ff00ff0, "sxtab%c\t%12-15R, %16-19r, %0-3R, %{B:ror%} %{I:#16%}"},
3735
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
3736
    0x06a00c70, 0x0ff00ff0, "sxtab%c\t%12-15R, %16-19r, %0-3R, %{B:ror%} %{I:#24%}"},
3737
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
3738
    0x06f00070, 0x0ff00ff0, "uxtah%c\t%12-15R, %16-19r, %0-3R"},
3739
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
3740
    0x06f00470, 0x0ff00ff0, "uxtah%c\t%12-15R, %16-19r, %0-3R, %{B:ror%} %{I:#8%}"},
3741
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
3742
    0x06f00870, 0x0ff00ff0, "uxtah%c\t%12-15R, %16-19r, %0-3R, %{B:ror%} %{I:#16%}"},
3743
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
3744
    0x06f00c70, 0x0ff00ff0, "uxtah%c\t%12-15R, %16-19r, %0-3R, %{B:ror%} %{I:#24%}"},
3745
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
3746
    0x06c00070, 0x0ff00ff0, "uxtab16%c\t%12-15R, %16-19r, %0-3R"},
3747
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
3748
    0x06c00470, 0x0ff00ff0, "uxtab16%c\t%12-15R, %16-19r, %0-3R, %{B:ror%} %{I:#8%}"},
3749
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
3750
    0x06c00870, 0x0ff00ff0, "uxtab16%c\t%12-15R, %16-19r, %0-3R, %{B:ror%} %{I:#16%}"},
3751
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
3752
    0x06c00c70, 0x0ff00ff0, "uxtab16%c\t%12-15R, %16-19r, %0-3R, ROR %{I:#24%}"},
3753
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
3754
    0x06e00070, 0x0ff00ff0, "uxtab%c\t%12-15R, %16-19r, %0-3R"},
3755
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
3756
    0x06e00470, 0x0ff00ff0, "uxtab%c\t%12-15R, %16-19r, %0-3R, %{B:ror%} %{I:#8%}"},
3757
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
3758
    0x06e00870, 0x0ff00ff0, "uxtab%c\t%12-15R, %16-19r, %0-3R, %{B:ror%} %{I:#16%}"},
3759
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
3760
    0x06e00c70, 0x0ff00ff0, "uxtab%c\t%12-15R, %16-19r, %0-3R, %{B:ror%} %{I:#24%}"},
3761
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
3762
    0x06800fb0, 0x0ff00ff0, "sel%c\t%12-15R, %16-19R, %0-3R"},
3763
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
3764
    0xf1010000, 0xfffffc00, "setend\t%{B:%9?ble%}"},
3765
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
3766
    0x0700f010, 0x0ff0f0d0, "smuad%5'x%c\t%16-19R, %0-3R, %8-11R"},
3767
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
3768
    0x0700f050, 0x0ff0f0d0, "smusd%5'x%c\t%16-19R, %0-3R, %8-11R"},
3769
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
3770
    0x07000010, 0x0ff000d0, "smlad%5'x%c\t%16-19R, %0-3R, %8-11R, %12-15R"},
3771
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
3772
    0x07400010, 0x0ff000d0, "smlald%5'x%c\t%12-15Ru, %16-19Ru, %0-3R, %8-11R"},
3773
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
3774
    0x07000050, 0x0ff000d0, "smlsd%5'x%c\t%16-19R, %0-3R, %8-11R, %12-15R"},
3775
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
3776
    0x07400050, 0x0ff000d0, "smlsld%5'x%c\t%12-15Ru, %16-19Ru, %0-3R, %8-11R"},
3777
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
3778
    0x0750f010, 0x0ff0f0d0, "smmul%5'r%c\t%16-19R, %0-3R, %8-11R"},
3779
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
3780
    0x07500010, 0x0ff000d0, "smmla%5'r%c\t%16-19R, %0-3R, %8-11R, %12-15R"},
3781
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
3782
    0x075000d0, 0x0ff000d0, "smmls%5'r%c\t%16-19R, %0-3R, %8-11R, %12-15R"},
3783
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
3784
    0xf84d0500, 0xfe5fffe0, "srs%23?id%24?ba\t%16-19r%21'!, %{I:#%0-4d%}"},
3785
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
3786
    0x06a00010, 0x0fe00ff0, "ssat%c\t%12-15R, %{I:#%16-20W%}, %0-3R"},
3787
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
3788
    0x06a00010, 0x0fe00070, "ssat%c\t%12-15R, %{I:#%16-20W%}, %0-3R, %{B:lsl%} %{I:#%7-11d%}"},
3789
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
3790
    0x06a00050, 0x0fe00070, "ssat%c\t%12-15R, %{I:#%16-20W%}, %0-3R, %{B:asr%} %{I:#%7-11d%}"},
3791
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
3792
    0x06a00f30, 0x0ff00ff0, "ssat16%c\t%12-15r, %{I:#%16-19W%}, %0-3r"},
3793
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
3794
    0x01800f90, 0x0ff00ff0, "strex%c\t%12-15R, %0-3R, [%16-19R]"},
3795
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
3796
    0x00400090, 0x0ff000f0, "umaal%c\t%12-15R, %16-19R, %0-3R, %8-11R"},
3797
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
3798
    0x0780f010, 0x0ff0f0f0, "usad8%c\t%16-19R, %0-3R, %8-11R"},
3799
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
3800
    0x07800010, 0x0ff000f0, "usada8%c\t%16-19R, %0-3R, %8-11R, %12-15R"},
3801
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
3802
    0x06e00010, 0x0fe00ff0, "usat%c\t%12-15R, %{I:#%16-20d%}, %0-3R"},
3803
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
3804
    0x06e00010, 0x0fe00070, "usat%c\t%12-15R, %{I:#%16-20d%}, %0-3R, %{B:lsl%} %{I:#%7-11d%}"},
3805
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
3806
    0x06e00050, 0x0fe00070, "usat%c\t%12-15R, %{I:#%16-20d%}, %0-3R, %{B:asr%} %{I:#%7-11d%}"},
3807
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
3808
    0x06e00f30, 0x0ff00ff0, "usat16%c\t%12-15R, %{I:#%16-19d%}, %0-3R"},
3809
3810
  /* V5J instruction.  */
3811
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V5J),
3812
    0x012fff20, 0x0ffffff0, "bxj%c\t%0-3R"},
3813
3814
  /* V5 Instructions.  */
3815
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V5),
3816
    0xe1200070, 0xfff000f0,
3817
    "bkpt\t%{I:0x%16-19X%12-15X%8-11X%0-3X%}"},
3818
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V5),
3819
    0xfa000000, 0xfe000000, "blx\t%B"},
3820
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V5),
3821
    0x012fff30, 0x0ffffff0, "blx%c\t%0-3R"},
3822
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V5),
3823
    0x016f0f10, 0x0fff0ff0, "clz%c\t%12-15R, %0-3R"},
3824
3825
  /* V5E "El Segundo" Instructions.  */
3826
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V5E),
3827
    0x000000d0, 0x0e1000f0, "ldrd%c\t%12-15r, %s"},
3828
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V5E),
3829
    0x000000f0, 0x0e1000f0, "strd%c\t%12-15r, %s"},
3830
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V5E),
3831
    0xf450f000, 0xfc70f000, "pld\t%a"},
3832
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V5ExP),
3833
    0x01000080, 0x0ff000f0, "smlabb%c\t%16-19R, %0-3R, %8-11R, %12-15R"},
3834
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V5ExP),
3835
    0x010000a0, 0x0ff000f0, "smlatb%c\t%16-19R, %0-3R, %8-11R, %12-15R"},
3836
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V5ExP),
3837
    0x010000c0, 0x0ff000f0, "smlabt%c\t%16-19R, %0-3R, %8-11R, %12-15R"},
3838
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V5ExP),
3839
    0x010000e0, 0x0ff000f0, "smlatt%c\t%16-19r, %0-3r, %8-11R, %12-15R"},
3840
3841
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V5ExP),
3842
    0x01200080, 0x0ff000f0, "smlawb%c\t%16-19R, %0-3R, %8-11R, %12-15R"},
3843
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V5ExP),
3844
    0x012000c0, 0x0ff000f0, "smlawt%c\t%16-19R, %0-3r, %8-11R, %12-15R"},
3845
3846
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V5ExP),
3847
    0x01400080, 0x0ff000f0, "smlalbb%c\t%12-15Ru, %16-19Ru, %0-3R, %8-11R"},
3848
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V5ExP),
3849
    0x014000a0, 0x0ff000f0, "smlaltb%c\t%12-15Ru, %16-19Ru, %0-3R, %8-11R"},
3850
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V5ExP),
3851
    0x014000c0, 0x0ff000f0, "smlalbt%c\t%12-15Ru, %16-19Ru, %0-3R, %8-11R"},
3852
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V5ExP),
3853
    0x014000e0, 0x0ff000f0, "smlaltt%c\t%12-15Ru, %16-19Ru, %0-3R, %8-11R"},
3854
3855
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V5ExP),
3856
    0x01600080, 0x0ff0f0f0, "smulbb%c\t%16-19R, %0-3R, %8-11R"},
3857
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V5ExP),
3858
    0x016000a0, 0x0ff0f0f0, "smultb%c\t%16-19R, %0-3R, %8-11R"},
3859
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V5ExP),
3860
    0x016000c0, 0x0ff0f0f0, "smulbt%c\t%16-19R, %0-3R, %8-11R"},
3861
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V5ExP),
3862
    0x016000e0, 0x0ff0f0f0, "smultt%c\t%16-19R, %0-3R, %8-11R"},
3863
3864
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V5ExP),
3865
    0x012000a0, 0x0ff0f0f0, "smulwb%c\t%16-19R, %0-3R, %8-11R"},
3866
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V5ExP),
3867
    0x012000e0, 0x0ff0f0f0, "smulwt%c\t%16-19R, %0-3R, %8-11R"},
3868
3869
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V5ExP),
3870
    0x01000050, 0x0ff00ff0,  "qadd%c\t%12-15R, %0-3R, %16-19R"},
3871
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V5ExP),
3872
    0x01400050, 0x0ff00ff0, "qdadd%c\t%12-15R, %0-3R, %16-19R"},
3873
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V5ExP),
3874
    0x01200050, 0x0ff00ff0,  "qsub%c\t%12-15R, %0-3R, %16-19R"},
3875
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V5ExP),
3876
    0x01600050, 0x0ff00ff0, "qdsub%c\t%12-15R, %0-3R, %16-19R"},
3877
3878
  /* ARM Instructions.  */
3879
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
3880
    0x052d0004, 0x0fff0fff, "push%c\t{%12-15r}\t\t@ (str%c %12-15r, %a)"},
3881
3882
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
3883
    0x04400000, 0x0e500000, "strb%t%c\t%12-15R, %a"},
3884
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
3885
    0x04000000, 0x0e500000, "str%t%c\t%12-15r, %a"},
3886
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
3887
    0x06400000, 0x0e500ff0, "strb%t%c\t%12-15R, %a"},
3888
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
3889
    0x06000000, 0x0e500ff0, "str%t%c\t%12-15r, %a"},
3890
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
3891
    0x04400000, 0x0c500010, "strb%t%c\t%12-15R, %a"},
3892
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
3893
    0x04000000, 0x0c500010, "str%t%c\t%12-15r, %a"},
3894
3895
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
3896
    0x04400000, 0x0e500000, "strb%c\t%12-15R, %a"},
3897
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
3898
    0x06400000, 0x0e500010, "strb%c\t%12-15R, %a"},
3899
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
3900
    0x004000b0, 0x0e5000f0, "strh%c\t%12-15R, %s"},
3901
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
3902
    0x000000b0, 0x0e500ff0, "strh%c\t%12-15R, %s"},
3903
3904
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
3905
    0x00500090, 0x0e5000f0, UNDEFINED_INSTRUCTION},
3906
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
3907
    0x00500090, 0x0e500090, "ldr%6's%5?hb%c\t%12-15R, %s"},
3908
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
3909
    0x00100090, 0x0e500ff0, UNDEFINED_INSTRUCTION},
3910
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
3911
    0x00100090, 0x0e500f90, "ldr%6's%5?hb%c\t%12-15R, %s"},
3912
3913
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
3914
    0x02000000, 0x0fe00000, "and%20's%c\t%12-15r, %16-19r, %o"},
3915
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
3916
    0x00000000, 0x0fe00010, "and%20's%c\t%12-15r, %16-19r, %o"},
3917
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
3918
    0x00000010, 0x0fe00090, "and%20's%c\t%12-15R, %16-19R, %o"},
3919
3920
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
3921
    0x02200000, 0x0fe00000, "eor%20's%c\t%12-15r, %16-19r, %o"},
3922
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
3923
    0x00200000, 0x0fe00010, "eor%20's%c\t%12-15r, %16-19r, %o"},
3924
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
3925
    0x00200010, 0x0fe00090, "eor%20's%c\t%12-15R, %16-19R, %o"},
3926
3927
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
3928
    0x02400000, 0x0fe00000, "sub%20's%c\t%12-15r, %16-19r, %o"},
3929
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
3930
    0x00400000, 0x0fe00010, "sub%20's%c\t%12-15r, %16-19r, %o"},
3931
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
3932
    0x00400010, 0x0fe00090, "sub%20's%c\t%12-15R, %16-19R, %o"},
3933
3934
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
3935
    0x02600000, 0x0fe00000, "rsb%20's%c\t%12-15r, %16-19r, %o"},
3936
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
3937
    0x00600000, 0x0fe00010, "rsb%20's%c\t%12-15r, %16-19r, %o"},
3938
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
3939
    0x00600010, 0x0fe00090, "rsb%20's%c\t%12-15R, %16-19R, %o"},
3940
3941
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
3942
    0x02800000, 0x0fe00000, "add%20's%c\t%12-15r, %16-19r, %o"},
3943
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
3944
    0x00800000, 0x0fe00010, "add%20's%c\t%12-15r, %16-19r, %o"},
3945
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
3946
    0x00800010, 0x0fe00090, "add%20's%c\t%12-15R, %16-19R, %o"},
3947
3948
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
3949
    0x02a00000, 0x0fe00000, "adc%20's%c\t%12-15r, %16-19r, %o"},
3950
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
3951
    0x00a00000, 0x0fe00010, "adc%20's%c\t%12-15r, %16-19r, %o"},
3952
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
3953
    0x00a00010, 0x0fe00090, "adc%20's%c\t%12-15R, %16-19R, %o"},
3954
3955
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
3956
    0x02c00000, 0x0fe00000, "sbc%20's%c\t%12-15r, %16-19r, %o"},
3957
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
3958
    0x00c00000, 0x0fe00010, "sbc%20's%c\t%12-15r, %16-19r, %o"},
3959
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
3960
    0x00c00010, 0x0fe00090, "sbc%20's%c\t%12-15R, %16-19R, %o"},
3961
3962
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
3963
    0x02e00000, 0x0fe00000, "rsc%20's%c\t%12-15r, %16-19r, %o"},
3964
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
3965
    0x00e00000, 0x0fe00010, "rsc%20's%c\t%12-15r, %16-19r, %o"},
3966
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
3967
    0x00e00010, 0x0fe00090, "rsc%20's%c\t%12-15R, %16-19R, %o"},
3968
3969
  {ARM_FEATURE_CORE_LOW (ARM_EXT_VIRT),
3970
    0x0120f200, 0x0fb0f200, "msr%c\t%C, %0-3r"},
3971
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V3),
3972
    0x0120f000, 0x0db0f000, "msr%c\t%C, %o"},
3973
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V3),
3974
    0x01000000, 0x0fb00cff, "mrs%c\t%12-15R, %R"},
3975
3976
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
3977
    0x03000000, 0x0fe00000, "tst%p%c\t%16-19r, %o%O"},
3978
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
3979
    0x01000000, 0x0fe00010, "tst%p%c\t%16-19r, %o%O"},
3980
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
3981
    0x01000010, 0x0fe00090, "tst%p%c\t%16-19R, %o%O"},
3982
3983
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
3984
    0x03300000, 0x0ff00000, "teq%p%c\t%16-19r, %o%O"},
3985
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
3986
    0x01300000, 0x0ff00010, "teq%p%c\t%16-19r, %o%O"},
3987
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
3988
    0x01300010, 0x0ff00010, "teq%p%c\t%16-19R, %o%O"},
3989
3990
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
3991
    0x03400000, 0x0fe00000, "cmp%p%c\t%16-19r, %o%O"},
3992
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
3993
    0x01400000, 0x0fe00010, "cmp%p%c\t%16-19r, %o%O"},
3994
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
3995
    0x01400010, 0x0fe00090, "cmp%p%c\t%16-19R, %o%O"},
3996
3997
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
3998
    0x03600000, 0x0fe00000, "cmn%p%c\t%16-19r, %o%O"},
3999
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
4000
    0x01600000, 0x0fe00010, "cmn%p%c\t%16-19r, %o%O"},
4001
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
4002
    0x01600010, 0x0fe00090, "cmn%p%c\t%16-19R, %o%O"},
4003
4004
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
4005
    0x03800000, 0x0fe00000, "orr%20's%c\t%12-15r, %16-19r, %o"},
4006
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
4007
    0x01800000, 0x0fe00010, "orr%20's%c\t%12-15r, %16-19r, %o"},
4008
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
4009
    0x01800010, 0x0fe00090, "orr%20's%c\t%12-15R, %16-19R, %o"},
4010
4011
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
4012
    0x03a00000, 0x0fef0000, "mov%20's%c\t%12-15r, %o"},
4013
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
4014
    0x01a00000, 0x0def0ff0, "mov%20's%c\t%12-15r, %0-3r"},
4015
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
4016
    0x01a00000, 0x0def0060, "lsl%20's%c\t%12-15R, %q"},
4017
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
4018
    0x01a00020, 0x0def0060, "lsr%20's%c\t%12-15R, %q"},
4019
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
4020
    0x01a00040, 0x0def0060, "asr%20's%c\t%12-15R, %q"},
4021
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
4022
    0x01a00060, 0x0def0ff0, "rrx%20's%c\t%12-15r, %0-3r"},
4023
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
4024
    0x01a00060, 0x0def0060, "ror%20's%c\t%12-15R, %q"},
4025
4026
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
4027
    0x03c00000, 0x0fe00000, "bic%20's%c\t%12-15r, %16-19r, %o"},
4028
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
4029
    0x01c00000, 0x0fe00010, "bic%20's%c\t%12-15r, %16-19r, %o"},
4030
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
4031
    0x01c00010, 0x0fe00090, "bic%20's%c\t%12-15R, %16-19R, %o"},
4032
4033
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
4034
    0x03e00000, 0x0fe00000, "mvn%20's%c\t%12-15r, %o"},
4035
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
4036
    0x01e00000, 0x0fe00010, "mvn%20's%c\t%12-15r, %o"},
4037
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
4038
    0x01e00010, 0x0fe00090, "mvn%20's%c\t%12-15R, %o"},
4039
4040
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
4041
    0x06000010, 0x0e000010, UNDEFINED_INSTRUCTION},
4042
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
4043
    0x049d0004, 0x0fff0fff, "pop%c\t{%12-15r}\t\t@ (ldr%c %12-15r, %a)"},
4044
4045
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
4046
    0x04500000, 0x0c500000, "ldrb%t%c\t%12-15R, %a"},
4047
4048
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
4049
    0x04300000, 0x0d700000, "ldrt%c\t%12-15R, %a"},
4050
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
4051
    0x04100000, 0x0c500000, "ldr%c\t%12-15r, %a"},
4052
4053
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
4054
    0x092d0001, 0x0fffffff, "stmfd%c\t%16-19R!, %m"},
4055
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
4056
    0x092d0002, 0x0fffffff, "stmfd%c\t%16-19R!, %m"},
4057
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
4058
    0x092d0004, 0x0fffffff, "stmfd%c\t%16-19R!, %m"},
4059
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
4060
    0x092d0008, 0x0fffffff, "stmfd%c\t%16-19R!, %m"},
4061
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
4062
    0x092d0010, 0x0fffffff, "stmfd%c\t%16-19R!, %m"},
4063
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
4064
    0x092d0020, 0x0fffffff, "stmfd%c\t%16-19R!, %m"},
4065
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
4066
    0x092d0040, 0x0fffffff, "stmfd%c\t%16-19R!, %m"},
4067
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
4068
    0x092d0080, 0x0fffffff, "stmfd%c\t%16-19R!, %m"},
4069
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
4070
    0x092d0100, 0x0fffffff, "stmfd%c\t%16-19R!, %m"},
4071
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
4072
    0x092d0200, 0x0fffffff, "stmfd%c\t%16-19R!, %m"},
4073
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
4074
    0x092d0400, 0x0fffffff, "stmfd%c\t%16-19R!, %m"},
4075
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
4076
    0x092d0800, 0x0fffffff, "stmfd%c\t%16-19R!, %m"},
4077
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
4078
    0x092d1000, 0x0fffffff, "stmfd%c\t%16-19R!, %m"},
4079
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
4080
    0x092d2000, 0x0fffffff, "stmfd%c\t%16-19R!, %m"},
4081
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
4082
    0x092d4000, 0x0fffffff, "stmfd%c\t%16-19R!, %m"},
4083
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
4084
    0x092d8000, 0x0fffffff, "stmfd%c\t%16-19R!, %m"},
4085
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
4086
    0x092d0000, 0x0fff0000, "push%c\t%m"},
4087
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
4088
    0x08800000, 0x0ff00000, "stm%c\t%16-19R%21'!, %m%22'^"},
4089
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
4090
    0x08000000, 0x0e100000, "stm%23?id%24?ba%c\t%16-19R%21'!, %m%22'^"},
4091
4092
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
4093
    0x08bd0001, 0x0fffffff, "ldmfd%c\t%16-19R!, %m"},
4094
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
4095
    0x08bd0002, 0x0fffffff, "ldmfd%c\t%16-19R!, %m"},
4096
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
4097
    0x08bd0004, 0x0fffffff, "ldmfd%c\t%16-19R!, %m"},
4098
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
4099
    0x08bd0008, 0x0fffffff, "ldmfd%c\t%16-19R!, %m"},
4100
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
4101
    0x08bd0010, 0x0fffffff, "ldmfd%c\t%16-19R!, %m"},
4102
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
4103
    0x08bd0020, 0x0fffffff, "ldmfd%c\t%16-19R!, %m"},
4104
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
4105
    0x08bd0040, 0x0fffffff, "ldmfd%c\t%16-19R!, %m"},
4106
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
4107
    0x08bd0080, 0x0fffffff, "ldmfd%c\t%16-19R!, %m"},
4108
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
4109
    0x08bd0100, 0x0fffffff, "ldmfd%c\t%16-19R!, %m"},
4110
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
4111
    0x08bd0200, 0x0fffffff, "ldmfd%c\t%16-19R!, %m"},
4112
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
4113
    0x08bd0400, 0x0fffffff, "ldmfd%c\t%16-19R!, %m"},
4114
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
4115
    0x08bd0800, 0x0fffffff, "ldmfd%c\t%16-19R!, %m"},
4116
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
4117
    0x08bd1000, 0x0fffffff, "ldmfd%c\t%16-19R!, %m"},
4118
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
4119
    0x08bd2000, 0x0fffffff, "ldmfd%c\t%16-19R!, %m"},
4120
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
4121
    0x08bd4000, 0x0fffffff, "ldmfd%c\t%16-19R!, %m"},
4122
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
4123
    0x08bd8000, 0x0fffffff, "ldmfd%c\t%16-19R!, %m"},
4124
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
4125
    0x08bd0000, 0x0fff0000, "pop%c\t%m"},
4126
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
4127
    0x08900000, 0x0f900000, "ldm%c\t%16-19R%21'!, %m%22'^"},
4128
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
4129
    0x08100000, 0x0e100000, "ldm%23?id%24?ba%c\t%16-19R%21'!, %m%22'^"},
4130
4131
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
4132
    0x0a000000, 0x0e000000, "b%24'l%c\t%b"},
4133
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
4134
    0x0f000000, 0x0f000000, "svc%c\t%0-23x"},
4135
4136
  /* The rest.  */
4137
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V7),
4138
    0x03200000, 0x0fff00ff, "nop%c\t{%{I:%0-7d%}}" UNPREDICTABLE_INSTRUCTION},
4139
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
4140
    0x00000000, 0x00000000, UNDEFINED_INSTRUCTION},
4141
  {ARM_FEATURE_CORE_LOW (0),
4142
    0x00000000, 0x00000000, 0}
4143
};
4144
4145
/* print_insn_thumb16 recognizes the following format control codes:
4146
4147
   %S                   print Thumb register (bits 3..5 as high number if bit 6 set)
4148
   %D                   print Thumb register (bits 0..2 as high number if bit 7 set)
4149
   %<bitfield>I         print bitfield as a signed decimal
4150
          (top bit of range being the sign bit)
4151
   %N                   print Thumb register mask (with LR)
4152
   %O                   print Thumb register mask (with PC)
4153
   %M                   print Thumb register mask
4154
   %b     print CZB's 6-bit unsigned branch destination
4155
   %s     print Thumb right-shift immediate (6..10; 0 == 32).
4156
   %c     print the condition code
4157
   %C     print the condition code, or "s" if not conditional
4158
   %x     print warning if conditional an not at end of IT block"
4159
   %X     print "\t@ unpredictable <IT:code>" if conditional
4160
   %I     print IT instruction suffix and operands
4161
   %W     print Thumb Writeback indicator for LDMIA
4162
   %<bitfield>r   print bitfield as an ARM register
4163
   %<bitfield>d   print bitfield as a decimal
4164
   %<bitfield>H         print (bitfield * 2) as a decimal
4165
   %<bitfield>W         print (bitfield * 4) as a decimal
4166
   %<bitfield>a         print (bitfield * 4) as a pc-rel offset + decoded symbol
4167
   %<bitfield>B         print Thumb branch destination (signed displacement)
4168
   %<bitfield>c         print bitfield as a condition code
4169
   %<bitnum>'c    print specified char iff bit is one
4170
   %<bitnum>?ab   print a if bit is one else print b.  */
4171
4172
static const struct opcode16 thumb_opcodes[] =
4173
{
4174
  /* Thumb instructions.  */
4175
4176
  /* ARMv8-M Security Extensions instructions.  */
4177
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_V8M), 0x4784, 0xff87, "blxns\t%3-6r"},
4178
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_V8M), 0x4704, 0xff87, "bxns\t%3-6r"},
4179
4180
  /* ARM V8 instructions.  */
4181
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V8),  0xbf50, 0xffff, "sevl%c"},
4182
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V8),  0xba80, 0xffc0, "hlt\t%0-5x"},
4183
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_PAN),  0xb610, 0xfff7, "setpan\t%{I:#%3-3d%}"},
4184
4185
  /* ARM V6K no-argument instructions.  */
4186
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6K), 0xbf00, 0xffff, "nop%c"},
4187
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6K), 0xbf10, 0xffff, "yield%c"},
4188
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6K), 0xbf20, 0xffff, "wfe%c"},
4189
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6K), 0xbf30, 0xffff, "wfi%c"},
4190
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6K), 0xbf40, 0xffff, "sev%c"},
4191
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6K), 0xbf00, 0xff0f, "nop%c\t{%4-7d}"},
4192
4193
  /* ARM V6T2 instructions.  */
4194
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_V6T2_V8M),
4195
    0xb900, 0xfd00, "cbnz\t%0-2r, %b%X"},
4196
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_V6T2_V8M),
4197
    0xb100, 0xfd00, "cbz\t%0-2r, %b%X"},
4198
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2), 0xbf00, 0xff00, "it%I%X"},
4199
4200
  /* ARM V6.  */
4201
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6), 0xb660, 0xfff8, "cpsie\t%{B:%2'a%1'i%0'f%}%X"},
4202
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6), 0xb670, 0xfff8, "cpsid\t%{B:%2'a%1'i%0'f%}%X"},
4203
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6), 0x4600, 0xffc0, "mov%c\t%0-2r, %3-5r"},
4204
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6), 0xba00, 0xffc0, "rev%c\t%0-2r, %3-5r"},
4205
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6), 0xba40, 0xffc0, "rev16%c\t%0-2r, %3-5r"},
4206
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6), 0xbac0, 0xffc0, "revsh%c\t%0-2r, %3-5r"},
4207
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6), 0xb650, 0xfff7, "setend\t%{B:%3?ble%}%X"},
4208
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6), 0xb200, 0xffc0, "sxth%c\t%0-2r, %3-5r"},
4209
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6), 0xb240, 0xffc0, "sxtb%c\t%0-2r, %3-5r"},
4210
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6), 0xb280, 0xffc0, "uxth%c\t%0-2r, %3-5r"},
4211
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6), 0xb2c0, 0xffc0, "uxtb%c\t%0-2r, %3-5r"},
4212
4213
  /* ARM V5 ISA extends Thumb.  */
4214
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V5T),
4215
    0xbe00, 0xff00, "bkpt\t%0-7x"}, /* Is always unconditional.  */
4216
  /* This is BLX(2).  BLX(1) is a 32-bit instruction.  */
4217
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V5T),
4218
    0x4780, 0xff87, "blx%c\t%3-6r%x"},  /* note: 4 bit register number.  */
4219
  /* ARM V4T ISA (Thumb v1).  */
4220
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V4T),
4221
    0x46C0, 0xFFFF, "nop%c\t\t\t@ (mov r8, r8)"},
4222
  /* Format 4.  */
4223
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V4T), 0x4000, 0xFFC0, "and%C\t%0-2r, %3-5r"},
4224
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V4T), 0x4040, 0xFFC0, "eor%C\t%0-2r, %3-5r"},
4225
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V4T), 0x4080, 0xFFC0, "lsl%C\t%0-2r, %3-5r"},
4226
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V4T), 0x40C0, 0xFFC0, "lsr%C\t%0-2r, %3-5r"},
4227
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V4T), 0x4100, 0xFFC0, "asr%C\t%0-2r, %3-5r"},
4228
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V4T), 0x4140, 0xFFC0, "adc%C\t%0-2r, %3-5r"},
4229
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V4T), 0x4180, 0xFFC0, "sbc%C\t%0-2r, %3-5r"},
4230
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V4T), 0x41C0, 0xFFC0, "ror%C\t%0-2r, %3-5r"},
4231
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V4T), 0x4200, 0xFFC0, "tst%c\t%0-2r, %3-5r"},
4232
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V4T), 0x4240, 0xFFC0, "neg%C\t%0-2r, %3-5r"},
4233
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V4T), 0x4280, 0xFFC0, "cmp%c\t%0-2r, %3-5r"},
4234
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V4T), 0x42C0, 0xFFC0, "cmn%c\t%0-2r, %3-5r"},
4235
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V4T), 0x4300, 0xFFC0, "orr%C\t%0-2r, %3-5r"},
4236
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V4T), 0x4340, 0xFFC0, "mul%C\t%0-2r, %3-5r"},
4237
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V4T), 0x4380, 0xFFC0, "bic%C\t%0-2r, %3-5r"},
4238
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V4T), 0x43C0, 0xFFC0, "mvn%C\t%0-2r, %3-5r"},
4239
  /* format 13 */
4240
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V4T), 0xB000, 0xFF80, "add%c\t%{R:sp%}, %{I:#%0-6W%}"},
4241
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V4T), 0xB080, 0xFF80, "sub%c\t%{R:sp%}, %{I:#%0-6W%}"},
4242
  /* format 5 */
4243
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V4T), 0x4700, 0xFF80, "bx%c\t%S%x"},
4244
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V4T), 0x4400, 0xFF00, "add%c\t%D, %S"},
4245
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V4T), 0x4500, 0xFF00, "cmp%c\t%D, %S"},
4246
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V4T), 0x4600, 0xFF00, "mov%c\t%D, %S"},
4247
  /* format 14 */
4248
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V4T), 0xB400, 0xFE00, "push%c\t%N"},
4249
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V4T), 0xBC00, 0xFE00, "pop%c\t%O"},
4250
  /* format 2 */
4251
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V4T),
4252
    0x1800, 0xFE00, "add%C\t%0-2r, %3-5r, %6-8r"},
4253
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V4T),
4254
    0x1A00, 0xFE00, "sub%C\t%0-2r, %3-5r, %6-8r"},
4255
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V4T),
4256
    0x1C00, 0xFE00, "add%C\t%0-2r, %3-5r, %{I:#%6-8d%}"},
4257
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V4T),
4258
    0x1E00, 0xFE00, "sub%C\t%0-2r, %3-5r, %{I:#%6-8d%}"},
4259
  /* format 8 */
4260
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V4T),
4261
    0x5200, 0xFE00, "strh%c\t%0-2r, [%3-5r, %6-8r]"},
4262
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V4T),
4263
    0x5A00, 0xFE00, "ldrh%c\t%0-2r, [%3-5r, %6-8r]"},
4264
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V4T),
4265
    0x5600, 0xF600, "ldrs%11?hb%c\t%0-2r, [%3-5r, %6-8r]"},
4266
  /* format 7 */
4267
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V4T),
4268
    0x5000, 0xFA00, "str%10'b%c\t%0-2r, [%3-5r, %6-8r]"},
4269
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V4T),
4270
    0x5800, 0xFA00, "ldr%10'b%c\t%0-2r, [%3-5r, %6-8r]"},
4271
  /* format 1 */
4272
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V4T), 0x0000, 0xFFC0, "mov%C\t%0-2r, %3-5r"},
4273
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V4T),
4274
    0x0000, 0xF800, "lsl%C\t%0-2r, %3-5r, %{I:#%6-10d%}"},
4275
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V4T), 0x0800, 0xF800, "lsr%C\t%0-2r, %3-5r, %s"},
4276
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V4T), 0x1000, 0xF800, "asr%C\t%0-2r, %3-5r, %s"},
4277
  /* format 3 */
4278
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V4T), 0x2000, 0xF800, "mov%C\t%8-10r, %{I:#%0-7d%}"},
4279
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V4T), 0x2800, 0xF800, "cmp%c\t%8-10r, %{I:#%0-7d%}"},
4280
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V4T), 0x3000, 0xF800, "add%C\t%8-10r, %{I:#%0-7d%}"},
4281
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V4T), 0x3800, 0xF800, "sub%C\t%8-10r, %{I:#%0-7d%}"},
4282
  /* format 6 */
4283
  /* TODO: Disassemble PC relative "LDR rD,=<symbolic>" */
4284
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V4T),
4285
    0x4800, 0xF800,
4286
    "ldr%c\t%8-10r, [%{R:pc%}, %{I:#%0-7W%}]\t@ (%0-7a)"},
4287
  /* format 9 */
4288
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V4T),
4289
    0x6000, 0xF800, "str%c\t%0-2r, [%3-5r, %{I:#%6-10W%}]"},
4290
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V4T),
4291
    0x6800, 0xF800, "ldr%c\t%0-2r, [%3-5r, %{I:#%6-10W%}]"},
4292
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V4T),
4293
    0x7000, 0xF800, "strb%c\t%0-2r, [%3-5r, %{I:#%6-10d%}]"},
4294
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V4T),
4295
    0x7800, 0xF800, "ldrb%c\t%0-2r, [%3-5r, %{I:#%6-10d%}]"},
4296
  /* format 10 */
4297
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V4T),
4298
    0x8000, 0xF800, "strh%c\t%0-2r, [%3-5r, %{I:#%6-10H%}]"},
4299
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V4T),
4300
    0x8800, 0xF800, "ldrh%c\t%0-2r, [%3-5r, %{I:#%6-10H%}]"},
4301
  /* format 11 */
4302
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V4T),
4303
    0x9000, 0xF800, "str%c\t%8-10r, [%{R:sp%}, %{I:#%0-7W%}]"},
4304
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V4T),
4305
    0x9800, 0xF800, "ldr%c\t%8-10r, [%{R:sp%}, %{I:#%0-7W%}]"},
4306
  /* format 12 */
4307
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V4T),
4308
    0xA000, 0xF800, "add%c\t%8-10r, %{R:pc%}, %{I:#%0-7W%}\t@ (adr %8-10r, %0-7a)"},
4309
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V4T),
4310
    0xA800, 0xF800, "add%c\t%8-10r, %{R:sp%}, %{I:#%0-7W%}"},
4311
  /* format 15 */
4312
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V4T), 0xC000, 0xF800, "stmia%c\t%8-10r!, %M"},
4313
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V4T), 0xC800, 0xF800, "ldmia%c\t%8-10r%W, %M"},
4314
  /* format 17 */
4315
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V4T), 0xDF00, 0xFF00, "svc%c\t%0-7d"},
4316
  /* format 16 */
4317
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V4T), 0xDE00, 0xFF00, "udf%c\t%{I:#%0-7d%}"},
4318
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V4T), 0xDE00, 0xFE00, UNDEFINED_INSTRUCTION},
4319
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V4T), 0xD000, 0xF000, "b%8-11c.n\t%0-7B%X"},
4320
  /* format 18 */
4321
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V4T), 0xE000, 0xF800, "b%c.n\t%0-10B%x"},
4322
4323
  /* The E800 .. FFFF range is unconditionally redirected to the
4324
     32-bit table, because even in pre-V6T2 ISAs, BL and BLX(1) pairs
4325
     are processed via that table.  Thus, we can never encounter a
4326
     bare "second half of BL/BLX(1)" instruction here.  */
4327
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),  0x0000, 0x0000, UNDEFINED_INSTRUCTION},
4328
  {ARM_FEATURE_CORE_LOW (0), 0, 0, 0}
4329
};
4330
4331
/* Thumb32 opcodes use the same table structure as the ARM opcodes.
4332
   We adopt the convention that hw1 is the high 16 bits of .value and
4333
   .mask, hw2 the low 16 bits.
4334
4335
   print_insn_thumb32 recognizes the following format control codes:
4336
4337
       %%   %
4338
4339
       %I   print a 12-bit immediate from hw1[10],hw2[14:12,7:0]
4340
       %M   print a modified 12-bit immediate (same location)
4341
       %J   print a 16-bit immediate from hw1[3:0,10],hw2[14:12,7:0]
4342
       %K   print a 16-bit immediate from hw2[3:0],hw1[3:0],hw2[11:4]
4343
       %H   print a 16-bit immediate from hw2[3:0],hw1[11:0]
4344
       %S   print a possibly-shifted Rm
4345
4346
       %L   print address for a ldrd/strd instruction
4347
       %a   print the address of a plain load/store
4348
       %w   print the width and signedness of a core load/store
4349
       %m   print register mask for ldm/stm
4350
       %n   print register mask for clrm
4351
4352
       %E   print the lsb and width fields of a bfc/bfi instruction
4353
       %F   print the lsb and width fields of a sbfx/ubfx instruction
4354
       %G   print a fallback offset for Branch Future instructions
4355
       %W   print an offset for BF instruction
4356
       %Y   print an offset for BFL instruction
4357
       %Z   print an offset for BFCSEL instruction
4358
       %Q   print an offset for Low Overhead Loop instructions
4359
       %P   print an offset for Low Overhead Loop end instructions
4360
       %b   print a conditional branch offset
4361
       %B   print an unconditional branch offset
4362
       %s   print the shift field of an SSAT instruction
4363
       %R   print the rotation field of an SXT instruction
4364
       %U   print barrier type.
4365
       %P   print address for pli instruction.
4366
       %c   print the condition code
4367
       %x   print warning if conditional an not at end of IT block"
4368
       %X   print "\t@ unpredictable <IT:code>" if conditional
4369
4370
       %<bitfield>d print bitfield in decimal
4371
       %<bitfield>D     print bitfield plus one in decimal
4372
       %<bitfield>W print bitfield*4 in decimal
4373
       %<bitfield>r print bitfield as an ARM register
4374
       %<bitfield>R as %<>r but r15 is UNPREDICTABLE
4375
       %<bitfield>S as %<>r but r13 and r15 is UNPREDICTABLE
4376
       %<bitfield>c print bitfield as a condition code
4377
4378
       %<bitfield>'c  print specified char iff bitfield is all ones
4379
       %<bitfield>`c  print specified char iff bitfield is all zeroes
4380
       %<bitfield>?ab... select from array of values in big endian order
4381
4382
   With one exception at the bottom (done because BL and BLX(1) need
4383
   to come dead last), this table was machine-sorted first in
4384
   decreasing order of number of bits set in the mask, then in
4385
   increasing numeric order of mask, then in increasing numeric order
4386
   of opcode.  This order is not the clearest for a human reader, but
4387
   is guaranteed never to catch a special-case bit pattern with a more
4388
   general mask, which is important, because this instruction encoding
4389
   makes heavy use of special-case bit patterns.  */
4390
static const struct opcode32 thumb32_opcodes[] =
4391
{
4392
  /* Arm v8.1-M Mainline Pointer Authentication and Branch Target
4393
     Identification Extension.  */
4394
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_V8_1M_MAIN),
4395
   0xf3af802d, 0xffffffff, "aut\t%{R:r12%}, %{R:lr%}, %{R:sp%}"},
4396
  {ARM_FEATURE_CORE_HIGH_HIGH (ARM_EXT3_PACBTI),
4397
   0xfb500f00, 0xfff00ff0, "autg%c\t%12-15r, %16-19r, %0-3r"},
4398
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_V8_1M_MAIN),
4399
   0xf3af800f, 0xffffffff, "bti"},
4400
  {ARM_FEATURE_CORE_HIGH_HIGH (ARM_EXT3_PACBTI),
4401
   0xfb500f10, 0xfff00ff0, "bxaut%c\t%12-15r, %16-19r, %0-3r"},
4402
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_V8_1M_MAIN),
4403
   0xf3af801d, 0xffffffff, "pac\t%{R:r12%}, %{R:lr%}, %{R:sp%}"},
4404
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_V8_1M_MAIN),
4405
   0xf3af800d, 0xffffffff, "pacbti\t%{R:r12%}, %{R:lr%}, %{R:sp%}"},
4406
  {ARM_FEATURE_CORE_HIGH_HIGH (ARM_EXT3_PACBTI),
4407
   0xfb60f000, 0xfff0f0f0, "pacg%c\t%8-11r, %16-19r, %0-3r"},
4408
4409
  /* Armv8.1-M Mainline and Armv8.1-M Mainline Security Extensions
4410
     instructions.  */
4411
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_V8_1M_MAIN),
4412
    0xf00fe001, 0xffffffff, "lctp%c"},
4413
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_V8_1M_MAIN),
4414
    0xf02fc001, 0xfffff001, "le\t%P"},
4415
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_V8_1M_MAIN),
4416
    0xf00fc001, 0xfffff001, "le\t%{R:lr%}, %P"},
4417
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_V8_1M_MAIN),
4418
    0xf01fc001, 0xfffff001, "letp\t%{R:lr%}, %P"},
4419
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_V8_1M_MAIN),
4420
    0xf040c001, 0xfff0f001, "wls\t%{R:lr%}, %16-19S, %Q"},
4421
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_V8_1M_MAIN),
4422
    0xf000c001, 0xffc0f001, "wlstp.%20-21s\t%{R:lr%}, %16-19S, %Q"},
4423
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_V8_1M_MAIN),
4424
    0xf040e001, 0xfff0ffff, "dls\t%{R:lr%}, %16-19S"},
4425
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_V8_1M_MAIN),
4426
    0xf000e001, 0xffc0ffff, "dlstp.%20-21s\t%{R:lr%}, %16-19S"},
4427
4428
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_V8_1M_MAIN),
4429
    0xf040e001, 0xf860f001, "bf%c\t%G, %W"},
4430
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_V8_1M_MAIN),
4431
    0xf060e001, 0xf8f0f001, "bfx%c\t%G, %16-19S"},
4432
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_V8_1M_MAIN),
4433
    0xf000c001, 0xf800f001, "bfl%c\t%G, %Y"},
4434
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_V8_1M_MAIN),
4435
    0xf070e001, 0xf8f0f001, "bflx%c\t%G, %16-19S"},
4436
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_V8_1M_MAIN),
4437
    0xf000e001, 0xf840f001, "bfcsel\t%G, %Z, %{B:%18-21c%}"},
4438
4439
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_V8_1M_MAIN),
4440
    0xe89f0000, 0xffff2000, "clrm%c\t%n"},
4441
4442
  /* ARMv8-M and ARMv8-M Security Extensions instructions.  */
4443
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_V8M), 0xe97fe97f, 0xffffffff, "sg"},
4444
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_V8M),
4445
    0xe840f000, 0xfff0f0ff, "tt\t%8-11r, %16-19r"},
4446
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_V8M),
4447
    0xe840f040, 0xfff0f0ff, "ttt\t%8-11r, %16-19r"},
4448
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_V8M),
4449
    0xe840f080, 0xfff0f0ff, "tta\t%8-11r, %16-19r"},
4450
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_V8M),
4451
    0xe840f0c0, 0xfff0f0ff, "ttat\t%8-11r, %16-19r"},
4452
4453
  /* ARM V8.2 RAS extension instructions.  */
4454
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_RAS),
4455
    0xf3af8010, 0xffffffff, "esb"},
4456
4457
  /* V8 instructions.  */
4458
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V8),
4459
    0xf3af8005, 0xffffffff, "sevl%c.w"},
4460
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V8),
4461
    0xf78f8000, 0xfffffffc, "dcps%0-1d"},
4462
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V8),
4463
    0xe8c00f8f, 0xfff00fff, "stlb%c\t%12-15r, [%16-19R]"},
4464
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V8),
4465
    0xe8c00f9f, 0xfff00fff, "stlh%c\t%12-15r, [%16-19R]"},
4466
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V8),
4467
    0xe8c00faf, 0xfff00fff, "stl%c\t%12-15r, [%16-19R]"},
4468
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V8),
4469
    0xe8c00fc0, 0xfff00ff0, "stlexb%c\t%0-3r, %12-15r, [%16-19R]"},
4470
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V8),
4471
    0xe8c00fd0, 0xfff00ff0, "stlexh%c\t%0-3r, %12-15r, [%16-19R]"},
4472
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V8),
4473
    0xe8c00fe0, 0xfff00ff0, "stlex%c\t%0-3r, %12-15r, [%16-19R]"},
4474
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V8),
4475
    0xe8c000f0, 0xfff000f0, "stlexd%c\t%0-3r, %12-15r, %8-11r, [%16-19R]"},
4476
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V8),
4477
    0xe8d00f8f, 0xfff00fff, "ldab%c\t%12-15r, [%16-19R]"},
4478
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V8),
4479
    0xe8d00f9f, 0xfff00fff, "ldah%c\t%12-15r, [%16-19R]"},
4480
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V8),
4481
    0xe8d00faf, 0xfff00fff, "lda%c\t%12-15r, [%16-19R]"},
4482
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V8),
4483
    0xe8d00fcf, 0xfff00fff, "ldaexb%c\t%12-15r, [%16-19R]"},
4484
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V8),
4485
    0xe8d00fdf, 0xfff00fff, "ldaexh%c\t%12-15r, [%16-19R]"},
4486
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V8),
4487
    0xe8d00fef, 0xfff00fff, "ldaex%c\t%12-15r, [%16-19R]"},
4488
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V8),
4489
    0xe8d000ff, 0xfff000ff, "ldaexd%c\t%12-15r, %8-11r, [%16-19R]"},
4490
4491
  /* V8-R instructions.  */
4492
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_V8R),
4493
    0xf3bf8f4c, 0xffffffff, "dfb%c"},
4494
4495
  /* CRC32 instructions.  */
4496
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_CRC),
4497
    0xfac0f080, 0xfff0f0f0, "crc32b\t%8-11R, %16-19R, %0-3R"},
4498
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_CRC),
4499
    0xfac0f090, 0xfff0f0f0, "crc32h\t%9-11R, %16-19R, %0-3R"},
4500
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_CRC),
4501
    0xfac0f0a0, 0xfff0f0f0, "crc32w\t%8-11R, %16-19R, %0-3R"},
4502
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_CRC),
4503
    0xfad0f080, 0xfff0f0f0, "crc32cb\t%8-11R, %16-19R, %0-3R"},
4504
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_CRC),
4505
    0xfad0f090, 0xfff0f0f0, "crc32ch\t%8-11R, %16-19R, %0-3R"},
4506
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_CRC),
4507
    0xfad0f0a0, 0xfff0f0f0, "crc32cw\t%8-11R, %16-19R, %0-3R"},
4508
4509
  /* Speculation Barriers.  */
4510
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2), 0xf3af8014, 0xffffffff, "csdb"},
4511
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2), 0xf3bf8f40, 0xffffffff, "ssbb"},
4512
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2), 0xf3bf8f44, 0xffffffff, "pssbb"},
4513
4514
  /* V7 instructions.  */
4515
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V7), 0xf910f000, 0xff70f000, "pli%c\t%a"},
4516
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V7), 0xf3af80f0, 0xfffffff0, "dbg%c\t%{I:#%0-3d%}"},
4517
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V8), 0xf3bf8f51, 0xfffffff3, "dmb%c\t%U"},
4518
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V8), 0xf3bf8f41, 0xfffffff3, "dsb%c\t%U"},
4519
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V7), 0xf3bf8f50, 0xfffffff0, "dmb%c\t%U"},
4520
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V7), 0xf3bf8f40, 0xfffffff0, "dsb%c\t%U"},
4521
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V7), 0xf3bf8f60, 0xfffffff0, "isb%c\t%U"},
4522
  {ARM_FEATURE_CORE_LOW (ARM_EXT_DIV),
4523
    0xfb90f0f0, 0xfff0f0f0, "sdiv%c\t%8-11r, %16-19r, %0-3r"},
4524
  {ARM_FEATURE_CORE_LOW (ARM_EXT_DIV),
4525
    0xfbb0f0f0, 0xfff0f0f0, "udiv%c\t%8-11r, %16-19r, %0-3r"},
4526
4527
  /* Virtualization Extension instructions.  */
4528
  {ARM_FEATURE_CORE_LOW (ARM_EXT_VIRT), 0xf7e08000, 0xfff0f000, "hvc%c\t%V"},
4529
  /* We skip ERET as that is SUBS pc, lr, #0.  */
4530
4531
  /* MP Extension instructions.  */
4532
  {ARM_FEATURE_CORE_LOW (ARM_EXT_MP),   0xf830f000, 0xff70f000, "pldw%c\t%a"},
4533
4534
  /* Security extension instructions.  */
4535
  {ARM_FEATURE_CORE_LOW (ARM_EXT_SEC),  0xf7f08000, 0xfff0f000, "smc%c\t%K"},
4536
4537
  /* ARMv8.5-A instructions.  */
4538
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_SB), 0xf3bf8f70, 0xffffffff, "sb"},
4539
4540
  /* Instructions defined in the basic V6T2 set.  */
4541
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2), 0xf3af8000, 0xffffffff, "nop%c.w"},
4542
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2), 0xf3af8001, 0xffffffff, "yield%c.w"},
4543
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2), 0xf3af8002, 0xffffffff, "wfe%c.w"},
4544
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2), 0xf3af8003, 0xffffffff, "wfi%c.w"},
4545
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2), 0xf3af8004, 0xffffffff, "sev%c.w"},
4546
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4547
    0xf3af8000, 0xffffff00, "nop%c.w\t{%{I:%0-7d%}}"},
4548
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2), 0xf7f0a000, 0xfff0f000, "udf%c.w\t%H"},
4549
4550
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_V6T2_V8M),
4551
    0xf3bf8f2f, 0xffffffff, "clrex%c"},
4552
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4553
    0xf3af8400, 0xffffff1f, "cpsie.w\t%{B:%7'a%6'i%5'f%}%X"},
4554
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4555
    0xf3af8600, 0xffffff1f, "cpsid.w\t%{B:%7'a%6'i%5'f%}%X"},
4556
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4557
    0xf3c08f00, 0xfff0ffff, "bxj%c\t%16-19r%x"},
4558
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4559
    0xe810c000, 0xffd0ffff, "rfedb%c\t%16-19r%21'!"},
4560
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4561
    0xe990c000, 0xffd0ffff, "rfeia%c\t%16-19r%21'!"},
4562
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4563
    0xf3e08000, 0xffe0f000, "mrs%c\t%8-11r, %D"},
4564
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4565
    0xf3af8100, 0xffffffe0, "cps\t%{I:#%0-4d%}%X"},
4566
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4567
    0xe8d0f000, 0xfff0fff0, "tbb%c\t[%16-19r, %0-3r]%x"},
4568
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4569
    0xe8d0f010, 0xfff0fff0, "tbh%c\t[%16-19r, %0-3r, %{B:lsl%} %{I:#1%}]%x"},
4570
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4571
    0xf3af8500, 0xffffff00, "cpsie\t%{B:%7'a%6'i%5'f%}, %{I:#%0-4d%}%X"},
4572
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4573
    0xf3af8700, 0xffffff00, "cpsid\t%{B:%7'a%6'i%5'f%}, %{I:#%0-4d%}%X"},
4574
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4575
    0xf3de8f00, 0xffffff00, "subs%c\t%{R:pc%}, %{R:lr%}, %{I:#%0-7d%}"},
4576
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4577
    0xf3808000, 0xffe0f000, "msr%c\t%C, %16-19r"},
4578
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_V6T2_V8M),
4579
    0xe8500f00, 0xfff00fff, "ldrex%c\t%12-15r, [%16-19r]"},
4580
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_V6T2_V8M),
4581
    0xe8d00f4f, 0xfff00fef, "ldrex%4?hb%c\t%12-15r, [%16-19r]"},
4582
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4583
    0xe800c000, 0xffd0ffe0, "srsdb%c\t%16-19r%21'!, %{I:#%0-4d%}"},
4584
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4585
    0xe980c000, 0xffd0ffe0, "srsia%c\t%16-19r%21'!, %{I:#%0-4d%}"},
4586
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4587
    0xfa0ff080, 0xfffff0c0, "sxth%c.w\t%8-11r, %0-3r%R"},
4588
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4589
    0xfa1ff080, 0xfffff0c0, "uxth%c.w\t%8-11r, %0-3r%R"},
4590
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4591
    0xfa2ff080, 0xfffff0c0, "sxtb16%c\t%8-11r, %0-3r%R"},
4592
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4593
    0xfa3ff080, 0xfffff0c0, "uxtb16%c\t%8-11r, %0-3r%R"},
4594
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4595
    0xfa4ff080, 0xfffff0c0, "sxtb%c.w\t%8-11r, %0-3r%R"},
4596
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4597
    0xfa5ff080, 0xfffff0c0, "uxtb%c.w\t%8-11r, %0-3r%R"},
4598
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_V6T2_V8M),
4599
    0xe8400000, 0xfff000ff, "strex%c\t%8-11r, %12-15r, [%16-19r]"},
4600
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4601
    0xe8d0007f, 0xfff000ff, "ldrexd%c\t%12-15r, %8-11r, [%16-19r]"},
4602
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4603
    0xfa80f000, 0xfff0f0f0, "sadd8%c\t%8-11r, %16-19r, %0-3r"},
4604
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4605
    0xfa80f010, 0xfff0f0f0, "qadd8%c\t%8-11r, %16-19r, %0-3r"},
4606
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4607
    0xfa80f020, 0xfff0f0f0, "shadd8%c\t%8-11r, %16-19r, %0-3r"},
4608
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4609
    0xfa80f040, 0xfff0f0f0, "uadd8%c\t%8-11r, %16-19r, %0-3r"},
4610
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4611
    0xfa80f050, 0xfff0f0f0, "uqadd8%c\t%8-11r, %16-19r, %0-3r"},
4612
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4613
    0xfa80f060, 0xfff0f0f0, "uhadd8%c\t%8-11r, %16-19r, %0-3r"},
4614
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4615
    0xfa80f080, 0xfff0f0f0, "qadd%c\t%8-11r, %0-3r, %16-19r"},
4616
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4617
    0xfa80f090, 0xfff0f0f0, "qdadd%c\t%8-11r, %0-3r, %16-19r"},
4618
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4619
    0xfa80f0a0, 0xfff0f0f0, "qsub%c\t%8-11r, %0-3r, %16-19r"},
4620
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4621
    0xfa80f0b0, 0xfff0f0f0, "qdsub%c\t%8-11r, %0-3r, %16-19r"},
4622
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4623
    0xfa90f000, 0xfff0f0f0, "sadd16%c\t%8-11r, %16-19r, %0-3r"},
4624
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4625
    0xfa90f010, 0xfff0f0f0, "qadd16%c\t%8-11r, %16-19r, %0-3r"},
4626
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4627
    0xfa90f020, 0xfff0f0f0, "shadd16%c\t%8-11r, %16-19r, %0-3r"},
4628
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4629
    0xfa90f040, 0xfff0f0f0, "uadd16%c\t%8-11r, %16-19r, %0-3r"},
4630
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4631
    0xfa90f050, 0xfff0f0f0, "uqadd16%c\t%8-11r, %16-19r, %0-3r"},
4632
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4633
    0xfa90f060, 0xfff0f0f0, "uhadd16%c\t%8-11r, %16-19r, %0-3r"},
4634
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4635
    0xfa90f080, 0xfff0f0f0, "rev%c.w\t%8-11r, %16-19r"},
4636
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4637
    0xfa90f090, 0xfff0f0f0, "rev16%c.w\t%8-11r, %16-19r"},
4638
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4639
    0xfa90f0a0, 0xfff0f0f0, "rbit%c\t%8-11r, %16-19r"},
4640
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4641
    0xfa90f0b0, 0xfff0f0f0, "revsh%c.w\t%8-11r, %16-19r"},
4642
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4643
    0xfaa0f000, 0xfff0f0f0, "sasx%c\t%8-11r, %16-19r, %0-3r"},
4644
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4645
    0xfaa0f010, 0xfff0f0f0, "qasx%c\t%8-11r, %16-19r, %0-3r"},
4646
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4647
    0xfaa0f020, 0xfff0f0f0, "shasx%c\t%8-11r, %16-19r, %0-3r"},
4648
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4649
    0xfaa0f040, 0xfff0f0f0, "uasx%c\t%8-11r, %16-19r, %0-3r"},
4650
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4651
    0xfaa0f050, 0xfff0f0f0, "uqasx%c\t%8-11r, %16-19r, %0-3r"},
4652
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4653
    0xfaa0f060, 0xfff0f0f0, "uhasx%c\t%8-11r, %16-19r, %0-3r"},
4654
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4655
    0xfaa0f080, 0xfff0f0f0, "sel%c\t%8-11r, %16-19r, %0-3r"},
4656
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4657
    0xfab0f080, 0xfff0f0f0, "clz%c\t%8-11r, %16-19r"},
4658
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4659
    0xfac0f000, 0xfff0f0f0, "ssub8%c\t%8-11r, %16-19r, %0-3r"},
4660
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4661
    0xfac0f010, 0xfff0f0f0, "qsub8%c\t%8-11r, %16-19r, %0-3r"},
4662
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4663
    0xfac0f020, 0xfff0f0f0, "shsub8%c\t%8-11r, %16-19r, %0-3r"},
4664
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4665
    0xfac0f040, 0xfff0f0f0, "usub8%c\t%8-11r, %16-19r, %0-3r"},
4666
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4667
    0xfac0f050, 0xfff0f0f0, "uqsub8%c\t%8-11r, %16-19r, %0-3r"},
4668
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4669
    0xfac0f060, 0xfff0f0f0, "uhsub8%c\t%8-11r, %16-19r, %0-3r"},
4670
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4671
    0xfad0f000, 0xfff0f0f0, "ssub16%c\t%8-11r, %16-19r, %0-3r"},
4672
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4673
    0xfad0f010, 0xfff0f0f0, "qsub16%c\t%8-11r, %16-19r, %0-3r"},
4674
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4675
    0xfad0f020, 0xfff0f0f0, "shsub16%c\t%8-11r, %16-19r, %0-3r"},
4676
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4677
    0xfad0f040, 0xfff0f0f0, "usub16%c\t%8-11r, %16-19r, %0-3r"},
4678
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4679
    0xfad0f050, 0xfff0f0f0, "uqsub16%c\t%8-11r, %16-19r, %0-3r"},
4680
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4681
    0xfad0f060, 0xfff0f0f0, "uhsub16%c\t%8-11r, %16-19r, %0-3r"},
4682
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4683
    0xfae0f000, 0xfff0f0f0, "ssax%c\t%8-11r, %16-19r, %0-3r"},
4684
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4685
    0xfae0f010, 0xfff0f0f0, "qsax%c\t%8-11r, %16-19r, %0-3r"},
4686
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4687
    0xfae0f020, 0xfff0f0f0, "shsax%c\t%8-11r, %16-19r, %0-3r"},
4688
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4689
    0xfae0f040, 0xfff0f0f0, "usax%c\t%8-11r, %16-19r, %0-3r"},
4690
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4691
    0xfae0f050, 0xfff0f0f0, "uqsax%c\t%8-11r, %16-19r, %0-3r"},
4692
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4693
    0xfae0f060, 0xfff0f0f0, "uhsax%c\t%8-11r, %16-19r, %0-3r"},
4694
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4695
    0xfb00f000, 0xfff0f0f0, "mul%c.w\t%8-11r, %16-19r, %0-3r"},
4696
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4697
    0xfb70f000, 0xfff0f0f0, "usad8%c\t%8-11r, %16-19r, %0-3r"},
4698
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4699
    0xfa00f000, 0xffe0f0f0, "lsl%20's%c.w\t%8-11R, %16-19R, %0-3R"},
4700
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4701
    0xfa20f000, 0xffe0f0f0, "lsr%20's%c.w\t%8-11R, %16-19R, %0-3R"},
4702
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4703
    0xfa40f000, 0xffe0f0f0, "asr%20's%c.w\t%8-11R, %16-19R, %0-3R"},
4704
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4705
    0xfa60f000, 0xffe0f0f0, "ror%20's%c.w\t%8-11r, %16-19r, %0-3r"},
4706
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_V6T2_V8M),
4707
    0xe8c00f40, 0xfff00fe0, "strex%4?hb%c\t%0-3r, %12-15r, [%16-19r]"},
4708
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4709
    0xf3200000, 0xfff0f0e0, "ssat16%c\t%8-11r, %{I:#%0-4D%}, %16-19r"},
4710
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4711
    0xf3a00000, 0xfff0f0e0, "usat16%c\t%8-11r, %{I:#%0-4d%}, %16-19r"},
4712
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4713
    0xfb20f000, 0xfff0f0e0, "smuad%4'x%c\t%8-11r, %16-19r, %0-3r"},
4714
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4715
    0xfb30f000, 0xfff0f0e0, "smulw%4?tb%c\t%8-11r, %16-19r, %0-3r"},
4716
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4717
    0xfb40f000, 0xfff0f0e0, "smusd%4'x%c\t%8-11r, %16-19r, %0-3r"},
4718
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4719
    0xfb50f000, 0xfff0f0e0, "smmul%4'r%c\t%8-11r, %16-19r, %0-3r"},
4720
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4721
    0xfa00f080, 0xfff0f0c0, "sxtah%c\t%8-11r, %16-19r, %0-3r%R"},
4722
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4723
    0xfa10f080, 0xfff0f0c0, "uxtah%c\t%8-11r, %16-19r, %0-3r%R"},
4724
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4725
    0xfa20f080, 0xfff0f0c0, "sxtab16%c\t%8-11r, %16-19r, %0-3r%R"},
4726
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4727
    0xfa30f080, 0xfff0f0c0, "uxtab16%c\t%8-11r, %16-19r, %0-3r%R"},
4728
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4729
    0xfa40f080, 0xfff0f0c0, "sxtab%c\t%8-11r, %16-19r, %0-3r%R"},
4730
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4731
    0xfa50f080, 0xfff0f0c0, "uxtab%c\t%8-11r, %16-19r, %0-3r%R"},
4732
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4733
    0xfb10f000, 0xfff0f0c0, "smul%5?tb%4?tb%c\t%8-11r, %16-19r, %0-3r"},
4734
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4735
    0xf36f0000, 0xffff8020, "bfc%c\t%8-11r, %E"},
4736
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4737
    0xea100f00, 0xfff08f00, "tst%c.w\t%16-19r, %S"},
4738
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4739
    0xea900f00, 0xfff08f00, "teq%c\t%16-19r, %S"},
4740
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4741
    0xeb100f00, 0xfff08f00, "cmn%c.w\t%16-19r, %S"},
4742
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4743
    0xebb00f00, 0xfff08f00, "cmp%c.w\t%16-19r, %S"},
4744
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4745
    0xf0100f00, 0xfbf08f00, "tst%c.w\t%16-19r, %M"},
4746
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4747
    0xf0900f00, 0xfbf08f00, "teq%c\t%16-19r, %M"},
4748
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4749
    0xf1100f00, 0xfbf08f00, "cmn%c.w\t%16-19r, %M"},
4750
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4751
    0xf1b00f00, 0xfbf08f00, "cmp%c.w\t%16-19r, %M"},
4752
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4753
    0xea4f0000, 0xffef8000, "mov%20's%c.w\t%8-11r, %S"},
4754
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4755
    0xea6f0000, 0xffef8000, "mvn%20's%c.w\t%8-11r, %S"},
4756
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4757
    0xe8c00070, 0xfff000f0, "strexd%c\t%0-3r, %12-15r, %8-11r, [%16-19r]"},
4758
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4759
    0xfb000000, 0xfff000f0, "mla%c\t%8-11r, %16-19r, %0-3r, %12-15r"},
4760
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4761
    0xfb000010, 0xfff000f0, "mls%c\t%8-11r, %16-19r, %0-3r, %12-15r"},
4762
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4763
    0xfb700000, 0xfff000f0, "usada8%c\t%8-11R, %16-19R, %0-3R, %12-15R"},
4764
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4765
    0xfb800000, 0xfff000f0, "smull%c\t%12-15R, %8-11R, %16-19R, %0-3R"},
4766
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4767
    0xfba00000, 0xfff000f0, "umull%c\t%12-15R, %8-11R, %16-19R, %0-3R"},
4768
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4769
    0xfbc00000, 0xfff000f0, "smlal%c\t%12-15R, %8-11R, %16-19R, %0-3R"},
4770
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4771
    0xfbe00000, 0xfff000f0, "umlal%c\t%12-15R, %8-11R, %16-19R, %0-3R"},
4772
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4773
    0xfbe00060, 0xfff000f0, "umaal%c\t%12-15R, %8-11R, %16-19R, %0-3R"},
4774
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_V6T2_V8M),
4775
    0xe8500f00, 0xfff00f00, "ldrex%c\t%12-15r, [%16-19r, %{I:#%0-7W%}]"},
4776
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4777
    0xf04f0000, 0xfbef8000, "mov%20's%c.w\t%8-11r, %M"},
4778
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4779
    0xf06f0000, 0xfbef8000, "mvn%20's%c.w\t%8-11r, %M"},
4780
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4781
    0xf810f000, 0xff70f000, "pld%c\t%a"},
4782
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4783
    0xfb200000, 0xfff000e0, "smlad%4'x%c\t%8-11R, %16-19R, %0-3R, %12-15R"},
4784
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4785
    0xfb300000, 0xfff000e0, "smlaw%4?tb%c\t%8-11R, %16-19R, %0-3R, %12-15R"},
4786
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4787
    0xfb400000, 0xfff000e0, "smlsd%4'x%c\t%8-11R, %16-19R, %0-3R, %12-15R"},
4788
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4789
    0xfb500000, 0xfff000e0, "smmla%4'r%c\t%8-11R, %16-19R, %0-3R, %12-15R"},
4790
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4791
    0xfb600000, 0xfff000e0, "smmls%4'r%c\t%8-11R, %16-19R, %0-3R, %12-15R"},
4792
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4793
    0xfbc000c0, 0xfff000e0, "smlald%4'x%c\t%12-15R, %8-11R, %16-19R, %0-3R"},
4794
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4795
    0xfbd000c0, 0xfff000e0, "smlsld%4'x%c\t%12-15R, %8-11R, %16-19R, %0-3R"},
4796
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4797
    0xeac00000, 0xfff08030, "pkhbt%c\t%8-11r, %16-19r, %S"},
4798
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4799
    0xeac00020, 0xfff08030, "pkhtb%c\t%8-11r, %16-19r, %S"},
4800
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4801
    0xf3400000, 0xfff08020, "sbfx%c\t%8-11r, %16-19r, %F"},
4802
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4803
    0xf3c00000, 0xfff08020, "ubfx%c\t%8-11r, %16-19r, %F"},
4804
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4805
    0xf8000e00, 0xff900f00, "str%wt%c\t%12-15r, %a"},
4806
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4807
    0xfb100000, 0xfff000c0,
4808
    "smla%5?tb%4?tb%c\t%8-11r, %16-19r, %0-3r, %12-15r"},
4809
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4810
    0xfbc00080, 0xfff000c0,
4811
    "smlal%5?tb%4?tb%c\t%12-15r, %8-11r, %16-19r, %0-3r"},
4812
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4813
    0xf3600000, 0xfff08020, "bfi%c\t%8-11r, %16-19r, %E"},
4814
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4815
    0xf8100e00, 0xfe900f00, "ldr%wt%c\t%12-15r, %a"},
4816
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4817
    0xf3000000, 0xffd08020, "ssat%c\t%8-11r, %{I:#%0-4D%}, %16-19r%s"},
4818
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4819
    0xf3800000, 0xffd08020, "usat%c\t%8-11r, %{I:#%0-4d%}, %16-19r%s"},
4820
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4821
    0xf2000000, 0xfbf08000, "addw%c\t%8-11r, %16-19r, %I"},
4822
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_V6T2_V8M),
4823
    0xf2400000, 0xfbf08000, "movw%c\t%8-11r, %J"},
4824
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4825
    0xf2a00000, 0xfbf08000, "subw%c\t%8-11r, %16-19r, %I"},
4826
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_V6T2_V8M),
4827
    0xf2c00000, 0xfbf08000, "movt%c\t%8-11r, %J"},
4828
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4829
    0xea000000, 0xffe08000, "and%20's%c.w\t%8-11r, %16-19r, %S"},
4830
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4831
    0xea200000, 0xffe08000, "bic%20's%c.w\t%8-11r, %16-19r, %S"},
4832
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4833
    0xea400000, 0xffe08000, "orr%20's%c.w\t%8-11r, %16-19r, %S"},
4834
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4835
    0xea600000, 0xffe08000, "orn%20's%c\t%8-11r, %16-19r, %S"},
4836
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4837
    0xea800000, 0xffe08000, "eor%20's%c.w\t%8-11r, %16-19r, %S"},
4838
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4839
    0xeb000000, 0xffe08000, "add%20's%c.w\t%8-11r, %16-19r, %S"},
4840
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4841
    0xeb400000, 0xffe08000, "adc%20's%c.w\t%8-11r, %16-19r, %S"},
4842
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4843
    0xeb600000, 0xffe08000, "sbc%20's%c.w\t%8-11r, %16-19r, %S"},
4844
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4845
    0xeba00000, 0xffe08000, "sub%20's%c.w\t%8-11r, %16-19r, %S"},
4846
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4847
    0xebc00000, 0xffe08000, "rsb%20's%c\t%8-11r, %16-19r, %S"},
4848
  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_V6T2_V8M),
4849
    0xe8400000, 0xfff00000, "strex%c\t%8-11r, %12-15r, [%16-19r, %{I:#%0-7W%}]"},
4850
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4851
    0xf0000000, 0xfbe08000, "and%20's%c.w\t%8-11r, %16-19r, %M"},
4852
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4853
    0xf0200000, 0xfbe08000, "bic%20's%c.w\t%8-11r, %16-19r, %M"},
4854
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4855
    0xf0400000, 0xfbe08000, "orr%20's%c.w\t%8-11r, %16-19r, %M"},
4856
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4857
    0xf0600000, 0xfbe08000, "orn%20's%c\t%8-11r, %16-19r, %M"},
4858
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4859
    0xf0800000, 0xfbe08000, "eor%20's%c.w\t%8-11r, %16-19r, %M"},
4860
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4861
    0xf1000000, 0xfbe08000, "add%20's%c.w\t%8-11r, %16-19r, %M"},
4862
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4863
    0xf1400000, 0xfbe08000, "adc%20's%c.w\t%8-11r, %16-19r, %M"},
4864
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4865
    0xf1600000, 0xfbe08000, "sbc%20's%c.w\t%8-11r, %16-19r, %M"},
4866
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4867
    0xf1a00000, 0xfbe08000, "sub%20's%c.w\t%8-11r, %16-19r, %M"},
4868
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4869
    0xf1c00000, 0xfbe08000, "rsb%20's%c\t%8-11r, %16-19r, %M"},
4870
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4871
    0xe8800000, 0xffd00000, "stmia%c.w\t%16-19r%21'!, %m"},
4872
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4873
    0xe8900000, 0xffd00000, "ldmia%c.w\t%16-19r%21'!, %m"},
4874
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4875
    0xe9000000, 0xffd00000, "stmdb%c\t%16-19r%21'!, %m"},
4876
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4877
    0xe9100000, 0xffd00000, "ldmdb%c\t%16-19r%21'!, %m"},
4878
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4879
    0xe9c00000, 0xffd000ff, "strd%c\t%12-15r, %8-11r, [%16-19r]"},
4880
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4881
    0xe9d00000, 0xffd000ff, "ldrd%c\t%12-15r, %8-11r, [%16-19r]"},
4882
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4883
    0xe9400000, 0xff500000,
4884
    "strd%c\t%12-15r, %8-11r, [%16-19r, %{I:#%23`-%0-7W%}]%21'!%L"},
4885
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4886
    0xe9500000, 0xff500000,
4887
    "ldrd%c\t%12-15r, %8-11r, [%16-19r, %{I:#%23`-%0-7W%}]%21'!%L"},
4888
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4889
    0xe8600000, 0xff700000,
4890
    "strd%c\t%12-15r, %8-11r, [%16-19r], %{I:#%23`-%0-7W%}%L"},
4891
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4892
    0xe8700000, 0xff700000,
4893
    "ldrd%c\t%12-15r, %8-11r, [%16-19r], %{I:#%23`-%0-7W%}%L"},
4894
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4895
    0xf8000000, 0xff100000, "str%w%c.w\t%12-15r, %a"},
4896
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4897
    0xf8100000, 0xfe100000, "ldr%w%c.w\t%12-15r, %a"},
4898
4899
  /* Filter out Bcc with cond=E or F, which are used for other instructions.  */
4900
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4901
    0xf3c08000, 0xfbc0d000, "undefined (bcc, cond=0xF)"},
4902
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4903
    0xf3808000, 0xfbc0d000, "undefined (bcc, cond=0xE)"},
4904
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4905
    0xf0008000, 0xf800d000, "b%22-25c.w\t%b%X"},
4906
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
4907
    0xf0009000, 0xf800d000, "b%c.w\t%B%x"},
4908
4909
  /* These have been 32-bit since the invention of Thumb.  */
4910
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V4T),
4911
     0xf000c000, 0xf800d001, "blx%c\t%B%x"},
4912
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V4T),
4913
     0xf000d000, 0xf800d000, "bl%c\t%B%x"},
4914
4915
  /* Fallback.  */
4916
  {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
4917
      0x00000000, 0x00000000, UNDEFINED_INSTRUCTION},
4918
  {ARM_FEATURE_CORE_LOW (0), 0, 0, 0}
4919
};
4920
4921
static const char *const arm_conditional[] =
4922
{"eq", "ne", "cs", "cc", "mi", "pl", "vs", "vc",
4923
 "hi", "ls", "ge", "lt", "gt", "le", "al", "<und>", ""};
4924
4925
static const char *const arm_shift[] =
4926
{"lsl", "lsr", "asr", "ror"};
4927
4928
typedef struct
4929
{
4930
  const char *name;
4931
  const char *description;
4932
  const char *reg_names[16];
4933
}
4934
arm_regname;
4935
4936
static const arm_regname regnames[] =
4937
{
4938
  { "reg-names-raw", N_("Select raw register names"),
4939
    { "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15"}},
4940
  { "reg-names-gcc", N_("Select register names used by GCC"),
4941
    { "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", "r8", "r9", "sl",  "fp",  "ip",  "sp",  "lr",  "pc" }},
4942
  { "reg-names-std", N_("Select register names used in ARM's ISA documentation"),
4943
    { "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", "r8", "r9", "r10", "r11", "r12", "sp",  "lr",  "pc" }},
4944
  { "force-thumb", N_("Assume all insns are Thumb insns"), {NULL} },
4945
  { "no-force-thumb", N_("Examine preceding label to determine an insn's type"), {NULL} },
4946
  { "reg-names-apcs", N_("Select register names used in the APCS"),
4947
    { "a1", "a2", "a3", "a4", "v1", "v2", "v3", "v4", "v5", "v6", "sl",  "fp",  "ip",  "sp",  "lr",  "pc" }},
4948
  { "reg-names-atpcs", N_("Select register names used in the ATPCS"),
4949
    { "a1", "a2", "a3", "a4", "v1", "v2", "v3", "v4", "v5", "v6", "v7",  "v8",  "IP",  "SP",  "LR",  "PC" }},
4950
  { "reg-names-special-atpcs", N_("Select special register names used in the ATPCS"),
4951
    { "a1", "a2", "a3", "a4", "v1", "v2", "v3", "WR", "v5", "SB", "SL",  "FP",  "IP",  "SP",  "LR",  "PC" }},
4952
  { "coproc<N>=(cde|generic)", N_("Enable CDE extensions for coprocessor N space"), { NULL } }
4953
};
4954
4955
static const char *const iwmmxt_wwnames[] =
4956
{"b", "h", "w", "d"};
4957
4958
static const char *const iwmmxt_wwssnames[] =
4959
{"b", "bus", "bc", "bss",
4960
 "h", "hus", "hc", "hss",
4961
 "w", "wus", "wc", "wss",
4962
 "d", "dus", "dc", "dss"
4963
};
4964
4965
static const char *const iwmmxt_regnames[] =
4966
{ "wr0", "wr1", "wr2", "wr3", "wr4", "wr5", "wr6", "wr7",
4967
  "wr8", "wr9", "wr10", "wr11", "wr12", "wr13", "wr14", "wr15"
4968
};
4969
4970
static const char *const iwmmxt_cregnames[] =
4971
{ "wcid", "wcon", "wcssf", "wcasf", "reserved", "reserved", "reserved", "reserved",
4972
  "wcgr0", "wcgr1", "wcgr2", "wcgr3", "reserved", "reserved", "reserved", "reserved"
4973
};
4974
4975
static const char *const vec_condnames[] =
4976
{ "eq", "ne", "cs", "hi", "ge", "lt", "gt", "le"
4977
};
4978
4979
static const char *const mve_predicatenames[] =
4980
{ "", "ttt", "tt", "tte", "t", "tee", "te", "tet", "",
4981
  "eee", "ee", "eet", "e", "ett", "et", "ete"
4982
};
4983
4984
/* Names for 2-bit size field for mve vector isntructions.  */
4985
static const char *const mve_vec_sizename[] =
4986
  { "8", "16", "32", "64"};
4987
4988
/* Indicates whether we are processing a then predicate,
4989
   else predicate or none at all.  */
4990
enum vpt_pred_state
4991
{
4992
  PRED_NONE,
4993
  PRED_THEN,
4994
  PRED_ELSE
4995
};
4996
4997
/* Information used to process a vpt block and subsequent instructions.  */
4998
struct vpt_block
4999
{
5000
  /* Are we in a vpt block.  */
5001
  bool in_vpt_block;
5002
5003
  /* Next predicate state if in vpt block.  */
5004
  enum vpt_pred_state next_pred_state;
5005
5006
  /* Mask from vpt/vpst instruction.  */
5007
  long predicate_mask;
5008
5009
  /* Instruction number in vpt block.  */
5010
  long current_insn_num;
5011
5012
  /* Number of instructions in vpt block..   */
5013
  long num_pred_insn;
5014
};
5015
5016
static struct vpt_block vpt_block_state =
5017
{
5018
  false,
5019
  PRED_NONE,
5020
  0,
5021
  0,
5022
  0
5023
};
5024
5025
/* Default to GCC register name set.  */
5026
static unsigned int regname_selected = 1;
5027
5028
4.77k
#define NUM_ARM_OPTIONS   ARRAY_SIZE (regnames)
5029
15.0M
#define arm_regnames      regnames[regname_selected].reg_names
5030
5031
static bool force_thumb = false;
5032
static uint16_t cde_coprocs = 0;
5033
5034
/* Current IT instruction state.  This contains the same state as the IT
5035
   bits in the CPSR.  */
5036
static unsigned int ifthen_state;
5037
/* IT state for the next instruction.  */
5038
static unsigned int ifthen_next_state;
5039
/* The address of the insn for which the IT state is valid.  */
5040
static bfd_vma ifthen_address;
5041
6.46M
#define IFTHEN_COND ((ifthen_state >> 4) & 0xf)
5042
/* Indicates that the current Conditional state is unconditional or outside
5043
   an IT block.  */
5044
431M
#define COND_UNCOND 16
5045
5046

5047
/* Functions.  */
5048
/* Extract the predicate mask for a VPT or VPST instruction.
5049
   The mask is composed of bits 13-15 (Mkl) and bit 22 (Mkh).  */
5050
5051
static long
5052
mve_extract_pred_mask (long given)
5053
21.4k
{
5054
21.4k
  return ((given & 0x00400000) >> 19) | ((given & 0xe000) >> 13);
5055
21.4k
}
5056
5057
/* Return the number of instructions in a MVE predicate block.  */
5058
static long
5059
num_instructions_vpt_block (long given)
5060
5.08k
{
5061
5.08k
  long mask = mve_extract_pred_mask (given);
5062
5.08k
  if (mask == 0)
5063
0
    return 0;
5064
5065
5.08k
  if (mask == 8)
5066
1.43k
    return 1;
5067
5068
3.65k
  if ((mask & 7) == 4)
5069
1.05k
    return 2;
5070
5071
2.59k
  if ((mask & 3) == 2)
5072
634
    return 3;
5073
5074
1.96k
  if ((mask & 1) == 1)
5075
1.96k
    return 4;
5076
5077
0
  return 0;
5078
1.96k
}
5079
5080
static void
5081
mark_outside_vpt_block (void)
5082
5.08k
{
5083
5.08k
  vpt_block_state.in_vpt_block = false;
5084
5.08k
  vpt_block_state.next_pred_state = PRED_NONE;
5085
5.08k
  vpt_block_state.predicate_mask = 0;
5086
5.08k
  vpt_block_state.current_insn_num = 0;
5087
5.08k
  vpt_block_state.num_pred_insn = 0;
5088
5.08k
}
5089
5090
static void
5091
mark_inside_vpt_block (long given)
5092
5.08k
{
5093
5.08k
  vpt_block_state.in_vpt_block = true;
5094
5.08k
  vpt_block_state.next_pred_state = PRED_THEN;
5095
5.08k
  vpt_block_state.predicate_mask = mve_extract_pred_mask (given);
5096
5.08k
  vpt_block_state.current_insn_num = 0;
5097
5.08k
  vpt_block_state.num_pred_insn = num_instructions_vpt_block (given);
5098
5.08k
  assert (vpt_block_state.num_pred_insn >= 1);
5099
5.08k
}
5100
5101
static enum vpt_pred_state
5102
invert_next_predicate_state (enum vpt_pred_state astate)
5103
4.83k
{
5104
4.83k
  if (astate == PRED_THEN)
5105
2.94k
    return PRED_ELSE;
5106
1.88k
  else if (astate == PRED_ELSE)
5107
1.88k
    return PRED_THEN;
5108
0
  else
5109
0
    return PRED_NONE;
5110
4.83k
}
5111
5112
static enum vpt_pred_state
5113
update_next_predicate_state (void)
5114
8.21k
{
5115
8.21k
  long pred_mask = vpt_block_state.predicate_mask;
5116
8.21k
  long mask_for_insn = 0;
5117
5118
8.21k
  switch (vpt_block_state.current_insn_num)
5119
8.21k
    {
5120
3.65k
    case 1:
5121
3.65k
      mask_for_insn = 8;
5122
3.65k
      break;
5123
5124
2.59k
    case 2:
5125
2.59k
      mask_for_insn = 4;
5126
2.59k
      break;
5127
5128
1.96k
    case 3:
5129
1.96k
      mask_for_insn = 2;
5130
1.96k
      break;
5131
5132
0
    case 4:
5133
0
      return PRED_NONE;
5134
8.21k
    }
5135
5136
8.21k
  if (pred_mask & mask_for_insn)
5137
4.83k
    return invert_next_predicate_state (vpt_block_state.next_pred_state);
5138
3.38k
  else
5139
3.38k
    return vpt_block_state.next_pred_state;
5140
8.21k
}
5141
5142
static void
5143
update_vpt_block_state (void)
5144
13.3k
{
5145
13.3k
  vpt_block_state.current_insn_num++;
5146
13.3k
  if (vpt_block_state.current_insn_num == vpt_block_state.num_pred_insn)
5147
5.08k
    {
5148
      /* No more instructions to process in vpt block.  */
5149
5.08k
      mark_outside_vpt_block ();
5150
5.08k
      return;
5151
5.08k
    }
5152
5153
8.21k
  vpt_block_state.next_pred_state = update_next_predicate_state ();
5154
8.21k
}
5155
5156
/* Decode a bitfield of the form matching regexp (N(-N)?,)*N(-N)?.
5157
   Returns pointer to following character of the format string and
5158
   fills in *VALUEP and *WIDTHP with the extracted value and number of
5159
   bits extracted.  WIDTHP can be NULL.  */
5160
5161
static const char *
5162
arm_decode_bitfield (const char *ptr,
5163
         unsigned long insn,
5164
         unsigned long *valuep,
5165
         int *widthp)
5166
11.5M
{
5167
11.5M
  unsigned long value = 0;
5168
11.5M
  int width = 0;
5169
5170
11.5M
  do
5171
12.0M
    {
5172
12.0M
      int start, end;
5173
12.0M
      int bits;
5174
5175
33.7M
      for (start = 0; *ptr >= '0' && *ptr <= '9'; ptr++)
5176
21.6M
  start = start * 10 + *ptr - '0';
5177
12.0M
      if (*ptr == '-')
5178
23.2M
  for (end = 0, ptr++; *ptr >= '0' && *ptr <= '9'; ptr++)
5179
15.2M
    end = end * 10 + *ptr - '0';
5180
4.09M
      else
5181
4.09M
  end = start;
5182
12.0M
      bits = end - start;
5183
12.0M
      if (bits < 0)
5184
0
  abort ();
5185
12.0M
      value |= ((insn >> start) & ((2ul << bits) - 1)) << width;
5186
12.0M
      width += bits + 1;
5187
12.0M
    }
5188
12.0M
  while (*ptr++ == ',');
5189
11.5M
  *valuep = value;
5190
11.5M
  if (widthp)
5191
11.5M
    *widthp = width;
5192
11.5M
  return ptr - 1;
5193
11.5M
}
5194
5195
static void
5196
arm_decode_shift (long given, fprintf_styled_ftype func, void *stream,
5197
      bool print_shift)
5198
1.60M
{
5199
1.60M
  func (stream, dis_style_register, "%s", arm_regnames[given & 0xf]);
5200
5201
1.60M
  if ((given & 0xff0) != 0)
5202
914k
    {
5203
914k
      if ((given & 0x10) == 0)
5204
701k
  {
5205
701k
    int amount = (given & 0xf80) >> 7;
5206
701k
    int shift = (given & 0x60) >> 5;
5207
5208
701k
    if (amount == 0)
5209
72.3k
      {
5210
72.3k
        if (shift == 3)
5211
14.6k
    {
5212
14.6k
      func (stream, dis_style_text, ", ");
5213
14.6k
      func (stream, dis_style_sub_mnemonic, "rrx");
5214
14.6k
      return;
5215
14.6k
    }
5216
5217
57.6k
        amount = 32;
5218
57.6k
      }
5219
5220
686k
    if (print_shift)
5221
685k
      {
5222
685k
        func (stream, dis_style_text, ", ");
5223
685k
        func (stream, dis_style_sub_mnemonic, "%s ", arm_shift[shift]);
5224
685k
        func (stream, dis_style_immediate, "#%d", amount);
5225
685k
      }
5226
1.06k
    else
5227
1.06k
      {
5228
1.06k
        func (stream, dis_style_text, ", ");
5229
1.06k
        func (stream, dis_style_immediate, "#%d", amount);
5230
1.06k
      }
5231
686k
  }
5232
212k
      else if ((given & 0x80) == 0x80)
5233
1.79k
  func (stream, dis_style_comment_start,
5234
1.79k
        "\t@ <illegal shifter operand>");
5235
211k
      else if (print_shift)
5236
210k
  {
5237
210k
    func (stream, dis_style_text, ", ");
5238
210k
    func (stream, dis_style_sub_mnemonic, "%s ",
5239
210k
    arm_shift[(given & 0x60) >> 5]);
5240
210k
    func (stream, dis_style_register, "%s",
5241
210k
    arm_regnames[(given & 0xf00) >> 8]);
5242
210k
  }
5243
258
      else
5244
258
  {
5245
258
    func (stream, dis_style_text, ", ");
5246
258
    func (stream, dis_style_register, "%s",
5247
258
    arm_regnames[(given & 0xf00) >> 8]);
5248
258
  }
5249
914k
    }
5250
1.60M
}
5251
5252
/* Return TRUE if the MATCHED_INSN can be inside an IT block.  */
5253
5254
static bool
5255
is_mve_okay_in_it (enum mve_instructions matched_insn)
5256
11.3k
{
5257
11.3k
  switch (matched_insn)
5258
11.3k
    {
5259
247
    case MVE_VMOV_GP_TO_VEC_LANE:
5260
686
    case MVE_VMOV2_VEC_LANE_TO_GP:
5261
1.18k
    case MVE_VMOV2_GP_TO_VEC_LANE:
5262
1.52k
    case MVE_VMOV_VEC_LANE_TO_GP:
5263
1.79k
    case MVE_LSLL:
5264
2.60k
    case MVE_LSLLI:
5265
3.18k
    case MVE_LSRL:
5266
3.72k
    case MVE_ASRL:
5267
4.17k
    case MVE_ASRLI:
5268
4.51k
    case MVE_SQRSHRL:
5269
4.83k
    case MVE_SQRSHR:
5270
5.17k
    case MVE_UQRSHL:
5271
5.76k
    case MVE_UQRSHLL:
5272
6.26k
    case MVE_UQSHL:
5273
6.58k
    case MVE_UQSHLL:
5274
6.96k
    case MVE_URSHRL:
5275
7.27k
    case MVE_URSHR:
5276
7.54k
    case MVE_SRSHRL:
5277
7.79k
    case MVE_SRSHR:
5278
8.05k
    case MVE_SQSHLL:
5279
9.53k
    case MVE_SQSHL:
5280
9.53k
      return true;
5281
1.84k
    default:
5282
1.84k
      return false;
5283
11.3k
    }
5284
11.3k
}
5285
5286
static bool
5287
is_v81m_architecture (struct disassemble_info *info)
5288
916k
{
5289
916k
  struct arm_private_data *private_data = info->private_data;
5290
916k
  arm_feature_set allowed_arches = private_data->features;
5291
5292
916k
  arm_feature_set arm_ext_v8_1m_main
5293
916k
    = ARM_FEATURE_CORE_HIGH (ARM_EXT2_V8_1M_MAIN);
5294
5295
916k
  if (ARM_CPU_HAS_FEATURE (arm_ext_v8_1m_main, allowed_arches)
5296
785k
      && !ARM_CPU_IS_ANY (allowed_arches))
5297
649k
    return true;
5298
267k
  else
5299
267k
    return false;
5300
916k
}
5301
5302
static bool
5303
is_vpt_instruction (long given)
5304
149k
{
5305
5306
  /* If mkh:mkl is '0000' then its not a vpt/vpst instruction.  */
5307
149k
  if ((given & 0x0040e000) == 0)
5308
13.9k
    return false;
5309
5310
  /* VPT floating point T1 variant.  */
5311
135k
  if (((given & 0xefb10f50) == 0xee310f00 && ((given & 0x1001) != 0x1))
5312
  /* VPT floating point T2 variant.  */
5313
134k
      || ((given & 0xefb10f50) == 0xee310f40)
5314
  /* VPT vector T1 variant.  */
5315
134k
      || ((given & 0xff811f51) == 0xfe010f00)
5316
  /* VPT vector T2 variant.  */
5317
133k
      || ((given & 0xff811f51) == 0xfe010f01
5318
898
    && ((given & 0x300000) != 0x300000))
5319
  /* VPT vector T3 variant.  */
5320
133k
      || ((given & 0xff811f50) == 0xfe011f00)
5321
  /* VPT vector T4 variant.  */
5322
132k
      || ((given & 0xff811f70) == 0xfe010f40)
5323
  /* VPT vector T5 variant.  */
5324
131k
      || ((given & 0xff811f70) == 0xfe010f60)
5325
  /* VPT vector T6 variant.  */
5326
131k
      || ((given & 0xff811f50) == 0xfe011f40)
5327
  /* VPST vector T variant.  */
5328
130k
      || ((given & 0xffbf1fff) == 0xfe310f4d))
5329
5.08k
    return true;
5330
130k
  else
5331
130k
    return false;
5332
135k
}
5333
5334
/* Decode a bitfield from opcode GIVEN, with starting bitfield = START
5335
   and ending bitfield = END.  END must be greater than START.  */
5336
5337
static unsigned long
5338
arm_decode_field (unsigned long given, unsigned int start, unsigned int end)
5339
621k
{
5340
621k
  int bits = end - start;
5341
5342
621k
  if (bits < 0)
5343
0
    abort ();
5344
5345
621k
  return ((given >> start) & ((2ul << bits) - 1));
5346
621k
}
5347
5348
/* Decode a bitfield from opcode GIVEN, with multiple bitfields:
5349
   START:END and START2:END2.  END/END2 must be greater than
5350
   START/START2.  */
5351
5352
static unsigned long
5353
arm_decode_field_multiple (unsigned long given, unsigned int start,
5354
         unsigned int end, unsigned int start2,
5355
         unsigned int end2)
5356
66.0k
{
5357
66.0k
  int bits = end - start;
5358
66.0k
  int bits2 = end2 - start2;
5359
66.0k
  unsigned long value = 0;
5360
66.0k
  int width = 0;
5361
5362
66.0k
  if (bits2 < 0)
5363
0
    abort ();
5364
5365
66.0k
  value = arm_decode_field (given, start, end);
5366
66.0k
  width += bits + 1;
5367
5368
66.0k
  value |= ((given >> start2) & ((2ul << bits2) - 1)) << width;
5369
66.0k
  return value;
5370
66.0k
}
5371
5372
/* Return TRUE if the GIVEN encoding should not be decoded as MATCHED_INSN.
5373
   This helps us decode instructions that change mnemonic depending on specific
5374
   operand values/encodings.  */
5375
5376
static bool
5377
is_mve_encoding_conflict (unsigned long given,
5378
        enum mve_instructions matched_insn)
5379
219k
{
5380
219k
  switch (matched_insn)
5381
219k
    {
5382
809
    case MVE_VPST:
5383
809
      if (arm_decode_field_multiple (given, 13, 15, 22, 22) == 0)
5384
594
  return true;
5385
215
      else
5386
215
  return false;
5387
5388
3.64k
    case MVE_VPT_FP_T1:
5389
3.64k
      if (arm_decode_field_multiple (given, 13, 15, 22, 22) == 0)
5390
944
  return true;
5391
2.69k
      if ((arm_decode_field (given, 12, 12) == 0)
5392
1.18k
    && (arm_decode_field (given, 0, 0) == 1))
5393
681
  return true;
5394
2.01k
      return false;
5395
5396
3.79k
    case MVE_VPT_FP_T2:
5397
3.79k
      if (arm_decode_field_multiple (given, 13, 15, 22, 22) == 0)
5398
1.47k
  return true;
5399
2.32k
      if (arm_decode_field (given, 0, 3) == 0xd)
5400
323
  return true;
5401
1.99k
      return false;
5402
5403
1.96k
    case MVE_VPT_VEC_T1:
5404
4.09k
    case MVE_VPT_VEC_T2:
5405
5.77k
    case MVE_VPT_VEC_T3:
5406
8.27k
    case MVE_VPT_VEC_T4:
5407
9.74k
    case MVE_VPT_VEC_T5:
5408
11.4k
    case MVE_VPT_VEC_T6:
5409
11.4k
      if (arm_decode_field_multiple (given, 13, 15, 22, 22) == 0)
5410
3.67k
  return true;
5411
7.77k
      if (arm_decode_field (given, 20, 21) == 3)
5412
725
  return true;
5413
7.04k
      return false;
5414
5415
944
    case MVE_VCMP_FP_T1:
5416
944
      if ((arm_decode_field (given, 12, 12) == 0)
5417
740
    && (arm_decode_field (given, 0, 0) == 1))
5418
404
  return true;
5419
540
      else
5420
540
  return false;
5421
5422
1.47k
    case MVE_VCMP_FP_T2:
5423
1.47k
      if (arm_decode_field (given, 0, 3) == 0xd)
5424
878
  return true;
5425
592
      else
5426
592
  return false;
5427
5428
1.98k
    case MVE_VQADD_T2:
5429
2.47k
    case MVE_VQSUB_T2:
5430
3.96k
    case MVE_VMUL_VEC_T2:
5431
5.14k
    case MVE_VMULH:
5432
7.46k
    case MVE_VRMULH:
5433
8.11k
    case MVE_VMLA:
5434
8.46k
    case MVE_VMAX:
5435
9.18k
    case MVE_VMIN:
5436
10.8k
    case MVE_VBRSR:
5437
11.2k
    case MVE_VADD_VEC_T2:
5438
11.6k
    case MVE_VSUB_VEC_T2:
5439
12.5k
    case MVE_VABAV:
5440
13.0k
    case MVE_VQRSHL_T1:
5441
13.2k
    case MVE_VQSHL_T4:
5442
13.9k
    case MVE_VRSHL_T1:
5443
14.3k
    case MVE_VSHL_T3:
5444
15.9k
    case MVE_VCADD_VEC:
5445
17.5k
    case MVE_VHCADD:
5446
18.7k
    case MVE_VDDUP:
5447
19.2k
    case MVE_VIDUP:
5448
20.1k
    case MVE_VQRDMLADH:
5449
20.8k
    case MVE_VQDMLAH:
5450
21.2k
    case MVE_VQRDMLAH:
5451
21.6k
    case MVE_VQDMLASH:
5452
22.3k
    case MVE_VQRDMLASH:
5453
22.7k
    case MVE_VQDMLSDH:
5454
24.0k
    case MVE_VQRDMLSDH:
5455
24.6k
    case MVE_VQDMULH_T3:
5456
25.3k
    case MVE_VQRDMULH_T4:
5457
25.8k
    case MVE_VQDMLADH:
5458
26.2k
    case MVE_VMLAS:
5459
29.1k
    case MVE_VMULL_INT:
5460
30.1k
    case MVE_VHADD_T2:
5461
30.9k
    case MVE_VHSUB_T2:
5462
31.2k
    case MVE_VCMP_VEC_T1:
5463
31.7k
    case MVE_VCMP_VEC_T2:
5464
32.0k
    case MVE_VCMP_VEC_T3:
5465
33.2k
    case MVE_VCMP_VEC_T4:
5466
33.6k
    case MVE_VCMP_VEC_T5:
5467
33.9k
    case MVE_VCMP_VEC_T6:
5468
33.9k
      if (arm_decode_field (given, 20, 21) == 3)
5469
7.72k
  return true;
5470
26.2k
      else
5471
26.2k
  return false;
5472
5473
1.02k
    case MVE_VLD2:
5474
1.37k
    case MVE_VLD4:
5475
2.72k
    case MVE_VST2:
5476
3.73k
    case MVE_VST4:
5477
3.73k
      if (arm_decode_field (given, 7, 8) == 3)
5478
498
  return true;
5479
3.23k
      else
5480
3.23k
  return false;
5481
5482
1.60k
    case MVE_VSTRB_T1:
5483
2.69k
    case MVE_VSTRH_T2:
5484
2.69k
      if ((arm_decode_field (given, 24, 24) == 0)
5485
2.12k
    && (arm_decode_field (given, 21, 21) == 0))
5486
1.11k
  {
5487
1.11k
      return true;
5488
1.11k
  }
5489
1.57k
      else if ((arm_decode_field (given, 7, 8) == 3))
5490
0
  return true;
5491
1.57k
      else
5492
1.57k
  return false;
5493
5494
1.48k
    case MVE_VLDRB_T1:
5495
2.58k
    case MVE_VLDRH_T2:
5496
3.57k
    case MVE_VLDRW_T7:
5497
5.29k
    case MVE_VSTRB_T5:
5498
6.26k
    case MVE_VSTRH_T6:
5499
7.31k
    case MVE_VSTRW_T7:
5500
7.31k
      if ((arm_decode_field (given, 24, 24) == 0)
5501
4.62k
    && (arm_decode_field (given, 21, 21) == 0))
5502
1.48k
  {
5503
1.48k
      return true;
5504
1.48k
  }
5505
5.83k
      else
5506
5.83k
  return false;
5507
5508
6.86k
    case MVE_VCVT_FP_FIX_VEC:
5509
6.86k
      return (arm_decode_field (given, 16, 21) & 0x38) == 0;
5510
5511
8.87k
    case MVE_VBIC_IMM:
5512
12.3k
    case MVE_VORR_IMM:
5513
12.3k
      {
5514
12.3k
  unsigned long cmode = arm_decode_field (given, 8, 11);
5515
5516
12.3k
  if ((cmode & 1) == 0)
5517
7.09k
    return true;
5518
5.25k
  else if ((cmode & 0xc) == 0xc)
5519
1.53k
    return true;
5520
3.72k
  else
5521
3.72k
    return false;
5522
12.3k
      }
5523
5524
3.86k
    case MVE_VMVN_IMM:
5525
3.86k
      {
5526
3.86k
  unsigned long cmode = arm_decode_field (given, 8, 11);
5527
5528
3.86k
  if (cmode == 0xe)
5529
0
    return true;
5530
3.86k
  else if ((cmode & 0x9) == 1)
5531
0
    return true;
5532
3.86k
  else if ((cmode & 0xd) == 9)
5533
0
    return true;
5534
3.86k
  else
5535
3.86k
    return false;
5536
3.86k
      }
5537
5538
7.80k
    case MVE_VMOV_IMM_TO_VEC:
5539
7.80k
      if ((arm_decode_field (given, 5, 5) == 1)
5540
4.66k
    && (arm_decode_field (given, 8, 11) != 0xe))
5541
3.72k
  return true;
5542
4.07k
      else
5543
4.07k
  return false;
5544
5545
1.10k
    case MVE_VMOVL:
5546
1.10k
      {
5547
1.10k
  unsigned long size = arm_decode_field (given, 19, 20);
5548
1.10k
  if ((size == 0) || (size == 3))
5549
0
    return true;
5550
1.10k
  else
5551
1.10k
    return false;
5552
1.10k
      }
5553
5554
771
    case MVE_VMAXA:
5555
1.53k
    case MVE_VMINA:
5556
2.07k
    case MVE_VMAXV:
5557
2.47k
    case MVE_VMAXAV:
5558
2.74k
    case MVE_VMINV:
5559
3.17k
    case MVE_VMINAV:
5560
3.47k
    case MVE_VQRSHL_T2:
5561
3.72k
    case MVE_VQSHL_T1:
5562
3.98k
    case MVE_VRSHL_T2:
5563
4.57k
    case MVE_VSHL_T2:
5564
4.94k
    case MVE_VSHLL_T2:
5565
5.26k
    case MVE_VADDV:
5566
5.66k
    case MVE_VMOVN:
5567
5.98k
    case MVE_VQMOVUN:
5568
6.44k
    case MVE_VQMOVN:
5569
6.44k
      if (arm_decode_field (given, 18, 19) == 3)
5570
1.03k
  return true;
5571
5.41k
      else
5572
5.41k
  return false;
5573
5574
1.09k
    case MVE_VMLSLDAV:
5575
1.83k
    case MVE_VRMLSLDAVH:
5576
3.88k
    case MVE_VMLALDAV:
5577
4.35k
    case MVE_VADDLV:
5578
4.35k
      if (arm_decode_field (given, 20, 22) == 7)
5579
1.37k
  return true;
5580
2.98k
      else
5581
2.98k
  return false;
5582
5583
1.89k
    case MVE_VRMLALDAVH:
5584
1.89k
      if ((arm_decode_field (given, 20, 22) & 6) == 6)
5585
205
  return true;
5586
1.69k
      else
5587
1.69k
  return false;
5588
5589
995
    case MVE_VDWDUP:
5590
2.95k
    case MVE_VIWDUP:
5591
2.95k
      if ((arm_decode_field (given, 20, 21) == 3)
5592
2.67k
    || (arm_decode_field (given, 1, 3) == 7))
5593
762
  return true;
5594
2.18k
      else
5595
2.18k
  return false;
5596
5597
5598
2.28k
    case MVE_VSHLL_T1:
5599
2.28k
      if (arm_decode_field (given, 16, 18) == 0)
5600
1.44k
  {
5601
1.44k
    unsigned long sz = arm_decode_field (given, 19, 20);
5602
5603
1.44k
    if ((sz == 1) || (sz == 2))
5604
1.10k
      return true;
5605
332
    else
5606
332
      return false;
5607
1.44k
  }
5608
843
      else
5609
843
  return false;
5610
5611
685
    case MVE_VQSHL_T2:
5612
2.02k
    case MVE_VQSHLU_T3:
5613
3.09k
    case MVE_VRSHR:
5614
4.41k
    case MVE_VSHL_T1:
5615
5.82k
    case MVE_VSHR:
5616
6.20k
    case MVE_VSLI:
5617
6.70k
    case MVE_VSRI:
5618
6.70k
      if (arm_decode_field (given, 19, 21) == 0)
5619
825
  return true;
5620
5.88k
      else
5621
5.88k
  return false;
5622
5623
623
    case MVE_VCTP:
5624
623
    if (arm_decode_field (given, 16, 19) == 0xf)
5625
216
      return true;
5626
407
    else
5627
407
      return false;
5628
5629
520
    case MVE_ASRLI:
5630
1.30k
    case MVE_ASRL:
5631
3.05k
    case MVE_LSLLI:
5632
3.55k
    case MVE_LSLL:
5633
4.67k
    case MVE_LSRL:
5634
5.99k
    case MVE_SQRSHRL:
5635
7.07k
    case MVE_SQSHLL:
5636
7.91k
    case MVE_SRSHRL:
5637
9.06k
    case MVE_UQRSHLL:
5638
9.81k
    case MVE_UQSHLL:
5639
10.8k
    case MVE_URSHRL:
5640
10.8k
      if (arm_decode_field (given, 9, 11) == 0x7)
5641
3.38k
  return true;
5642
7.47k
      else
5643
7.47k
  return false;
5644
5645
559
    case MVE_CSINC:
5646
1.70k
    case MVE_CSINV:
5647
1.70k
      {
5648
1.70k
  unsigned long rm, rn;
5649
1.70k
  rm = arm_decode_field (given, 0, 3);
5650
1.70k
  rn = arm_decode_field (given, 16, 19);
5651
  /* CSET/CSETM.  */
5652
1.70k
  if (rm == 0xf && rn == 0xf)
5653
328
    return true;
5654
  /* CINC/CINV.  */
5655
1.38k
  else if (rn == rm && rn != 0xf)
5656
440
    return true;
5657
1.70k
      }
5658
    /* Fall through.  */
5659
1.59k
    case MVE_CSEL:
5660
2.70k
    case MVE_CSNEG:
5661
2.70k
      if (arm_decode_field (given, 0, 3) == 0xd)
5662
371
  return true;
5663
      /* CNEG.  */
5664
2.33k
      else if (matched_insn == MVE_CSNEG)
5665
859
  if (arm_decode_field (given, 0, 3) == arm_decode_field (given, 16, 19))
5666
385
    return true;
5667
1.95k
      return false;
5668
5669
77.4k
    default:
5670
77.6k
    case MVE_VADD_FP_T1:
5671
78.0k
    case MVE_VADD_FP_T2:
5672
78.3k
    case MVE_VADD_VEC_T1:
5673
78.3k
      return false;
5674
5675
219k
    }
5676
219k
}
5677
5678
static void
5679
print_mve_vld_str_addr (struct disassemble_info *info,
5680
      unsigned long given,
5681
      enum mve_instructions matched_insn)
5682
9.28k
{
5683
9.28k
  void *stream = info->stream;
5684
9.28k
  fprintf_styled_ftype func = info->fprintf_styled_func;
5685
5686
9.28k
  unsigned long p, w, gpr, imm, add, mod_imm;
5687
5688
9.28k
  imm = arm_decode_field (given, 0, 6);
5689
9.28k
  mod_imm = imm;
5690
5691
9.28k
  switch (matched_insn)
5692
9.28k
    {
5693
865
    case MVE_VLDRB_T1:
5694
1.57k
    case MVE_VSTRB_T1:
5695
1.57k
      gpr = arm_decode_field (given, 16, 18);
5696
1.57k
      break;
5697
5698
651
    case MVE_VLDRH_T2:
5699
1.51k
    case MVE_VSTRH_T2:
5700
1.51k
      gpr = arm_decode_field (given, 16, 18);
5701
1.51k
      mod_imm = imm << 1;
5702
1.51k
      break;
5703
5704
1.47k
    case MVE_VLDRH_T6:
5705
2.28k
    case MVE_VSTRH_T6:
5706
2.28k
      gpr = arm_decode_field (given, 16, 19);
5707
2.28k
      mod_imm = imm << 1;
5708
2.28k
      break;
5709
5710
967
    case MVE_VLDRW_T7:
5711
1.84k
    case MVE_VSTRW_T7:
5712
1.84k
      gpr = arm_decode_field (given, 16, 19);
5713
1.84k
      mod_imm = imm << 2;
5714
1.84k
      break;
5715
5716
404
    case MVE_VLDRB_T5:
5717
2.07k
    case MVE_VSTRB_T5:
5718
2.07k
      gpr = arm_decode_field (given, 16, 19);
5719
2.07k
      break;
5720
5721
0
    default:
5722
0
      return;
5723
9.28k
    }
5724
5725
9.28k
  p = arm_decode_field (given, 24, 24);
5726
9.28k
  w = arm_decode_field (given, 21, 21);
5727
5728
9.28k
  add = arm_decode_field (given, 23, 23);
5729
5730
9.28k
  char * add_sub;
5731
5732
  /* Don't print anything for '+' as it is implied.  */
5733
9.28k
  if (add == 1)
5734
6.15k
    add_sub = "";
5735
3.13k
  else
5736
3.13k
    add_sub = "-";
5737
5738
9.28k
  func (stream, dis_style_text, "[");
5739
9.28k
  func (stream, dis_style_register, "%s", arm_regnames[gpr]);
5740
9.28k
  if (p == 1)
5741
4.32k
    {
5742
4.32k
      func (stream, dis_style_text, ", ");
5743
4.32k
      func (stream, dis_style_immediate, "#%s%lu", add_sub, mod_imm);
5744
      /* Offset mode.  */
5745
4.32k
      if (w == 0)
5746
1.72k
  func (stream, dis_style_text, "]");
5747
      /* Pre-indexed mode.  */
5748
2.59k
      else
5749
2.59k
  func (stream, dis_style_text, "]!");
5750
4.32k
    }
5751
4.95k
  else if ((p == 0) && (w == 1))
5752
4.47k
    {
5753
      /* Post-index mode.  */
5754
4.47k
      func (stream, dis_style_text, "], ");
5755
4.47k
      func (stream, dis_style_immediate, "#%s%lu", add_sub, mod_imm);
5756
4.47k
    }
5757
9.28k
}
5758
5759
/* Return FALSE if GIVEN is not an undefined encoding for MATCHED_INSN.
5760
   Otherwise, return TRUE and set UNDEFINED_CODE to give a reason as to why
5761
   this encoding is undefined.  */
5762
5763
static bool
5764
is_mve_undefined (unsigned long given, enum mve_instructions matched_insn,
5765
      enum mve_undefined *undefined_code)
5766
174k
{
5767
174k
  *undefined_code = UNDEF_NONE;
5768
5769
174k
  switch (matched_insn)
5770
174k
    {
5771
1.48k
    case MVE_VDUP:
5772
1.48k
      if (arm_decode_field_multiple (given, 5, 5, 22, 22) == 3)
5773
256
  {
5774
256
    *undefined_code = UNDEF_SIZE_3;
5775
256
    return true;
5776
256
  }
5777
1.22k
      else
5778
1.22k
  return false;
5779
5780
1.17k
    case MVE_VQADD_T1:
5781
1.41k
    case MVE_VQSUB_T1:
5782
1.87k
    case MVE_VMUL_VEC_T1:
5783
2.32k
    case MVE_VABD_VEC:
5784
2.64k
    case MVE_VADD_VEC_T1:
5785
2.99k
    case MVE_VSUB_VEC_T1:
5786
3.22k
    case MVE_VQDMULH_T1:
5787
3.71k
    case MVE_VQRDMULH_T2:
5788
4.74k
    case MVE_VRHADD:
5789
5.45k
    case MVE_VHADD_T1:
5790
5.92k
    case MVE_VHSUB_T1:
5791
5.92k
      if (arm_decode_field (given, 20, 21) == 3)
5792
652
  {
5793
652
    *undefined_code = UNDEF_SIZE_3;
5794
652
    return true;
5795
652
  }
5796
5.27k
      else
5797
5.27k
  return false;
5798
5799
865
    case MVE_VLDRB_T1:
5800
865
      if (arm_decode_field (given, 7, 8) == 3)
5801
224
  {
5802
224
    *undefined_code = UNDEF_SIZE_3;
5803
224
    return true;
5804
224
  }
5805
641
      else
5806
641
  return false;
5807
5808
651
    case MVE_VLDRH_T2:
5809
651
      if (arm_decode_field (given, 7, 8) <= 1)
5810
323
  {
5811
323
    *undefined_code = UNDEF_SIZE_LE_1;
5812
323
    return true;
5813
323
  }
5814
328
      else
5815
328
  return false;
5816
5817
713
    case MVE_VSTRB_T1:
5818
713
      if ((arm_decode_field (given, 7, 8) == 0))
5819
281
  {
5820
281
    *undefined_code = UNDEF_SIZE_0;
5821
281
    return true;
5822
281
  }
5823
432
      else
5824
432
  return false;
5825
5826
864
    case MVE_VSTRH_T2:
5827
864
      if ((arm_decode_field (given, 7, 8) <= 1))
5828
485
  {
5829
485
    *undefined_code = UNDEF_SIZE_LE_1;
5830
485
    return true;
5831
485
  }
5832
379
      else
5833
379
  return false;
5834
5835
1.32k
    case MVE_VLDRB_GATHER_T1:
5836
1.32k
      if (arm_decode_field (given, 7, 8) == 3)
5837
316
  {
5838
316
    *undefined_code = UNDEF_SIZE_3;
5839
316
    return true;
5840
316
  }
5841
1.01k
      else if ((arm_decode_field (given, 28, 28) == 0)
5842
772
         && (arm_decode_field (given, 7, 8) == 0))
5843
315
  {
5844
315
    *undefined_code = UNDEF_NOT_UNS_SIZE_0;
5845
315
    return true;
5846
315
  }
5847
696
      else
5848
696
  return false;
5849
5850
2.00k
    case MVE_VLDRH_GATHER_T2:
5851
2.00k
      if (arm_decode_field (given, 7, 8) == 3)
5852
975
  {
5853
975
    *undefined_code = UNDEF_SIZE_3;
5854
975
    return true;
5855
975
  }
5856
1.02k
      else if ((arm_decode_field (given, 28, 28) == 0)
5857
780
         && (arm_decode_field (given, 7, 8) == 1))
5858
229
  {
5859
229
    *undefined_code = UNDEF_NOT_UNS_SIZE_1;
5860
229
    return true;
5861
229
  }
5862
797
      else if (arm_decode_field (given, 7, 8) == 0)
5863
519
  {
5864
519
    *undefined_code = UNDEF_SIZE_0;
5865
519
    return true;
5866
519
  }
5867
278
      else
5868
278
  return false;
5869
5870
291
    case MVE_VLDRW_GATHER_T3:
5871
291
      if (arm_decode_field (given, 7, 8) != 2)
5872
0
  {
5873
0
    *undefined_code = UNDEF_SIZE_NOT_2;
5874
0
    return true;
5875
0
  }
5876
291
      else if (arm_decode_field (given, 28, 28) == 0)
5877
0
  {
5878
0
    *undefined_code = UNDEF_NOT_UNSIGNED;
5879
0
    return true;
5880
0
  }
5881
291
      else
5882
291
  return false;
5883
5884
611
    case MVE_VLDRD_GATHER_T4:
5885
611
      if (arm_decode_field (given, 7, 8) != 3)
5886
0
  {
5887
0
    *undefined_code = UNDEF_SIZE_NOT_3;
5888
0
    return true;
5889
0
  }
5890
611
      else if (arm_decode_field (given, 28, 28) == 0)
5891
371
  {
5892
371
    *undefined_code = UNDEF_NOT_UNSIGNED;
5893
371
    return true;
5894
371
  }
5895
240
      else
5896
240
  return false;
5897
5898
2.21k
    case MVE_VSTRB_SCATTER_T1:
5899
2.21k
      if (arm_decode_field (given, 7, 8) == 3)
5900
560
  {
5901
560
    *undefined_code = UNDEF_SIZE_3;
5902
560
    return true;
5903
560
  }
5904
1.65k
      else
5905
1.65k
  return false;
5906
5907
1.19k
    case MVE_VSTRH_SCATTER_T2:
5908
1.19k
      {
5909
1.19k
  unsigned long size = arm_decode_field (given, 7, 8);
5910
1.19k
  if (size == 3)
5911
470
    {
5912
470
      *undefined_code = UNDEF_SIZE_3;
5913
470
      return true;
5914
470
    }
5915
721
  else if (size == 0)
5916
292
    {
5917
292
      *undefined_code = UNDEF_SIZE_0;
5918
292
      return true;
5919
292
    }
5920
429
  else
5921
429
    return false;
5922
1.19k
      }
5923
5924
1.53k
    case MVE_VSTRW_SCATTER_T3:
5925
1.53k
      if (arm_decode_field (given, 7, 8) != 2)
5926
1.22k
  {
5927
1.22k
    *undefined_code = UNDEF_SIZE_NOT_2;
5928
1.22k
    return true;
5929
1.22k
  }
5930
308
      else
5931
308
  return false;
5932
5933
282
    case MVE_VSTRD_SCATTER_T4:
5934
282
      if (arm_decode_field (given, 7, 8) != 3)
5935
0
  {
5936
0
    *undefined_code = UNDEF_SIZE_NOT_3;
5937
0
    return true;
5938
0
  }
5939
282
      else
5940
282
  return false;
5941
5942
5.37k
    case MVE_VCVT_FP_FIX_VEC:
5943
5.37k
      {
5944
5.37k
  unsigned long imm6 = arm_decode_field (given, 16, 21);
5945
5.37k
  if ((imm6 & 0x20) == 0)
5946
426
    {
5947
426
      *undefined_code = UNDEF_VCVT_IMM6;
5948
426
      return true;
5949
426
    }
5950
5951
4.94k
  if ((arm_decode_field (given, 9, 9) == 0)
5952
1.41k
      && ((imm6 & 0x30) == 0x20))
5953
1.04k
    {
5954
1.04k
      *undefined_code = UNDEF_VCVT_FSI_IMM6;
5955
1.04k
      return true;
5956
1.04k
    }
5957
5958
3.90k
  return false;
5959
4.94k
      }
5960
5961
375
    case MVE_VNEG_FP:
5962
662
    case MVE_VABS_FP:
5963
4.77k
    case MVE_VCVT_BETWEEN_FP_INT:
5964
8.71k
    case MVE_VCVT_FROM_FP_TO_INT:
5965
8.71k
      {
5966
8.71k
  unsigned long size = arm_decode_field (given, 18, 19);
5967
8.71k
  if (size == 0)
5968
937
    {
5969
937
      *undefined_code = UNDEF_SIZE_0;
5970
937
      return true;
5971
937
    }
5972
7.77k
  else if (size == 3)
5973
2.18k
    {
5974
2.18k
      *undefined_code = UNDEF_SIZE_3;
5975
2.18k
      return true;
5976
2.18k
    }
5977
5.59k
  else
5978
5.59k
    return false;
5979
8.71k
      }
5980
5981
1.17k
    case MVE_VMOV_VEC_LANE_TO_GP:
5982
1.17k
      {
5983
1.17k
  unsigned long op1 = arm_decode_field (given, 21, 22);
5984
1.17k
  unsigned long op2 = arm_decode_field (given, 5, 6);
5985
1.17k
  unsigned long u = arm_decode_field (given, 23, 23);
5986
5987
1.17k
  if ((op2 == 0) && (u == 1))
5988
0
    {
5989
0
      if ((op1 == 0) || (op1 == 1))
5990
0
        {
5991
0
    *undefined_code = UNDEF_BAD_U_OP1_OP2;
5992
0
    return true;
5993
0
        }
5994
0
      else
5995
0
        return false;
5996
0
    }
5997
1.17k
  else if (op2 == 2)
5998
1.17k
    {
5999
1.17k
      if ((op1 == 0) || (op1 == 1))
6000
1.17k
        {
6001
1.17k
    *undefined_code = UNDEF_BAD_OP1_OP2;
6002
1.17k
    return true;
6003
1.17k
        }
6004
0
      else
6005
0
        return false;
6006
1.17k
    }
6007
6008
0
  return false;
6009
1.17k
      }
6010
6011
825
    case MVE_VMOV_GP_TO_VEC_LANE:
6012
825
      if (arm_decode_field (given, 5, 6) == 2)
6013
825
  {
6014
825
    unsigned long op1 = arm_decode_field (given, 21, 22);
6015
825
    if ((op1 == 0) || (op1 == 1))
6016
825
      {
6017
825
        *undefined_code = UNDEF_BAD_OP1_OP2;
6018
825
        return true;
6019
825
      }
6020
0
    else
6021
0
      return false;
6022
825
  }
6023
0
      else
6024
0
  return false;
6025
6026
735
    case MVE_VMOV_VEC_TO_VEC:
6027
735
      if ((arm_decode_field (given, 5, 5) == 1)
6028
455
    || (arm_decode_field (given, 22, 22) == 1))
6029
531
    return true;
6030
204
      return false;
6031
6032
4.07k
    case MVE_VMOV_IMM_TO_VEC:
6033
4.07k
      if (arm_decode_field (given, 5, 5) == 0)
6034
3.13k
      {
6035
3.13k
  unsigned long cmode = arm_decode_field (given, 8, 11);
6036
6037
3.13k
  if (((cmode & 9) == 1) || ((cmode & 5) == 1))
6038
0
    {
6039
0
      *undefined_code = UNDEF_OP_0_BAD_CMODE;
6040
0
      return true;
6041
0
    }
6042
3.13k
  else
6043
3.13k
    return false;
6044
3.13k
      }
6045
942
      else
6046
942
  return false;
6047
6048
368
    case MVE_VSHLL_T2:
6049
771
    case MVE_VMOVN:
6050
771
      if (arm_decode_field (given, 18, 19) == 2)
6051
404
  {
6052
404
    *undefined_code = UNDEF_SIZE_2;
6053
404
    return true;
6054
404
  }
6055
367
      else
6056
367
  return false;
6057
6058
1.69k
    case MVE_VRMLALDAVH:
6059
2.41k
    case MVE_VMLADAV_T1:
6060
2.77k
    case MVE_VMLADAV_T2:
6061
4.09k
    case MVE_VMLALDAV:
6062
4.09k
      if ((arm_decode_field (given, 28, 28) == 1)
6063
1.72k
    && (arm_decode_field (given, 12, 12) == 1))
6064
1.05k
  {
6065
1.05k
    *undefined_code = UNDEF_XCHG_UNS;
6066
1.05k
    return true;
6067
1.05k
  }
6068
3.04k
      else
6069
3.04k
  return false;
6070
6071
441
    case MVE_VQSHRN:
6072
1.64k
    case MVE_VQSHRUN:
6073
2.82k
    case MVE_VSHLL_T1:
6074
3.35k
    case MVE_VSHRN:
6075
3.35k
      {
6076
3.35k
  unsigned long sz = arm_decode_field (given, 19, 20);
6077
3.35k
  if (sz == 1)
6078
1.71k
    return false;
6079
1.64k
  else if ((sz & 2) == 2)
6080
875
    return false;
6081
767
  else
6082
767
    {
6083
767
      *undefined_code = UNDEF_SIZE;
6084
767
      return true;
6085
767
    }
6086
3.35k
      }
6087
0
      break;
6088
6089
685
    case MVE_VQSHL_T2:
6090
1.82k
    case MVE_VQSHLU_T3:
6091
2.54k
    case MVE_VRSHR:
6092
3.85k
    case MVE_VSHL_T1:
6093
5.19k
    case MVE_VSHR:
6094
5.57k
    case MVE_VSLI:
6095
5.88k
    case MVE_VSRI:
6096
5.88k
      {
6097
5.88k
  unsigned long sz = arm_decode_field (given, 19, 21);
6098
5.88k
  if ((sz & 7) == 1)
6099
639
    return false;
6100
5.24k
  else if ((sz & 6) == 2)
6101
1.33k
    return false;
6102
3.91k
  else if ((sz & 4) == 4)
6103
3.91k
    return false;
6104
0
  else
6105
0
    {
6106
0
      *undefined_code = UNDEF_SIZE;
6107
0
      return true;
6108
0
    }
6109
5.88k
      }
6110
6111
355
    case MVE_VQRSHRN:
6112
826
    case MVE_VQRSHRUN:
6113
826
      if (arm_decode_field (given, 19, 20) == 0)
6114
287
  {
6115
287
    *undefined_code = UNDEF_SIZE_0;
6116
287
    return true;
6117
287
  }
6118
539
      else
6119
539
  return false;
6120
6121
647
    case MVE_VABS_VEC:
6122
647
  if (arm_decode_field (given, 18, 19) == 3)
6123
298
  {
6124
298
    *undefined_code = UNDEF_SIZE_3;
6125
298
    return true;
6126
298
  }
6127
349
  else
6128
349
    return false;
6129
6130
334
    case MVE_VQNEG:
6131
972
    case MVE_VQABS:
6132
1.77k
    case MVE_VNEG_VEC:
6133
2.04k
    case MVE_VCLS:
6134
2.27k
    case MVE_VCLZ:
6135
2.27k
      if (arm_decode_field (given, 18, 19) == 3)
6136
600
  {
6137
600
    *undefined_code = UNDEF_SIZE_3;
6138
600
    return true;
6139
600
  }
6140
1.67k
      else
6141
1.67k
  return false;
6142
6143
549
    case MVE_VREV16:
6144
549
      if (arm_decode_field (given, 18, 19) == 0)
6145
279
  return false;
6146
270
      else
6147
270
  {
6148
270
    *undefined_code = UNDEF_SIZE_NOT_0;
6149
270
    return true;
6150
270
  }
6151
6152
528
    case MVE_VREV32:
6153
528
      {
6154
528
  unsigned long size = arm_decode_field (given, 18, 19);
6155
528
  if ((size & 2) == 2)
6156
239
    {
6157
239
      *undefined_code = UNDEF_SIZE_2;
6158
239
      return true;
6159
239
    }
6160
289
  else
6161
289
    return false;
6162
528
      }
6163
6164
581
    case MVE_VREV64:
6165
581
      if (arm_decode_field (given, 18, 19) != 3)
6166
221
  return false;
6167
360
      else
6168
360
  {
6169
360
    *undefined_code = UNDEF_SIZE_3;
6170
360
    return true;
6171
360
  }
6172
6173
114k
    default:
6174
114k
      return false;
6175
174k
    }
6176
174k
}
6177
6178
/* Return FALSE if GIVEN is not an unpredictable encoding for MATCHED_INSN.
6179
   Otherwise, return TRUE and set UNPREDICTABLE_CODE to give a reason as to
6180
   why this encoding is unpredictable.  */
6181
6182
static bool
6183
is_mve_unpredictable (unsigned long given, enum mve_instructions matched_insn,
6184
          enum mve_unpredictable *unpredictable_code)
6185
173k
{
6186
173k
  *unpredictable_code = UNPRED_NONE;
6187
6188
173k
  switch (matched_insn)
6189
173k
    {
6190
592
    case MVE_VCMP_FP_T2:
6191
2.58k
    case MVE_VPT_FP_T2:
6192
2.58k
      if ((arm_decode_field (given, 12, 12) == 0)
6193
1.00k
    && (arm_decode_field (given, 5, 5) == 1))
6194
583
  {
6195
583
    *unpredictable_code = UNPRED_FCA_0_FCB_1;
6196
583
    return true;
6197
583
  }
6198
2.00k
      else
6199
2.00k
  return false;
6200
6201
1.17k
    case MVE_VPT_VEC_T4:
6202
2.03k
    case MVE_VPT_VEC_T5:
6203
3.36k
    case MVE_VPT_VEC_T6:
6204
3.78k
    case MVE_VCMP_VEC_T4:
6205
4.15k
    case MVE_VCMP_VEC_T5:
6206
4.43k
    case MVE_VCMP_VEC_T6:
6207
4.43k
      if (arm_decode_field (given, 0, 3) == 0xd)
6208
986
  {
6209
986
    *unpredictable_code = UNPRED_R13;
6210
986
    return true;
6211
986
  }
6212
3.44k
      else
6213
3.44k
  return false;
6214
6215
1.48k
    case MVE_VDUP:
6216
1.48k
      {
6217
1.48k
  unsigned long gpr = arm_decode_field (given, 12, 15);
6218
1.48k
  if (gpr == 0xd)
6219
276
    {
6220
276
      *unpredictable_code = UNPRED_R13;
6221
276
      return true;
6222
276
    }
6223
1.20k
  else if (gpr == 0xf)
6224
541
    {
6225
541
      *unpredictable_code = UNPRED_R15;
6226
541
      return true;
6227
541
    }
6228
6229
666
  return false;
6230
1.48k
      }
6231
6232
611
    case MVE_VQADD_T2:
6233
1.10k
    case MVE_VQSUB_T2:
6234
1.47k
    case MVE_VMUL_FP_T2:
6235
2.14k
    case MVE_VMUL_VEC_T2:
6236
2.79k
    case MVE_VMLA:
6237
3.84k
    case MVE_VBRSR:
6238
4.14k
    case MVE_VADD_FP_T2:
6239
4.48k
    case MVE_VSUB_FP_T2:
6240
4.90k
    case MVE_VADD_VEC_T2:
6241
5.22k
    case MVE_VSUB_VEC_T2:
6242
5.49k
    case MVE_VQRSHL_T2:
6243
5.74k
    case MVE_VQSHL_T1:
6244
6.00k
    case MVE_VRSHL_T2:
6245
6.58k
    case MVE_VSHL_T2:
6246
7.42k
    case MVE_VSHLC:
6247
8.11k
    case MVE_VQDMLAH:
6248
8.52k
    case MVE_VQRDMLAH:
6249
8.92k
    case MVE_VQDMLASH:
6250
9.59k
    case MVE_VQRDMLASH:
6251
10.2k
    case MVE_VQDMULH_T3:
6252
10.9k
    case MVE_VQRDMULH_T4:
6253
11.2k
    case MVE_VMLAS:
6254
11.8k
    case MVE_VFMA_FP_SCALAR:
6255
12.7k
    case MVE_VFMAS_FP_SCALAR:
6256
13.6k
    case MVE_VHADD_T2:
6257
14.1k
    case MVE_VHSUB_T2:
6258
14.1k
      {
6259
14.1k
  unsigned long gpr = arm_decode_field (given, 0, 3);
6260
14.1k
  if (gpr == 0xd)
6261
975
    {
6262
975
      *unpredictable_code = UNPRED_R13;
6263
975
      return true;
6264
975
    }
6265
13.1k
  else if (gpr == 0xf)
6266
2.32k
    {
6267
2.32k
      *unpredictable_code = UNPRED_R15;
6268
2.32k
      return true;
6269
2.32k
    }
6270
6271
10.8k
  return false;
6272
14.1k
      }
6273
6274
663
    case MVE_VLD2:
6275
1.95k
    case MVE_VST2:
6276
1.95k
      {
6277
1.95k
  unsigned long rn = arm_decode_field (given, 16, 19);
6278
6279
1.95k
  if ((rn == 0xd) && (arm_decode_field (given, 21, 21) == 1))
6280
712
    {
6281
712
      *unpredictable_code = UNPRED_R13_AND_WB;
6282
712
      return true;
6283
712
    }
6284
6285
1.24k
  if (rn == 0xf)
6286
500
    {
6287
500
      *unpredictable_code = UNPRED_R15;
6288
500
      return true;
6289
500
    }
6290
6291
747
  if (arm_decode_field_multiple (given, 13, 15, 22, 22) > 6)
6292
381
    {
6293
381
      *unpredictable_code = UNPRED_Q_GT_6;
6294
381
      return true;
6295
381
    }
6296
366
  else
6297
366
    return false;
6298
747
      }
6299
6300
350
    case MVE_VLD4:
6301
1.27k
    case MVE_VST4:
6302
1.27k
      {
6303
1.27k
  unsigned long rn = arm_decode_field (given, 16, 19);
6304
6305
1.27k
  if ((rn == 0xd) && (arm_decode_field (given, 21, 21) == 1))
6306
408
    {
6307
408
      *unpredictable_code = UNPRED_R13_AND_WB;
6308
408
      return true;
6309
408
    }
6310
6311
866
  if (rn == 0xf)
6312
261
    {
6313
261
      *unpredictable_code = UNPRED_R15;
6314
261
      return true;
6315
261
    }
6316
6317
605
  if (arm_decode_field_multiple (given, 13, 15, 22, 22) > 4)
6318
300
    {
6319
300
      *unpredictable_code = UNPRED_Q_GT_4;
6320
300
      return true;
6321
300
    }
6322
305
  else
6323
305
    return false;
6324
605
      }
6325
6326
404
    case MVE_VLDRB_T5:
6327
1.87k
    case MVE_VLDRH_T6:
6328
2.83k
    case MVE_VLDRW_T7:
6329
4.50k
    case MVE_VSTRB_T5:
6330
5.31k
    case MVE_VSTRH_T6:
6331
6.18k
    case MVE_VSTRW_T7:
6332
6.18k
      {
6333
6.18k
  unsigned long rn = arm_decode_field (given, 16, 19);
6334
6335
6.18k
  if ((rn == 0xd) && (arm_decode_field (given, 21, 21) == 1))
6336
377
    {
6337
377
      *unpredictable_code = UNPRED_R13_AND_WB;
6338
377
      return true;
6339
377
    }
6340
5.81k
  else if (rn == 0xf)
6341
805
    {
6342
805
      *unpredictable_code = UNPRED_R15;
6343
805
      return true;
6344
805
    }
6345
5.00k
  else
6346
5.00k
    return false;
6347
6.18k
      }
6348
6349
1.32k
    case MVE_VLDRB_GATHER_T1:
6350
1.32k
      if (arm_decode_field (given, 0, 0) == 1)
6351
504
  {
6352
504
    *unpredictable_code = UNPRED_OS;
6353
504
    return true;
6354
504
  }
6355
6356
      /*  fall through.  */
6357
      /* To handle common code with T2-T4 variants.  */
6358
2.82k
    case MVE_VLDRH_GATHER_T2:
6359
3.11k
    case MVE_VLDRW_GATHER_T3:
6360
3.72k
    case MVE_VLDRD_GATHER_T4:
6361
3.72k
      {
6362
3.72k
  unsigned long qd = arm_decode_field_multiple (given, 13, 15, 22, 22);
6363
3.72k
  unsigned long qm = arm_decode_field_multiple (given, 1, 3, 5, 5);
6364
6365
3.72k
  if (qd == qm)
6366
529
    {
6367
529
      *unpredictable_code = UNPRED_Q_REGS_EQUAL;
6368
529
      return true;
6369
529
    }
6370
6371
3.19k
  if (arm_decode_field (given, 16, 19) == 0xf)
6372
759
    {
6373
759
      *unpredictable_code = UNPRED_R15;
6374
759
      return true;
6375
759
    }
6376
6377
2.43k
  return false;
6378
3.19k
      }
6379
6380
721
    case MVE_VLDRW_GATHER_T5:
6381
1.35k
    case MVE_VLDRD_GATHER_T6:
6382
1.35k
      {
6383
1.35k
  unsigned long qd = arm_decode_field_multiple (given, 13, 15, 22, 22);
6384
1.35k
  unsigned long qm = arm_decode_field_multiple (given, 17, 19, 7, 7);
6385
6386
1.35k
  if (qd == qm)
6387
432
    {
6388
432
      *unpredictable_code = UNPRED_Q_REGS_EQUAL;
6389
432
      return true;
6390
432
    }
6391
924
  else
6392
924
    return false;
6393
1.35k
      }
6394
6395
2.21k
    case MVE_VSTRB_SCATTER_T1:
6396
2.21k
      if (arm_decode_field (given, 16, 19) == 0xf)
6397
761
  {
6398
761
    *unpredictable_code = UNPRED_R15;
6399
761
    return true;
6400
761
  }
6401
1.45k
      else if (arm_decode_field (given, 0, 0) == 1)
6402
795
  {
6403
795
    *unpredictable_code = UNPRED_OS;
6404
795
    return true;
6405
795
  }
6406
663
      else
6407
663
  return false;
6408
6409
1.17k
    case MVE_VSTRH_SCATTER_T2:
6410
2.71k
    case MVE_VSTRW_SCATTER_T3:
6411
2.97k
    case MVE_VSTRD_SCATTER_T4:
6412
2.97k
      if (arm_decode_field (given, 16, 19) == 0xf)
6413
562
  {
6414
562
    *unpredictable_code = UNPRED_R15;
6415
562
    return true;
6416
562
  }
6417
2.41k
      else
6418
2.41k
  return false;
6419
6420
1.38k
    case MVE_VMOV2_VEC_LANE_TO_GP:
6421
2.47k
    case MVE_VMOV2_GP_TO_VEC_LANE:
6422
6.57k
    case MVE_VCVT_BETWEEN_FP_INT:
6423
10.4k
    case MVE_VCVT_FROM_FP_TO_INT:
6424
10.4k
      {
6425
10.4k
  unsigned long rt = arm_decode_field (given, 0, 3);
6426
10.4k
  unsigned long rt2 = arm_decode_field (given, 16, 19);
6427
6428
10.4k
  if ((rt == 0xd) || (rt2 == 0xd))
6429
936
    {
6430
936
      *unpredictable_code = UNPRED_R13;
6431
936
      return true;
6432
936
    }
6433
9.55k
  else if ((rt == 0xf) || (rt2 == 0xf))
6434
2.64k
    {
6435
2.64k
      *unpredictable_code = UNPRED_R15;
6436
2.64k
      return true;
6437
2.64k
    }
6438
6.91k
  else if (rt == rt2 && matched_insn != MVE_VMOV2_GP_TO_VEC_LANE)
6439
251
    {
6440
251
      *unpredictable_code = UNPRED_GP_REGS_EQUAL;
6441
251
      return true;
6442
251
    }
6443
6444
6.66k
  return false;
6445
10.4k
      }
6446
6447
540
    case MVE_VMAXV:
6448
933
    case MVE_VMAXAV:
6449
1.15k
    case MVE_VMAXNMV_FP:
6450
1.51k
    case MVE_VMAXNMAV_FP:
6451
1.96k
    case MVE_VMINNMV_FP:
6452
2.24k
    case MVE_VMINNMAV_FP:
6453
2.52k
    case MVE_VMINV:
6454
2.94k
    case MVE_VMINAV:
6455
3.86k
    case MVE_VABAV:
6456
3.86k
    case MVE_VMOV_HFP_TO_GP:
6457
4.68k
    case MVE_VMOV_GP_TO_VEC_LANE:
6458
5.86k
    case MVE_VMOV_VEC_LANE_TO_GP:
6459
5.86k
      {
6460
5.86k
  unsigned long rda = arm_decode_field (given, 12, 15);
6461
5.86k
  if (rda == 0xd)
6462
269
    {
6463
269
      *unpredictable_code = UNPRED_R13;
6464
269
      return true;
6465
269
    }
6466
5.59k
  else if (rda == 0xf)
6467
1.66k
    {
6468
1.66k
      *unpredictable_code = UNPRED_R15;
6469
1.66k
      return true;
6470
1.66k
    }
6471
6472
3.93k
  return false;
6473
5.86k
      }
6474
6475
1.51k
    case MVE_VMULL_INT:
6476
1.51k
      {
6477
1.51k
  unsigned long Qd;
6478
1.51k
  unsigned long Qm;
6479
1.51k
  unsigned long Qn;
6480
6481
1.51k
  if (arm_decode_field (given, 20, 21) == 2)
6482
870
    {
6483
870
      Qd = arm_decode_field_multiple (given, 13, 15, 22, 22);
6484
870
      Qm = arm_decode_field_multiple (given, 1, 3, 5, 5);
6485
870
      Qn = arm_decode_field_multiple (given, 17, 19, 7, 7);
6486
6487
870
      if ((Qd == Qn) || (Qd == Qm))
6488
545
        {
6489
545
    *unpredictable_code = UNPRED_Q_REGS_EQ_AND_SIZE_2;
6490
545
    return true;
6491
545
        }
6492
325
      else
6493
325
        return false;
6494
870
    }
6495
640
  else
6496
640
    return false;
6497
1.51k
      }
6498
6499
1.31k
    case MVE_VCMUL_FP:
6500
2.03k
    case MVE_VQDMULL_T1:
6501
2.03k
      {
6502
2.03k
  unsigned long Qd;
6503
2.03k
  unsigned long Qm;
6504
2.03k
  unsigned long Qn;
6505
6506
2.03k
  if (arm_decode_field (given, 28, 28) == 1)
6507
1.43k
    {
6508
1.43k
      Qd = arm_decode_field_multiple (given, 13, 15, 22, 22);
6509
1.43k
      Qm = arm_decode_field_multiple (given, 1, 3, 5, 5);
6510
1.43k
      Qn = arm_decode_field_multiple (given, 17, 19, 7, 7);
6511
6512
1.43k
      if ((Qd == Qn) || (Qd == Qm))
6513
363
        {
6514
363
    *unpredictable_code = UNPRED_Q_REGS_EQ_AND_SIZE_1;
6515
363
    return true;
6516
363
        }
6517
1.06k
      else
6518
1.06k
        return false;
6519
1.43k
    }
6520
603
  else
6521
603
    return false;
6522
2.03k
      }
6523
6524
2.53k
    case MVE_VQDMULL_T2:
6525
2.53k
      {
6526
2.53k
  unsigned long gpr = arm_decode_field (given, 0, 3);
6527
2.53k
  if (gpr == 0xd)
6528
482
    {
6529
482
      *unpredictable_code = UNPRED_R13;
6530
482
      return true;
6531
482
    }
6532
2.05k
  else if (gpr == 0xf)
6533
427
    {
6534
427
      *unpredictable_code = UNPRED_R15;
6535
427
      return true;
6536
427
    }
6537
6538
1.62k
  if (arm_decode_field (given, 28, 28) == 1)
6539
674
    {
6540
674
      unsigned long Qd
6541
674
        = arm_decode_field_multiple (given, 13, 15, 22, 22);
6542
674
      unsigned long Qn = arm_decode_field_multiple (given, 17, 19, 7, 7);
6543
6544
674
      if (Qd == Qn)
6545
390
        {
6546
390
    *unpredictable_code = UNPRED_Q_REGS_EQ_AND_SIZE_1;
6547
390
    return true;
6548
390
        }
6549
284
      else
6550
284
        return false;
6551
674
    }
6552
6553
953
  return false;
6554
1.62k
      }
6555
6556
772
    case MVE_VMLSLDAV:
6557
1.37k
    case MVE_VRMLSLDAVH:
6558
2.70k
    case MVE_VMLALDAV:
6559
2.97k
    case MVE_VADDLV:
6560
2.97k
      if (arm_decode_field (given, 20, 22) == 6)
6561
1.45k
  {
6562
1.45k
    *unpredictable_code = UNPRED_R13;
6563
1.45k
    return true;
6564
1.45k
  }
6565
1.52k
      else
6566
1.52k
  return false;
6567
6568
802
    case MVE_VDWDUP:
6569
2.18k
    case MVE_VIWDUP:
6570
2.18k
      if (arm_decode_field (given, 1, 3) == 6)
6571
828
  {
6572
828
    *unpredictable_code = UNPRED_R13;
6573
828
    return true;
6574
828
  }
6575
1.35k
      else
6576
1.35k
  return false;
6577
6578
942
    case MVE_VCADD_VEC:
6579
2.55k
    case MVE_VHCADD:
6580
2.55k
      {
6581
2.55k
  unsigned long Qd = arm_decode_field_multiple (given, 13, 15, 22, 22);
6582
2.55k
  unsigned long Qm = arm_decode_field_multiple (given, 1, 3, 5, 5);
6583
2.55k
  if ((Qd == Qm) && arm_decode_field (given, 20, 21) == 2)
6584
271
    {
6585
271
      *unpredictable_code = UNPRED_Q_REGS_EQ_AND_SIZE_2;
6586
271
      return true;
6587
271
    }
6588
2.28k
  else
6589
2.28k
    return false;
6590
2.55k
      }
6591
6592
822
    case MVE_VCADD_FP:
6593
822
      {
6594
822
  unsigned long Qd = arm_decode_field_multiple (given, 13, 15, 22, 22);
6595
822
  unsigned long Qm = arm_decode_field_multiple (given, 1, 3, 5, 5);
6596
822
  if ((Qd == Qm) && arm_decode_field (given, 20, 20) == 1)
6597
330
    {
6598
330
      *unpredictable_code = UNPRED_Q_REGS_EQ_AND_SIZE_1;
6599
330
      return true;
6600
330
    }
6601
492
  else
6602
492
    return false;
6603
822
      }
6604
6605
2.63k
    case MVE_VCMLA_FP:
6606
2.63k
      {
6607
2.63k
  unsigned long Qda;
6608
2.63k
  unsigned long Qm;
6609
2.63k
  unsigned long Qn;
6610
6611
2.63k
  if (arm_decode_field (given, 20, 20) == 1)
6612
2.01k
    {
6613
2.01k
      Qda = arm_decode_field_multiple (given, 13, 15, 22, 22);
6614
2.01k
      Qm = arm_decode_field_multiple (given, 1, 3, 5, 5);
6615
2.01k
      Qn = arm_decode_field_multiple (given, 17, 19, 7, 7);
6616
6617
2.01k
      if ((Qda == Qn) || (Qda == Qm))
6618
1.47k
        {
6619
1.47k
    *unpredictable_code = UNPRED_Q_REGS_EQ_AND_SIZE_1;
6620
1.47k
    return true;
6621
1.47k
        }
6622
542
      else
6623
542
        return false;
6624
2.01k
    }
6625
612
  else
6626
612
    return false;
6627
6628
2.63k
      }
6629
6630
407
    case MVE_VCTP:
6631
407
      if (arm_decode_field (given, 16, 19) == 0xd)
6632
194
  {
6633
194
    *unpredictable_code = UNPRED_R13;
6634
194
    return true;
6635
194
  }
6636
213
      else
6637
213
  return false;
6638
6639
581
    case MVE_VREV64:
6640
581
      {
6641
581
  unsigned long qd = arm_decode_field_multiple (given, 13, 15, 22, 22);
6642
581
  unsigned long qm = arm_decode_field_multiple (given, 1, 3, 6, 6);
6643
6644
581
  if (qd == qm)
6645
253
    {
6646
253
      *unpredictable_code = UNPRED_Q_REGS_EQUAL;
6647
253
      return true;
6648
253
    }
6649
328
  else
6650
328
    return false;
6651
581
      }
6652
6653
304
    case MVE_LSLL:
6654
1.34k
    case MVE_LSLLI:
6655
2.16k
    case MVE_LSRL:
6656
2.84k
    case MVE_ASRL:
6657
3.35k
    case MVE_ASRLI:
6658
3.95k
    case MVE_UQSHLL:
6659
4.63k
    case MVE_UQRSHLL:
6660
5.44k
    case MVE_URSHRL:
6661
6.04k
    case MVE_SRSHRL:
6662
6.70k
    case MVE_SQSHLL:
6663
7.47k
    case MVE_SQRSHRL:
6664
7.47k
      {
6665
7.47k
  unsigned long gpr = arm_decode_field (given, 9, 11);
6666
7.47k
  gpr = ((gpr << 1) | 1);
6667
7.47k
  if (gpr == 0xd)
6668
2.78k
    {
6669
2.78k
      *unpredictable_code = UNPRED_R13;
6670
2.78k
      return true;
6671
2.78k
    }
6672
4.68k
  else if (gpr == 0xf)
6673
0
    {
6674
0
      *unpredictable_code = UNPRED_R15;
6675
0
      return true;
6676
0
    }
6677
6678
4.68k
  return false;
6679
7.47k
      }
6680
6681
88.1k
    default:
6682
88.1k
      return false;
6683
173k
    }
6684
173k
}
6685
6686
static void
6687
print_mve_vmov_index (struct disassemble_info *info, unsigned long given)
6688
1.99k
{
6689
1.99k
  unsigned long op1 = arm_decode_field (given, 21, 22);
6690
1.99k
  unsigned long op2 = arm_decode_field (given, 5, 6);
6691
1.99k
  unsigned long h = arm_decode_field (given, 16, 16);
6692
1.99k
  unsigned long index_operand, esize, targetBeat, idx;
6693
1.99k
  void *stream = info->stream;
6694
1.99k
  fprintf_styled_ftype func = info->fprintf_styled_func;
6695
6696
1.99k
  if ((op1 & 0x2) == 0x2)
6697
0
    {
6698
0
      index_operand = op2;
6699
0
      esize = 8;
6700
0
    }
6701
1.99k
  else if (((op1 & 0x2) == 0x0) && ((op2 & 0x1) == 0x1))
6702
0
    {
6703
0
      index_operand = op2  >> 1;
6704
0
      esize = 16;
6705
0
    }
6706
1.99k
  else if (((op1 & 0x2) == 0) && ((op2 & 0x3) == 0))
6707
0
    {
6708
0
      index_operand = 0;
6709
0
      esize = 32;
6710
0
    }
6711
1.99k
  else
6712
1.99k
    {
6713
1.99k
      func (stream, dis_style_text, "<undefined index>");
6714
1.99k
      return;
6715
1.99k
    }
6716
6717
0
  targetBeat =  (op1 & 0x1) | (h << 1);
6718
0
  idx = index_operand + targetBeat * (32/esize);
6719
6720
0
  func (stream, dis_style_immediate, "%lu", idx);
6721
0
}
6722
6723
/* Print neon and mve 8-bit immediate that can be a 8, 16, 32, or 64-bits
6724
   in length and integer of floating-point type.  */
6725
static void
6726
print_simd_imm8 (struct disassemble_info *info, unsigned long given,
6727
     unsigned int ibit_loc, const struct mopcode32 *insn)
6728
11.1k
{
6729
11.1k
  int bits = 0;
6730
11.1k
  int cmode = (given >> 8) & 0xf;
6731
11.1k
  int op = (given >> 5) & 0x1;
6732
11.1k
  unsigned long value = 0, hival = 0;
6733
11.1k
  unsigned shift;
6734
11.1k
  int size = 0;
6735
11.1k
  int isfloat = 0;
6736
11.1k
  void *stream = info->stream;
6737
11.1k
  fprintf_styled_ftype func = info->fprintf_styled_func;
6738
6739
  /* On Neon the 'i' bit is at bit 24, on mve it is
6740
     at bit 28.  */
6741
11.1k
  bits |= ((given >> ibit_loc) & 1) << 7;
6742
11.1k
  bits |= ((given >> 16) & 7) << 4;
6743
11.1k
  bits |= ((given >> 0) & 15) << 0;
6744
6745
11.1k
  if (cmode < 8)
6746
5.79k
    {
6747
5.79k
      shift = (cmode >> 1) & 3;
6748
5.79k
      value = (unsigned long) bits << (8 * shift);
6749
5.79k
      size = 32;
6750
5.79k
    }
6751
5.35k
  else if (cmode < 12)
6752
2.32k
    {
6753
2.32k
      shift = (cmode >> 1) & 1;
6754
2.32k
      value = (unsigned long) bits << (8 * shift);
6755
2.32k
      size = 16;
6756
2.32k
    }
6757
3.03k
  else if (cmode < 14)
6758
1.36k
    {
6759
1.36k
      shift = (cmode & 1) + 1;
6760
1.36k
      value = (unsigned long) bits << (8 * shift);
6761
1.36k
      value |= (1ul << (8 * shift)) - 1;
6762
1.36k
      size = 32;
6763
1.36k
    }
6764
1.66k
  else if (cmode == 14)
6765
1.35k
    {
6766
1.35k
      if (op)
6767
942
  {
6768
    /* Bit replication into bytes.  */
6769
942
    int ix;
6770
942
    unsigned long mask;
6771
6772
942
    value = 0;
6773
942
    hival = 0;
6774
8.47k
    for (ix = 7; ix >= 0; ix--)
6775
7.53k
      {
6776
7.53k
        mask = ((bits >> ix) & 1) ? 0xff : 0;
6777
7.53k
        if (ix <= 3)
6778
3.76k
    value = (value << 8) | mask;
6779
3.76k
        else
6780
3.76k
    hival = (hival << 8) | mask;
6781
7.53k
      }
6782
942
    size = 64;
6783
942
  }
6784
410
      else
6785
410
  {
6786
    /* Byte replication.  */
6787
410
    value = (unsigned long) bits;
6788
410
    size = 8;
6789
410
  }
6790
1.35k
    }
6791
315
  else if (!op)
6792
315
    {
6793
      /* Floating point encoding.  */
6794
315
      int tmp;
6795
6796
315
      value = (unsigned long)  (bits & 0x7f) << 19;
6797
315
      value |= (unsigned long) (bits & 0x80) << 24;
6798
315
      tmp = bits & 0x40 ? 0x3c : 0x40;
6799
315
      value |= (unsigned long) tmp << 24;
6800
315
      size = 32;
6801
315
      isfloat = 1;
6802
315
    }
6803
0
  else
6804
0
    {
6805
0
      func (stream, dis_style_text, "<illegal constant %.8x:%x:%x>",
6806
0
      bits, cmode, op);
6807
0
      size = 32;
6808
0
      return;
6809
0
    }
6810
6811
  /* printU determines whether the immediate value should be printed as
6812
     unsigned.  */
6813
11.1k
  unsigned printU = 0;
6814
11.1k
  switch (insn->mve_op)
6815
11.1k
    {
6816
0
    default:
6817
0
      break;
6818
    /* We want this for instructions that don't have a 'signed' type.  */
6819
3.38k
    case MVE_VBIC_IMM:
6820
3.72k
    case MVE_VORR_IMM:
6821
7.06k
    case MVE_VMVN_IMM:
6822
11.1k
    case MVE_VMOV_IMM_TO_VEC:
6823
11.1k
      printU = 1;
6824
11.1k
      break;
6825
11.1k
    }
6826
11.1k
  switch (size)
6827
11.1k
    {
6828
410
    case 8:
6829
410
      func (stream, dis_style_immediate, "#%ld", value);
6830
410
      func (stream, dis_style_comment_start, "\t@ 0x%.2lx", value);
6831
410
      break;
6832
6833
2.32k
    case 16:
6834
2.32k
      func (stream, dis_style_immediate, printU ? "#%lu" : "#%ld", value);
6835
2.32k
      func (stream, dis_style_comment_start, "\t@ 0x%.4lx", value);
6836
2.32k
      break;
6837
6838
7.47k
    case 32:
6839
7.47k
      if (isfloat)
6840
315
  {
6841
315
    unsigned char valbytes[4];
6842
315
    double fvalue;
6843
6844
    /* Do this a byte at a time so we don't have to
6845
       worry about the host's endianness.  */
6846
315
    valbytes[0] = value & 0xff;
6847
315
    valbytes[1] = (value >> 8) & 0xff;
6848
315
    valbytes[2] = (value >> 16) & 0xff;
6849
315
    valbytes[3] = (value >> 24) & 0xff;
6850
6851
315
    floatformat_to_double
6852
315
      (& floatformat_ieee_single_little, valbytes,
6853
315
       & fvalue);
6854
6855
315
    func (stream, dis_style_immediate, "#%.7g", fvalue);
6856
315
    func (stream, dis_style_comment_start, "\t@ 0x%.8lx", value);
6857
315
  }
6858
7.15k
      else
6859
7.15k
  {
6860
7.15k
    func (stream, dis_style_immediate,
6861
7.15k
    printU ? "#%lu" : "#%ld",
6862
7.15k
    (long) (((value & 0x80000000L) != 0)
6863
1.88k
      && !printU
6864
7.15k
      ? value | ~0xffffffffL : value));
6865
7.15k
    func (stream, dis_style_comment_start, "\t@ 0x%.8lx", value);
6866
7.15k
  }
6867
7.47k
      break;
6868
6869
942
    case 64:
6870
942
      func (stream, dis_style_immediate, "#0x%.8lx%.8lx", hival, value);
6871
942
      break;
6872
6873
0
    default:
6874
0
      abort ();
6875
11.1k
    }
6876
6877
11.1k
}
6878
6879
static void
6880
print_mve_undefined (struct disassemble_info *info,
6881
         enum mve_undefined undefined_code)
6882
19.9k
{
6883
19.9k
  void *stream = info->stream;
6884
19.9k
  fprintf_styled_ftype func = info->fprintf_styled_func;
6885
  /* Initialize REASON to avoid compiler warning about uninitialized
6886
     usage, though such usage should be impossible.  */
6887
19.9k
  const char *reason = "??";
6888
6889
19.9k
  switch (undefined_code)
6890
19.9k
    {
6891
767
    case UNDEF_SIZE:
6892
767
      reason = "illegal size";
6893
767
      break;
6894
6895
3.38k
    case UNDEF_SIZE_0:
6896
3.38k
      reason = "size equals zero";
6897
3.38k
      break;
6898
6899
643
    case UNDEF_SIZE_2:
6900
643
      reason = "size equals two";
6901
643
      break;
6902
6903
6.89k
    case UNDEF_SIZE_3:
6904
6.89k
      reason = "size equals three";
6905
6.89k
      break;
6906
6907
808
    case UNDEF_SIZE_LE_1:
6908
808
      reason = "size <= 1";
6909
808
      break;
6910
6911
270
    case UNDEF_SIZE_NOT_0:
6912
270
      reason = "size not equal to 0";
6913
270
      break;
6914
6915
1.22k
    case UNDEF_SIZE_NOT_2:
6916
1.22k
      reason = "size not equal to 2";
6917
1.22k
      break;
6918
6919
0
    case UNDEF_SIZE_NOT_3:
6920
0
      reason = "size not equal to 3";
6921
0
      break;
6922
6923
315
    case UNDEF_NOT_UNS_SIZE_0:
6924
315
      reason = "not unsigned and size = zero";
6925
315
      break;
6926
6927
229
    case UNDEF_NOT_UNS_SIZE_1:
6928
229
      reason = "not unsigned and size = one";
6929
229
      break;
6930
6931
371
    case UNDEF_NOT_UNSIGNED:
6932
371
      reason = "not unsigned";
6933
371
      break;
6934
6935
426
    case UNDEF_VCVT_IMM6:
6936
426
      reason = "invalid imm6";
6937
426
      break;
6938
6939
1.04k
    case UNDEF_VCVT_FSI_IMM6:
6940
1.04k
      reason = "fsi = 0 and invalid imm6";
6941
1.04k
      break;
6942
6943
1.99k
    case UNDEF_BAD_OP1_OP2:
6944
1.99k
      reason = "bad size with op2 = 2 and op1 = 0 or 1";
6945
1.99k
      break;
6946
6947
0
    case UNDEF_BAD_U_OP1_OP2:
6948
0
      reason = "unsigned with op2 = 0 and op1 = 0 or 1";
6949
0
      break;
6950
6951
0
    case UNDEF_OP_0_BAD_CMODE:
6952
0
      reason = "op field equal 0 and bad cmode";
6953
0
      break;
6954
6955
1.05k
    case UNDEF_XCHG_UNS:
6956
1.05k
      reason = "exchange and unsigned together";
6957
1.05k
      break;
6958
6959
531
    case UNDEF_NONE:
6960
531
      reason = "";
6961
531
      break;
6962
19.9k
    }
6963
6964
19.9k
  func (stream, dis_style_text, "\t\tundefined instruction: %s", reason);
6965
19.9k
}
6966
6967
static void
6968
print_mve_unpredictable (struct disassemble_info *info,
6969
       enum mve_unpredictable unpredict_code)
6970
34.6k
{
6971
34.6k
  void *stream = info->stream;
6972
34.6k
  fprintf_styled_ftype func = info->fprintf_styled_func;
6973
  /* Initialize REASON to avoid compiler warning about uninitialized
6974
     usage, though such usage should be impossible.  */
6975
34.6k
  const char *reason = "??";
6976
6977
34.6k
  switch (unpredict_code)
6978
34.6k
    {
6979
1.84k
    case UNPRED_IT_BLOCK:
6980
1.84k
      reason = "mve instruction in it block";
6981
1.84k
      break;
6982
6983
583
    case UNPRED_FCA_0_FCB_1:
6984
583
      reason = "condition bits, fca = 0 and fcb = 1";
6985
583
      break;
6986
6987
9.19k
    case UNPRED_R13:
6988
9.19k
      reason = "use of r13 (sp)";
6989
9.19k
      break;
6990
6991
11.2k
    case UNPRED_R15:
6992
11.2k
      reason = "use of r15 (pc)";
6993
11.2k
      break;
6994
6995
300
    case UNPRED_Q_GT_4:
6996
300
      reason = "start register block > r4";
6997
300
      break;
6998
6999
381
    case UNPRED_Q_GT_6:
7000
381
      reason = "start register block > r6";
7001
381
      break;
7002
7003
1.49k
    case UNPRED_R13_AND_WB:
7004
1.49k
      reason = "use of r13 and write back";
7005
1.49k
      break;
7006
7007
1.21k
    case UNPRED_Q_REGS_EQUAL:
7008
1.21k
      reason = "same vector register used for destination and other operand";
7009
1.21k
      break;
7010
7011
1.29k
    case UNPRED_OS:
7012
1.29k
      reason = "use of offset scaled";
7013
1.29k
      break;
7014
7015
251
    case UNPRED_GP_REGS_EQUAL:
7016
251
      reason = "same general-purpose register used for both operands";
7017
251
      break;
7018
7019
2.56k
    case UNPRED_Q_REGS_EQ_AND_SIZE_1:
7020
2.56k
      reason = "use of identical q registers and size = 1";
7021
2.56k
      break;
7022
7023
816
    case UNPRED_Q_REGS_EQ_AND_SIZE_2:
7024
816
      reason = "use of identical q registers and size = 1";
7025
816
      break;
7026
7027
3.43k
    case UNPRED_NONE:
7028
3.43k
      reason = "";
7029
3.43k
      break;
7030
34.6k
    }
7031
7032
34.6k
  func (stream, dis_style_comment_start, "%s: %s",
7033
34.6k
  UNPREDICTABLE_INSTRUCTION, reason);
7034
34.6k
}
7035
7036
/* Print register block operand for mve vld2/vld4/vst2/vld4.  */
7037
7038
static void
7039
print_mve_register_blocks (struct disassemble_info *info,
7040
         unsigned long given,
7041
         enum mve_instructions matched_insn)
7042
3.23k
{
7043
3.23k
  void *stream = info->stream;
7044
3.23k
  fprintf_styled_ftype func = info->fprintf_styled_func;
7045
7046
3.23k
  unsigned long q_reg_start = arm_decode_field_multiple (given,
7047
3.23k
               13, 15,
7048
3.23k
               22, 22);
7049
3.23k
  switch (matched_insn)
7050
3.23k
    {
7051
663
    case MVE_VLD2:
7052
1.95k
    case MVE_VST2:
7053
1.95k
      if (q_reg_start <= 6)
7054
586
  {
7055
586
    func (stream, dis_style_text, "{");
7056
586
    func (stream, dis_style_register, "q%ld", q_reg_start);
7057
586
    func (stream, dis_style_text, ", ");
7058
586
    func (stream, dis_style_register, "q%ld", q_reg_start + 1);
7059
586
    func (stream, dis_style_text, "}");
7060
586
  }
7061
1.37k
      else
7062
1.37k
  func (stream, dis_style_text, "<illegal reg q%ld>", q_reg_start);
7063
1.95k
      break;
7064
7065
350
    case MVE_VLD4:
7066
1.27k
    case MVE_VST4:
7067
1.27k
      if (q_reg_start <= 4)
7068
539
  {
7069
539
    func (stream, dis_style_text, "{");
7070
539
    func (stream, dis_style_register, "q%ld", q_reg_start);
7071
539
    func (stream, dis_style_text, ", ");
7072
539
    func (stream, dis_style_register, "q%ld", q_reg_start + 1);
7073
539
    func (stream, dis_style_text, ", ");
7074
539
    func (stream, dis_style_register, "q%ld", q_reg_start + 2);
7075
539
    func (stream, dis_style_text, ", ");
7076
539
    func (stream, dis_style_register, "q%ld", q_reg_start + 3);
7077
539
    func (stream, dis_style_text, "}");
7078
539
  }
7079
736
      else
7080
736
  func (stream, dis_style_text, "<illegal reg q%ld>", q_reg_start);
7081
1.27k
      break;
7082
7083
0
    default:
7084
0
      break;
7085
3.23k
    }
7086
3.23k
}
7087
7088
static void
7089
print_mve_rounding_mode (struct disassemble_info *info,
7090
       unsigned long given,
7091
       enum mve_instructions matched_insn)
7092
7.06k
{
7093
7.06k
  void *stream = info->stream;
7094
7.06k
  fprintf_styled_ftype func = info->fprintf_styled_func;
7095
7096
7.06k
  switch (matched_insn)
7097
7.06k
    {
7098
3.93k
    case MVE_VCVT_FROM_FP_TO_INT:
7099
3.93k
      {
7100
3.93k
  switch (arm_decode_field (given, 8, 9))
7101
3.93k
    {
7102
1.17k
    case 0:
7103
1.17k
      func (stream, dis_style_mnemonic, "a");
7104
1.17k
      break;
7105
7106
1.15k
    case 1:
7107
1.15k
      func (stream, dis_style_mnemonic, "n");
7108
1.15k
      break;
7109
7110
1.12k
    case 2:
7111
1.12k
      func (stream, dis_style_mnemonic, "p");
7112
1.12k
      break;
7113
7114
476
    case 3:
7115
476
      func (stream, dis_style_mnemonic, "m");
7116
476
      break;
7117
7118
0
    default:
7119
0
      break;
7120
3.93k
    }
7121
3.93k
      }
7122
3.93k
      break;
7123
7124
3.93k
    case MVE_VRINT_FP:
7125
3.13k
      {
7126
3.13k
  switch (arm_decode_field (given, 7, 9))
7127
3.13k
    {
7128
307
    case 0:
7129
307
      func (stream, dis_style_mnemonic, "n");
7130
307
      break;
7131
7132
1.24k
    case 1:
7133
1.24k
      func (stream, dis_style_mnemonic, "x");
7134
1.24k
      break;
7135
7136
217
    case 2:
7137
217
      func (stream, dis_style_mnemonic, "a");
7138
217
      break;
7139
7140
467
    case 3:
7141
467
      func (stream, dis_style_mnemonic, "z");
7142
467
      break;
7143
7144
314
    case 5:
7145
314
      func (stream, dis_style_mnemonic, "m");
7146
314
      break;
7147
7148
315
    case 7:
7149
315
      func (stream, dis_style_mnemonic, "p");
7150
7151
388
    case 4:
7152
581
    case 6:
7153
581
    default:
7154
581
      break;
7155
3.13k
    }
7156
3.13k
      }
7157
3.13k
      break;
7158
7159
3.13k
    default:
7160
0
      break;
7161
7.06k
    }
7162
7.06k
}
7163
7164
static void
7165
print_mve_vcvt_size (struct disassemble_info *info,
7166
         unsigned long given,
7167
         enum mve_instructions matched_insn)
7168
14.5k
{
7169
14.5k
  unsigned long mode = 0;
7170
14.5k
  void *stream = info->stream;
7171
14.5k
  fprintf_styled_ftype func = info->fprintf_styled_func;
7172
7173
14.5k
  switch (matched_insn)
7174
14.5k
    {
7175
5.37k
    case MVE_VCVT_FP_FIX_VEC:
7176
5.37k
      {
7177
5.37k
  mode = (((given & 0x200) >> 7)
7178
5.37k
    | ((given & 0x10000000) >> 27)
7179
5.37k
    | ((given & 0x100) >> 8));
7180
7181
5.37k
  switch (mode)
7182
5.37k
    {
7183
290
    case 0:
7184
290
      func (stream, dis_style_mnemonic, "f16.s16");
7185
290
      break;
7186
7187
280
    case 1:
7188
280
      func (stream, dis_style_mnemonic, "s16.f16");
7189
280
      break;
7190
7191
272
    case 2:
7192
272
      func (stream, dis_style_mnemonic, "f16.u16");
7193
272
      break;
7194
7195
580
    case 3:
7196
580
      func (stream, dis_style_mnemonic, "u16.f16");
7197
580
      break;
7198
7199
1.04k
    case 4:
7200
1.04k
      func (stream, dis_style_mnemonic, "f32.s32");
7201
1.04k
      break;
7202
7203
295
    case 5:
7204
295
      func (stream, dis_style_mnemonic, "s32.f32");
7205
295
      break;
7206
7207
305
    case 6:
7208
305
      func (stream, dis_style_mnemonic, "f32.u32");
7209
305
      break;
7210
7211
2.30k
    case 7:
7212
2.30k
      func (stream, dis_style_mnemonic, "u32.f32");
7213
2.30k
      break;
7214
7215
0
    default:
7216
0
      break;
7217
5.37k
    }
7218
5.37k
  break;
7219
5.37k
      }
7220
5.37k
    case MVE_VCVT_BETWEEN_FP_INT:
7221
4.11k
      {
7222
4.11k
  unsigned long size = arm_decode_field (given, 18, 19);
7223
4.11k
  unsigned long op = arm_decode_field (given, 7, 8);
7224
7225
4.11k
  if (size == 1)
7226
1.46k
    {
7227
1.46k
      switch (op)
7228
1.46k
        {
7229
399
        case 0:
7230
399
    func (stream, dis_style_mnemonic, "f16.s16");
7231
399
    break;
7232
7233
334
        case 1:
7234
334
    func (stream, dis_style_mnemonic, "f16.u16");
7235
334
    break;
7236
7237
237
        case 2:
7238
237
    func (stream, dis_style_mnemonic, "s16.f16");
7239
237
    break;
7240
7241
491
        case 3:
7242
491
    func (stream, dis_style_mnemonic, "u16.f16");
7243
491
    break;
7244
7245
0
        default:
7246
0
    break;
7247
1.46k
        }
7248
1.46k
    }
7249
2.65k
  else if (size == 2)
7250
1.90k
    {
7251
1.90k
      switch (op)
7252
1.90k
        {
7253
243
        case 0:
7254
243
    func (stream, dis_style_mnemonic, "f32.s32");
7255
243
    break;
7256
7257
238
        case 1:
7258
238
    func (stream, dis_style_mnemonic, "f32.u32");
7259
238
    break;
7260
7261
273
        case 2:
7262
273
    func (stream, dis_style_mnemonic, "s32.f32");
7263
273
    break;
7264
7265
1.15k
        case 3:
7266
1.15k
    func (stream, dis_style_mnemonic, "u32.f32");
7267
1.15k
    break;
7268
1.90k
        }
7269
1.90k
    }
7270
4.11k
      }
7271
4.11k
      break;
7272
7273
4.11k
    case MVE_VCVT_FP_HALF_FP:
7274
1.16k
      {
7275
1.16k
  unsigned long op = arm_decode_field (given, 28, 28);
7276
1.16k
  if (op == 0)
7277
638
    func (stream, dis_style_mnemonic, "f16.f32");
7278
527
  else if (op == 1)
7279
527
    func (stream, dis_style_mnemonic, "f32.f16");
7280
1.16k
      }
7281
1.16k
      break;
7282
7283
3.93k
    case MVE_VCVT_FROM_FP_TO_INT:
7284
3.93k
      {
7285
3.93k
  unsigned long size = arm_decode_field_multiple (given, 7, 7, 18, 19);
7286
7287
3.93k
  switch (size)
7288
3.93k
    {
7289
593
    case 2:
7290
593
      func (stream, dis_style_mnemonic, "s16.f16");
7291
593
      break;
7292
7293
449
    case 3:
7294
449
      func (stream, dis_style_mnemonic, "u16.f16");
7295
449
      break;
7296
7297
704
    case 4:
7298
704
      func (stream, dis_style_mnemonic, "s32.f32");
7299
704
      break;
7300
7301
283
    case 5:
7302
283
      func (stream, dis_style_mnemonic, "u32.f32");
7303
283
      break;
7304
7305
1.90k
    default:
7306
1.90k
      break;
7307
3.93k
    }
7308
3.93k
      }
7309
3.93k
      break;
7310
7311
3.93k
    default:
7312
0
      break;
7313
14.5k
    }
7314
14.5k
}
7315
7316
static void
7317
print_mve_rotate (struct disassemble_info *info, unsigned long rot,
7318
      unsigned long rot_width)
7319
7.33k
{
7320
7.33k
  void *stream = info->stream;
7321
7.33k
  fprintf_styled_ftype func = info->fprintf_styled_func;
7322
7323
7.33k
  if (rot_width == 1)
7324
3.37k
    {
7325
3.37k
      switch (rot)
7326
3.37k
  {
7327
1.99k
  case 0:
7328
1.99k
    func (stream, dis_style_immediate, "90");
7329
1.99k
    break;
7330
1.38k
  case 1:
7331
1.38k
    func (stream, dis_style_immediate, "270");
7332
1.38k
    break;
7333
0
  default:
7334
0
    break;
7335
3.37k
  }
7336
3.37k
    }
7337
3.95k
  else if (rot_width == 2)
7338
3.95k
    {
7339
3.95k
      switch (rot)
7340
3.95k
  {
7341
327
  case 0:
7342
327
    func (stream, dis_style_immediate, "0");
7343
327
    break;
7344
2.34k
  case 1:
7345
2.34k
    func (stream, dis_style_immediate, "90");
7346
2.34k
    break;
7347
467
  case 2:
7348
467
    func (stream, dis_style_immediate, "180");
7349
467
    break;
7350
822
  case 3:
7351
822
    func (stream, dis_style_immediate, "270");
7352
822
    break;
7353
0
  default:
7354
0
    break;
7355
3.95k
  }
7356
3.95k
    }
7357
7.33k
}
7358
7359
static void
7360
print_instruction_predicate (struct disassemble_info *info)
7361
139k
{
7362
139k
  void *stream = info->stream;
7363
139k
  fprintf_styled_ftype func = info->fprintf_styled_func;
7364
7365
139k
  if (vpt_block_state.next_pred_state == PRED_THEN)
7366
4.89k
    func (stream, dis_style_mnemonic, "t");
7367
134k
  else if (vpt_block_state.next_pred_state == PRED_ELSE)
7368
1.86k
    func (stream, dis_style_mnemonic, "e");
7369
139k
}
7370
7371
static void
7372
print_mve_size (struct disassemble_info *info,
7373
    unsigned long size,
7374
    enum mve_instructions matched_insn)
7375
121k
{
7376
121k
  void *stream = info->stream;
7377
121k
  fprintf_styled_ftype func = info->fprintf_styled_func;
7378
7379
121k
  switch (matched_insn)
7380
121k
    {
7381
929
    case MVE_VABAV:
7382
1.38k
    case MVE_VABD_VEC:
7383
1.66k
    case MVE_VABS_FP:
7384
2.31k
    case MVE_VABS_VEC:
7385
2.63k
    case MVE_VADD_VEC_T1:
7386
3.08k
    case MVE_VADD_VEC_T2:
7387
3.33k
    case MVE_VADDV:
7388
4.37k
    case MVE_VBRSR:
7389
5.31k
    case MVE_VCADD_VEC:
7390
5.58k
    case MVE_VCLS:
7391
5.81k
    case MVE_VCLZ:
7392
6.12k
    case MVE_VCMP_VEC_T1:
7393
6.41k
    case MVE_VCMP_VEC_T2:
7394
6.67k
    case MVE_VCMP_VEC_T3:
7395
7.09k
    case MVE_VCMP_VEC_T4:
7396
7.46k
    case MVE_VCMP_VEC_T5:
7397
7.74k
    case MVE_VCMP_VEC_T6:
7398
8.15k
    case MVE_VCTP:
7399
9.31k
    case MVE_VDDUP:
7400
10.1k
    case MVE_VDWDUP:
7401
10.8k
    case MVE_VHADD_T1:
7402
11.7k
    case MVE_VHADD_T2:
7403
13.3k
    case MVE_VHCADD:
7404
13.8k
    case MVE_VHSUB_T1:
7405
14.3k
    case MVE_VHSUB_T2:
7406
14.8k
    case MVE_VIDUP:
7407
16.2k
    case MVE_VIWDUP:
7408
16.9k
    case MVE_VLD2:
7409
17.2k
    case MVE_VLD4:
7410
18.5k
    case MVE_VLDRB_GATHER_T1:
7411
20.5k
    case MVE_VLDRH_GATHER_T2:
7412
20.5k
    case MVE_VLDRW_GATHER_T3:
7413
20.5k
    case MVE_VLDRD_GATHER_T4:
7414
21.4k
    case MVE_VLDRB_T1:
7415
22.1k
    case MVE_VLDRH_T2:
7416
22.4k
    case MVE_VMAX:
7417
22.7k
    case MVE_VMAXA:
7418
23.3k
    case MVE_VMAXV:
7419
23.7k
    case MVE_VMAXAV:
7420
24.2k
    case MVE_VMIN:
7421
24.5k
    case MVE_VMINA:
7422
24.8k
    case MVE_VMINV:
7423
25.2k
    case MVE_VMINAV:
7424
25.9k
    case MVE_VMLA:
7425
26.3k
    case MVE_VMLAS:
7426
26.7k
    case MVE_VMUL_VEC_T1:
7427
27.4k
    case MVE_VMUL_VEC_T2:
7428
28.1k
    case MVE_VMULH:
7429
29.7k
    case MVE_VRMULH:
7430
31.3k
    case MVE_VMULL_INT:
7431
31.6k
    case MVE_VNEG_FP:
7432
32.4k
    case MVE_VNEG_VEC:
7433
33.8k
    case MVE_VPT_VEC_T1:
7434
34.7k
    case MVE_VPT_VEC_T2:
7435
36.1k
    case MVE_VPT_VEC_T3:
7436
37.3k
    case MVE_VPT_VEC_T4:
7437
38.2k
    case MVE_VPT_VEC_T5:
7438
39.5k
    case MVE_VPT_VEC_T6:
7439
40.1k
    case MVE_VQABS:
7440
41.3k
    case MVE_VQADD_T1:
7441
42.0k
    case MVE_VQADD_T2:
7442
42.5k
    case MVE_VQDMLADH:
7443
43.4k
    case MVE_VQRDMLADH:
7444
44.1k
    case MVE_VQDMLAH:
7445
44.5k
    case MVE_VQRDMLAH:
7446
44.9k
    case MVE_VQDMLASH:
7447
45.6k
    case MVE_VQRDMLASH:
7448
45.9k
    case MVE_VQDMLSDH:
7449
47.2k
    case MVE_VQRDMLSDH:
7450
47.5k
    case MVE_VQDMULH_T1:
7451
48.0k
    case MVE_VQRDMULH_T2:
7452
48.6k
    case MVE_VQDMULH_T3:
7453
49.3k
    case MVE_VQRDMULH_T4:
7454
49.6k
    case MVE_VQNEG:
7455
50.1k
    case MVE_VQRSHL_T1:
7456
50.4k
    case MVE_VQRSHL_T2:
7457
50.6k
    case MVE_VQSHL_T1:
7458
50.9k
    case MVE_VQSHL_T4:
7459
51.1k
    case MVE_VQSUB_T1:
7460
51.6k
    case MVE_VQSUB_T2:
7461
52.1k
    case MVE_VREV32:
7462
52.7k
    case MVE_VREV64:
7463
53.8k
    case MVE_VRHADD:
7464
56.9k
    case MVE_VRINT_FP:
7465
57.4k
    case MVE_VRSHL_T1:
7466
57.7k
    case MVE_VRSHL_T2:
7467
58.2k
    case MVE_VSHL_T2:
7468
58.7k
    case MVE_VSHL_T3:
7469
59.0k
    case MVE_VSHLL_T2:
7470
60.3k
    case MVE_VST2:
7471
61.2k
    case MVE_VST4:
7472
63.5k
    case MVE_VSTRB_SCATTER_T1:
7473
64.7k
    case MVE_VSTRH_SCATTER_T2:
7474
66.2k
    case MVE_VSTRW_SCATTER_T3:
7475
66.9k
    case MVE_VSTRB_T1:
7476
67.8k
    case MVE_VSTRH_T2:
7477
68.1k
    case MVE_VSUB_VEC_T1:
7478
68.4k
    case MVE_VSUB_VEC_T2:
7479
68.4k
      if (size <= 3)
7480
68.4k
  func (stream, dis_style_mnemonic, "%s", mve_vec_sizename[size]);
7481
0
      else
7482
0
  func (stream, dis_style_text, "<undef size>");
7483
68.4k
      break;
7484
7485
319
    case MVE_VABD_FP:
7486
610
    case MVE_VADD_FP_T1:
7487
912
    case MVE_VADD_FP_T2:
7488
1.12k
    case MVE_VSUB_FP_T1:
7489
1.46k
    case MVE_VSUB_FP_T2:
7490
2.00k
    case MVE_VCMP_FP_T1:
7491
2.59k
    case MVE_VCMP_FP_T2:
7492
3.20k
    case MVE_VFMA_FP_SCALAR:
7493
3.77k
    case MVE_VFMA_FP:
7494
4.07k
    case MVE_VFMS_FP:
7495
4.88k
    case MVE_VFMAS_FP_SCALAR:
7496
5.21k
    case MVE_VMAXNM_FP:
7497
6.71k
    case MVE_VMAXNMA_FP:
7498
6.93k
    case MVE_VMAXNMV_FP:
7499
7.29k
    case MVE_VMAXNMAV_FP:
7500
7.60k
    case MVE_VMINNM_FP:
7501
8.06k
    case MVE_VMINNMA_FP:
7502
8.51k
    case MVE_VMINNMV_FP:
7503
8.79k
    case MVE_VMINNMAV_FP:
7504
9.10k
    case MVE_VMUL_FP_T1:
7505
9.47k
    case MVE_VMUL_FP_T2:
7506
11.4k
    case MVE_VPT_FP_T1:
7507
13.4k
    case MVE_VPT_FP_T2:
7508
13.4k
      if (size == 0)
7509
7.53k
  func (stream, dis_style_mnemonic, "32");
7510
5.94k
      else if (size == 1)
7511
5.94k
  func (stream, dis_style_mnemonic, "16");
7512
13.4k
      break;
7513
7514
826
    case MVE_VCADD_FP:
7515
3.45k
    case MVE_VCMLA_FP:
7516
4.78k
    case MVE_VCMUL_FP:
7517
5.50k
    case MVE_VMLADAV_T1:
7518
6.83k
    case MVE_VMLALDAV:
7519
7.15k
    case MVE_VMLSDAV_T1:
7520
7.92k
    case MVE_VMLSLDAV:
7521
8.33k
    case MVE_VMOVN:
7522
9.06k
    case MVE_VQDMULL_T1:
7523
11.6k
    case MVE_VQDMULL_T2:
7524
12.0k
    case MVE_VQMOVN:
7525
12.3k
    case MVE_VQMOVUN:
7526
12.3k
      if (size == 0)
7527
4.93k
  func (stream, dis_style_mnemonic, "16");
7528
7.44k
      else if (size == 1)
7529
6.81k
  func (stream, dis_style_mnemonic, "32");
7530
12.3k
      break;
7531
7532
1.10k
    case MVE_VMOVL:
7533
1.10k
      if (size == 1)
7534
362
  func (stream, dis_style_mnemonic, "8");
7535
746
      else if (size == 2)
7536
746
  func (stream, dis_style_mnemonic, "16");
7537
1.10k
      break;
7538
7539
1.48k
    case MVE_VDUP:
7540
1.48k
      switch (size)
7541
1.48k
  {
7542
206
  case 0:
7543
206
    func (stream, dis_style_mnemonic, "32");
7544
206
    break;
7545
257
  case 1:
7546
257
    func (stream, dis_style_mnemonic, "16");
7547
257
    break;
7548
765
  case 2:
7549
765
    func (stream, dis_style_mnemonic, "8");
7550
765
    break;
7551
256
  default:
7552
256
    break;
7553
1.48k
  }
7554
1.48k
      break;
7555
7556
1.48k
    case MVE_VMOV_GP_TO_VEC_LANE:
7557
1.99k
    case MVE_VMOV_VEC_LANE_TO_GP:
7558
1.99k
      switch (size)
7559
1.99k
  {
7560
0
  case 0: case 4:
7561
0
    func (stream, dis_style_mnemonic, "32");
7562
0
    break;
7563
7564
0
  case 1: case 3:
7565
0
  case 5: case 7:
7566
0
    func (stream, dis_style_mnemonic, "16");
7567
0
    break;
7568
7569
0
  case 8: case 9: case 10: case 11:
7570
0
  case 12: case 13: case 14: case 15:
7571
0
    func (stream, dis_style_mnemonic, "8");
7572
0
    break;
7573
7574
1.99k
  default:
7575
1.99k
    break;
7576
1.99k
  }
7577
1.99k
      break;
7578
7579
4.07k
    case MVE_VMOV_IMM_TO_VEC:
7580
4.07k
      switch (size)
7581
4.07k
  {
7582
995
  case 0: case 4: case 8:
7583
1.84k
  case 12: case 24: case 26:
7584
1.84k
    func (stream, dis_style_mnemonic, "i32");
7585
1.84k
    break;
7586
570
  case 16: case 20:
7587
570
    func (stream, dis_style_mnemonic, "i16");
7588
570
    break;
7589
410
  case 28:
7590
410
    func (stream, dis_style_mnemonic, "i8");
7591
410
    break;
7592
942
  case 29:
7593
942
    func (stream, dis_style_mnemonic, "i64");
7594
942
    break;
7595
315
  case 30:
7596
315
    func (stream, dis_style_mnemonic, "f32");
7597
315
    break;
7598
0
  default:
7599
0
    break;
7600
4.07k
  }
7601
4.07k
      break;
7602
7603
4.07k
    case MVE_VMULL_POLY:
7604
1.42k
      if (size == 0)
7605
896
  func (stream, dis_style_mnemonic, "p8");
7606
531
      else if (size == 1)
7607
531
  func (stream, dis_style_mnemonic, "p16");
7608
1.42k
      break;
7609
7610
3.34k
    case MVE_VMVN_IMM:
7611
3.34k
      switch (size)
7612
3.34k
  {
7613
1.49k
  case 0: case 2: case 4:
7614
2.56k
  case 6: case 12: case 13:
7615
2.56k
    func (stream, dis_style_mnemonic, "32");
7616
2.56k
    break;
7617
7618
780
  case 8: case 10:
7619
780
    func (stream, dis_style_mnemonic, "16");
7620
780
    break;
7621
7622
0
  default:
7623
0
    break;
7624
3.34k
  }
7625
3.34k
      break;
7626
7627
3.38k
    case MVE_VBIC_IMM:
7628
3.72k
    case MVE_VORR_IMM:
7629
3.72k
      switch (size)
7630
3.72k
  {
7631
1.04k
  case 1: case 3:
7632
2.75k
  case 5: case 7:
7633
2.75k
    func (stream, dis_style_mnemonic, "32");
7634
2.75k
    break;
7635
7636
971
  case 9: case 11:
7637
971
    func (stream, dis_style_mnemonic, "16");
7638
971
    break;
7639
7640
0
  default:
7641
0
    break;
7642
3.72k
  }
7643
3.72k
      break;
7644
7645
3.72k
    case MVE_VQSHRN:
7646
1.64k
    case MVE_VQSHRUN:
7647
2.00k
    case MVE_VQRSHRN:
7648
2.47k
    case MVE_VQRSHRUN:
7649
2.85k
    case MVE_VRSHRN:
7650
3.38k
    case MVE_VSHRN:
7651
3.38k
      {
7652
3.38k
  switch (size)
7653
3.38k
  {
7654
1.79k
  case 1:
7655
1.79k
    func (stream, dis_style_mnemonic, "16");
7656
1.79k
    break;
7657
7658
1.15k
  case 2: case 3:
7659
1.15k
    func (stream, dis_style_mnemonic, "32");
7660
1.15k
    break;
7661
7662
435
  default:
7663
435
    break;
7664
3.38k
  }
7665
3.38k
      }
7666
3.38k
      break;
7667
7668
3.38k
    case MVE_VQSHL_T2:
7669
1.82k
    case MVE_VQSHLU_T3:
7670
2.54k
    case MVE_VRSHR:
7671
3.85k
    case MVE_VSHL_T1:
7672
5.03k
    case MVE_VSHLL_T1:
7673
6.37k
    case MVE_VSHR:
7674
6.75k
    case MVE_VSLI:
7675
7.05k
    case MVE_VSRI:
7676
7.05k
      {
7677
7.05k
  switch (size)
7678
7.05k
  {
7679
827
  case 1:
7680
827
    func (stream, dis_style_mnemonic, "8");
7681
827
    break;
7682
7683
1.68k
  case 2: case 3:
7684
1.68k
    func (stream, dis_style_mnemonic, "16");
7685
1.68k
    break;
7686
7687
3.91k
  case 4: case 5: case 6: case 7:
7688
3.91k
    func (stream, dis_style_mnemonic, "32");
7689
3.91k
    break;
7690
7691
633
  default:
7692
633
    break;
7693
7.05k
  }
7694
7.05k
      }
7695
7.05k
      break;
7696
7697
7.05k
    default:
7698
0
      break;
7699
121k
    }
7700
121k
}
7701
7702
/* Return true if INSN is a shift insn with an immediate shift amount
7703
   which needs decoding as per print_mve_shift_n.  */
7704
7705
static bool
7706
mve_shift_insn_p (enum mve_instructions insn)
7707
14.8k
{
7708
14.8k
  switch (insn)
7709
14.8k
    {
7710
685
    case MVE_VQSHL_T2:
7711
1.82k
    case MVE_VQSHLU_T3:
7712
2.26k
    case MVE_VQSHRN:
7713
3.47k
    case MVE_VQSHRUN:
7714
3.82k
    case MVE_VQRSHRN:
7715
4.29k
    case MVE_VQRSHRUN:
7716
5.01k
    case MVE_VRSHR:
7717
5.39k
    case MVE_VRSHRN:
7718
6.71k
    case MVE_VSHL_T1:
7719
7.88k
    case MVE_VSHLL_T1:
7720
9.22k
    case MVE_VSHR:
7721
9.75k
    case MVE_VSHRN:
7722
10.1k
    case MVE_VSLI:
7723
10.4k
    case MVE_VSRI:
7724
10.4k
      return true;
7725
4.44k
    default:
7726
4.44k
      return false;
7727
14.8k
    }
7728
14.8k
}
7729
7730
static void
7731
print_mve_shift_n (struct disassemble_info *info, long given,
7732
       enum mve_instructions matched_insn)
7733
10.4k
{
7734
10.4k
  void *stream = info->stream;
7735
10.4k
  fprintf_styled_ftype func = info->fprintf_styled_func;
7736
7737
10.4k
  int startAt0
7738
10.4k
    = matched_insn == MVE_VQSHL_T2
7739
9.76k
      || matched_insn == MVE_VQSHLU_T3
7740
8.62k
      || matched_insn == MVE_VSHL_T1
7741
7.31k
      || matched_insn == MVE_VSHLL_T1
7742
6.13k
      || matched_insn == MVE_VSLI;
7743
7744
10.4k
  unsigned imm6 = (given & 0x3f0000) >> 16;
7745
7746
10.4k
  if (matched_insn == MVE_VSHLL_T1)
7747
1.17k
    imm6 &= 0x1f;
7748
7749
10.4k
  unsigned shiftAmount = 0;
7750
10.4k
  if ((imm6 & 0x20) != 0)
7751
3.91k
    shiftAmount = startAt0 ? imm6 - 32 : 64 - imm6;
7752
6.53k
  else if ((imm6 & 0x10) != 0)
7753
2.83k
    shiftAmount = startAt0 ? imm6 - 16 : 32 - imm6;
7754
3.69k
  else if ((imm6 & 0x08) != 0)
7755
2.62k
    shiftAmount = startAt0 ? imm6 - 8 : 16 - imm6;
7756
1.06k
  else
7757
1.06k
    print_mve_undefined (info, UNDEF_SIZE_0);
7758
7759
10.4k
  func (stream, dis_style_immediate, "%u", shiftAmount);
7760
10.4k
}
7761
7762
static void
7763
print_vec_condition (struct disassemble_info *info, long given,
7764
         enum mve_instructions matched_insn)
7765
14.1k
{
7766
14.1k
  void *stream = info->stream;
7767
14.1k
  fprintf_styled_ftype func = info->fprintf_styled_func;
7768
14.1k
  long vec_cond = 0;
7769
7770
14.1k
  switch (matched_insn)
7771
14.1k
    {
7772
2.01k
    case MVE_VPT_FP_T1:
7773
2.55k
    case MVE_VCMP_FP_T1:
7774
2.55k
      vec_cond = (((given & 0x1000) >> 10)
7775
2.55k
      | ((given & 1) << 1)
7776
2.55k
      | ((given & 0x0080) >> 7));
7777
2.55k
      func (stream, dis_style_sub_mnemonic, "%s", vec_condnames[vec_cond]);
7778
2.55k
      break;
7779
7780
1.99k
    case MVE_VPT_FP_T2:
7781
2.58k
    case MVE_VCMP_FP_T2:
7782
2.58k
      vec_cond = (((given & 0x1000) >> 10)
7783
2.58k
      | ((given & 0x0020) >> 4)
7784
2.58k
      | ((given & 0x0080) >> 7));
7785
2.58k
      func (stream, dis_style_sub_mnemonic, "%s", vec_condnames[vec_cond]);
7786
2.58k
      break;
7787
7788
1.31k
    case MVE_VPT_VEC_T1:
7789
1.62k
    case MVE_VCMP_VEC_T1:
7790
1.62k
      vec_cond = (given & 0x0080) >> 7;
7791
1.62k
      func (stream, dis_style_sub_mnemonic, "%s", vec_condnames[vec_cond]);
7792
1.62k
      break;
7793
7794
957
    case MVE_VPT_VEC_T2:
7795
1.24k
    case MVE_VCMP_VEC_T2:
7796
1.24k
      vec_cond = 2 | ((given & 0x0080) >> 7);
7797
1.24k
      func (stream, dis_style_sub_mnemonic, "%s", vec_condnames[vec_cond]);
7798
1.24k
      break;
7799
7800
1.41k
    case MVE_VPT_VEC_T3:
7801
1.67k
    case MVE_VCMP_VEC_T3:
7802
1.67k
      vec_cond = 4 | ((given & 1) << 1) | ((given & 0x0080) >> 7);
7803
1.67k
      func (stream, dis_style_sub_mnemonic, "%s", vec_condnames[vec_cond]);
7804
1.67k
      break;
7805
7806
1.17k
    case MVE_VPT_VEC_T4:
7807
1.59k
    case MVE_VCMP_VEC_T4:
7808
1.59k
      vec_cond = (given & 0x0080) >> 7;
7809
1.59k
      func (stream, dis_style_sub_mnemonic, "%s", vec_condnames[vec_cond]);
7810
1.59k
      break;
7811
7812
864
    case MVE_VPT_VEC_T5:
7813
1.23k
    case MVE_VCMP_VEC_T5:
7814
1.23k
      vec_cond = 2 | ((given & 0x0080) >> 7);
7815
1.23k
      func (stream, dis_style_sub_mnemonic, "%s", vec_condnames[vec_cond]);
7816
1.23k
      break;
7817
7818
1.32k
    case MVE_VPT_VEC_T6:
7819
1.60k
    case MVE_VCMP_VEC_T6:
7820
1.60k
      vec_cond = 4 | ((given & 0x0020) >> 4) | ((given & 0x0080) >> 7);
7821
1.60k
      func (stream, dis_style_sub_mnemonic, "%s", vec_condnames[vec_cond]);
7822
1.60k
      break;
7823
7824
0
    case MVE_NONE:
7825
0
    case MVE_VPST:
7826
0
    default:
7827
0
      break;
7828
14.1k
    }
7829
14.1k
}
7830
7831
705k
#define W_BIT 21
7832
120k
#define I_BIT 22
7833
1.28M
#define U_BIT 23
7834
997k
#define P_BIT 24
7835
7836
881k
#define WRITEBACK_BIT_SET (given & (1 << W_BIT))
7837
167k
#define IMMEDIATE_BIT_SET (given & (1 << I_BIT))
7838
1.47M
#define NEGATIVE_BIT_SET  ((given & (1 << U_BIT)) == 0)
7839
1.25M
#define PRE_BIT_SET   (given & (1 << P_BIT))
7840
7841
/* The assembler string for an instruction can include %{X:...%} patterns,
7842
   where the 'X' is one of the characters understood by this function.
7843
7844
   This function takes the X character, and returns a new style.  This new
7845
   style will be used by the caller to temporarily change the current base
7846
   style.  */
7847
7848
static enum disassembler_style
7849
decode_base_style (const char x)
7850
3.58M
{
7851
3.58M
  switch (x)
7852
3.58M
    {
7853
0
    case 'A': return dis_style_address;
7854
5.53k
    case 'B': return dis_style_sub_mnemonic;
7855
0
    case 'C': return dis_style_comment_start;
7856
0
    case 'D': return dis_style_assembler_directive;
7857
2.49M
    case 'I': return dis_style_immediate;
7858
0
    case 'M': return dis_style_mnemonic;
7859
0
    case 'O': return dis_style_address_offset;
7860
1.08M
    case 'R': return dis_style_register;
7861
0
    case 'S': return dis_style_symbol;
7862
0
    case 'T': return dis_style_text;
7863
0
    default:
7864
0
      abort ();
7865
3.58M
    }
7866
3.58M
}
7867
7868
/* Print one coprocessor instruction on INFO->STREAM.
7869
   Return TRUE if the instuction matched, FALSE if this is not a
7870
   recognised coprocessor instruction.  */
7871
7872
static bool
7873
print_insn_coprocessor_1 (const struct sopcode32 *opcodes,
7874
        bfd_vma pc,
7875
        struct disassemble_info *info,
7876
        long given,
7877
        bool thumb)
7878
9.19M
{
7879
9.19M
  const struct sopcode32 *insn;
7880
9.19M
  void *stream = info->stream;
7881
9.19M
  fprintf_styled_ftype func = info->fprintf_styled_func;
7882
9.19M
  unsigned long mask;
7883
9.19M
  unsigned long value = 0;
7884
9.19M
  int cond;
7885
9.19M
  int cp_num;
7886
9.19M
  struct arm_private_data *private_data = info->private_data;
7887
9.19M
  arm_feature_set allowed_arches = ARM_ARCH_NONE;
7888
9.19M
  arm_feature_set arm_ext_v8_1m_main =
7889
9.19M
    ARM_FEATURE_CORE_HIGH (ARM_EXT2_V8_1M_MAIN);
7890
9.19M
  enum disassembler_style base_style = dis_style_mnemonic;
7891
9.19M
  enum disassembler_style old_base_style = base_style;
7892
7893
9.19M
  allowed_arches = private_data->features;
7894
7895
1.03G
  for (insn = opcodes; insn->assembler; insn++)
7896
1.02G
    {
7897
1.02G
      unsigned long u_reg = 16;
7898
1.02G
      bool is_unpredictable = false;
7899
1.02G
      signed long value_in_comment = 0;
7900
1.02G
      const char *c;
7901
7902
1.02G
      if (ARM_FEATURE_ZERO (insn->arch))
7903
9.52M
  switch (insn->value)
7904
9.52M
    {
7905
4.74M
    case SENTINEL_IWMMXT_START:
7906
4.74M
      if (info->mach != bfd_mach_arm_XScale
7907
4.72M
    && info->mach != bfd_mach_arm_iWMMXt
7908
4.70M
    && info->mach != bfd_mach_arm_iWMMXt2)
7909
4.67M
        do
7910
355M
    insn++;
7911
355M
        while ((! ARM_FEATURE_ZERO (insn->arch))
7912
350M
         && insn->value != SENTINEL_IWMMXT_END);
7913
4.74M
      continue;
7914
7915
66.7k
    case SENTINEL_IWMMXT_END:
7916
66.7k
      continue;
7917
7918
4.70M
    case SENTINEL_GENERIC_START:
7919
4.70M
      allowed_arches = private_data->features;
7920
4.70M
      continue;
7921
7922
0
    default:
7923
0
      abort ();
7924
9.52M
    }
7925
7926
1.01G
      mask = insn->mask;
7927
1.01G
      value = insn->value;
7928
1.01G
      cp_num = (given >> 8) & 0xf;
7929
7930
1.01G
      if (thumb)
7931
185M
  {
7932
    /* The high 4 bits are 0xe for Arm conditional instructions, and
7933
       0xe for arm unconditional instructions.  The rest of the
7934
       encoding is the same.  */
7935
185M
    mask |= 0xf0000000;
7936
185M
    value |= 0xe0000000;
7937
185M
    if (ifthen_state)
7938
6.11M
      cond = IFTHEN_COND;
7939
179M
    else
7940
179M
      cond = COND_UNCOND;
7941
185M
  }
7942
830M
      else
7943
830M
  {
7944
    /* Only match unconditional instuctions against unconditional
7945
       patterns.  */
7946
830M
    if ((given & 0xf0000000) == 0xf0000000)
7947
64.7M
      {
7948
64.7M
        mask |= 0xf0000000;
7949
64.7M
        cond = COND_UNCOND;
7950
64.7M
      }
7951
765M
    else
7952
765M
      {
7953
765M
        cond = (given >> 28) & 0xf;
7954
765M
        if (cond == 0xe)
7955
28.8M
    cond = COND_UNCOND;
7956
765M
      }
7957
830M
  }
7958
7959
1.01G
      if ((insn->isa == T32 && !thumb)
7960
1.00G
    || (insn->isa == ARM && thumb))
7961
7.73M
  continue;
7962
7963
1.00G
      if ((given & mask) != value)
7964
1.00G
  continue;
7965
7966
613k
      if (! ARM_CPU_HAS_FEATURE (insn->arch, allowed_arches))
7967
74.7k
  continue;
7968
7969
538k
      if (insn->value == 0xfe000010     /* mcr2  */
7970
527k
    || insn->value == 0xfe100010  /* mrc2  */
7971
510k
    || insn->value == 0xfc100000  /* ldc2  */
7972
480k
    || insn->value == 0xfc000000) /* stc2  */
7973
80.0k
  {
7974
80.0k
    if (cp_num == 9 || cp_num == 10 || cp_num == 11)
7975
9.94k
      is_unpredictable = true;
7976
7977
    /* Armv8.1-M Mainline FP & MVE instructions.  */
7978
80.0k
    if (ARM_CPU_HAS_FEATURE (arm_ext_v8_1m_main, allowed_arches)
7979
71.8k
        && !ARM_CPU_IS_ANY (allowed_arches)
7980
46.3k
        && (cp_num == 8 || cp_num == 14 || cp_num == 15))
7981
17.8k
      continue;
7982
7983
80.0k
  }
7984
458k
      else if (insn->value == 0x0e000000     /* cdp  */
7985
350k
         || insn->value == 0xfe000000  /* cdp2  */
7986
327k
         || insn->value == 0x0e000010  /* mcr  */
7987
298k
         || insn->value == 0x0e100010  /* mrc  */
7988
275k
         || insn->value == 0x0c100000  /* ldc  */
7989
193k
         || insn->value == 0x0c000000) /* stc  */
7990
393k
  {
7991
    /* Floating-point instructions.  */
7992
393k
    if (cp_num == 9 || cp_num == 10 || cp_num == 11)
7993
24.0k
      continue;
7994
7995
    /* Armv8.1-M Mainline FP & MVE instructions.  */
7996
369k
    if (ARM_CPU_HAS_FEATURE (arm_ext_v8_1m_main, allowed_arches)
7997
233k
        && !ARM_CPU_IS_ANY (allowed_arches)
7998
10.9k
        && (cp_num == 8 || cp_num == 14 || cp_num == 15))
7999
3.40k
      continue;
8000
369k
  }
8001
65.0k
      else if ((insn->value == 0xec100f80      /* vldr (system register) */
8002
62.6k
    || insn->value == 0xec000f80)  /* vstr (system register) */
8003
8.61k
         && arm_decode_field (given, 24, 24) == 0
8004
6.90k
         && arm_decode_field (given, 21, 21) == 0)
8005
  /* If the P and W bits are both 0 then these encodings match the MVE
8006
     VLDR and VSTR instructions, these are in a different table, so we
8007
     don't let it match here.  */
8008
4.64k
  continue;
8009
8010
13.6M
      for (c = insn->assembler; *c; c++)
8011
13.1M
  {
8012
13.1M
    if (*c == '%')
8013
5.91M
      {
8014
5.91M
        const char mod = *++c;
8015
8016
5.91M
        switch (mod)
8017
5.91M
    {
8018
1.57M
    case '{':
8019
1.57M
      ++c;
8020
1.57M
      if (*c == '\0')
8021
0
        abort ();
8022
1.57M
      old_base_style = base_style;
8023
1.57M
      base_style = decode_base_style (*c);
8024
1.57M
      ++c;
8025
1.57M
      if (*c != ':')
8026
0
        abort ();
8027
1.57M
      break;
8028
8029
1.57M
    case '}':
8030
1.57M
      base_style = old_base_style;
8031
1.57M
      break;
8032
8033
0
    case '%':
8034
0
      func (stream, base_style, "%%");
8035
0
      break;
8036
8037
241k
    case 'A':
8038
245k
    case 'K':
8039
245k
      {
8040
245k
        int rn = (given >> 16) & 0xf;
8041
245k
        bfd_vma offset = given & 0xff;
8042
8043
245k
        if (mod == 'K')
8044
3.96k
          offset = given & 0x7f;
8045
8046
245k
        func (stream, dis_style_text, "[");
8047
245k
        func (stream, dis_style_register, "%s",
8048
245k
        arm_regnames [(given >> 16) & 0xf]);
8049
8050
245k
        if (PRE_BIT_SET || WRITEBACK_BIT_SET)
8051
179k
          {
8052
      /* Not unindexed.  The offset is scaled.  */
8053
179k
      if (cp_num == 9)
8054
        /* vldr.16/vstr.16 will shift the address
8055
           left by 1 bit only.  */
8056
3.56k
        offset = offset * 2;
8057
176k
      else
8058
176k
        offset = offset * 4;
8059
8060
179k
      if (NEGATIVE_BIT_SET)
8061
97.9k
        offset = - offset;
8062
179k
      if (rn != 15)
8063
166k
        value_in_comment = offset;
8064
179k
          }
8065
8066
245k
        if (PRE_BIT_SET)
8067
125k
          {
8068
125k
      if (offset)
8069
95.7k
        {
8070
95.7k
          func (stream, dis_style_text, ", ");
8071
95.7k
          func (stream, dis_style_immediate, "#%d",
8072
95.7k
          (int) offset);
8073
95.7k
          func (stream, dis_style_text, "]%s",
8074
95.7k
          WRITEBACK_BIT_SET ? "!" : "");
8075
95.7k
        }
8076
30.2k
      else if (NEGATIVE_BIT_SET)
8077
22.8k
        {
8078
22.8k
          func (stream, dis_style_text, ", ");
8079
22.8k
          func (stream, dis_style_immediate, "#-0");
8080
22.8k
          func (stream, dis_style_text, "]");
8081
22.8k
        }
8082
7.39k
      else
8083
7.39k
        func (stream, dis_style_text, "]");
8084
125k
          }
8085
119k
        else
8086
119k
          {
8087
119k
      func (stream, dis_style_text, "]");
8088
8089
119k
      if (WRITEBACK_BIT_SET)
8090
53.8k
        {
8091
53.8k
          if (offset)
8092
47.7k
            {
8093
47.7k
        func (stream, dis_style_text, ", ");
8094
47.7k
        func (stream, dis_style_immediate,
8095
47.7k
              "#%d", (int) offset);
8096
47.7k
            }
8097
6.06k
          else if (NEGATIVE_BIT_SET)
8098
1.90k
            {
8099
1.90k
        func (stream, dis_style_text, ", ");
8100
1.90k
        func (stream, dis_style_immediate, "#-0");
8101
1.90k
            }
8102
53.8k
        }
8103
66.0k
      else
8104
66.0k
        {
8105
66.0k
          func (stream, dis_style_text, ", {");
8106
66.0k
          func (stream, dis_style_immediate, "%s%d",
8107
66.0k
          (NEGATIVE_BIT_SET && !offset) ? "-" : "",
8108
66.0k
          (int) offset);
8109
66.0k
          func (stream, dis_style_text, "}");
8110
66.0k
          value_in_comment = offset;
8111
66.0k
        }
8112
119k
          }
8113
245k
        if (rn == 15 && (PRE_BIT_SET || WRITEBACK_BIT_SET))
8114
13.2k
          {
8115
13.2k
      func (stream, dis_style_comment_start, "\t@ ");
8116
      /* For unaligned PCs, apply off-by-alignment
8117
         correction.  */
8118
13.2k
      info->print_address_func (offset + pc
8119
13.2k
              + info->bytes_per_chunk * 2
8120
13.2k
              - (pc & 3),
8121
13.2k
              info);
8122
13.2k
          }
8123
245k
      }
8124
245k
      break;
8125
8126
3.23k
    case 'B':
8127
3.23k
      {
8128
3.23k
        int regno = ((given >> 12) & 0xf) | ((given >> (22 - 4)) & 0x10);
8129
3.23k
        int offset = (given >> 1) & 0x3f;
8130
8131
3.23k
        func (stream, dis_style_text, "{");
8132
3.23k
        if (offset == 1)
8133
291
          func (stream, dis_style_register, "d%d", regno);
8134
2.94k
        else if (regno + offset > 32)
8135
2.41k
          {
8136
2.41k
      func (stream, dis_style_register, "d%d", regno);
8137
2.41k
      func (stream, dis_style_text, "-<overflow reg d%d>",
8138
2.41k
            regno + offset - 1);
8139
2.41k
          }
8140
525
        else
8141
525
          {
8142
525
      func (stream, dis_style_register, "d%d", regno);
8143
525
      func (stream, dis_style_text, "-");
8144
525
      func (stream, dis_style_register, "d%d",
8145
525
            regno + offset - 1);
8146
525
          }
8147
3.23k
        func (stream, dis_style_text, "}");
8148
3.23k
      }
8149
3.23k
      break;
8150
8151
2.48k
    case 'C':
8152
2.48k
      {
8153
2.48k
        bool single = ((given >> 8) & 1) == 0;
8154
2.48k
        char reg_prefix = single ? 's' : 'd';
8155
2.48k
        int Dreg = (given >> 22) & 0x1;
8156
2.48k
        int Vdreg = (given >> 12) & 0xf;
8157
2.48k
        int reg = single ? ((Vdreg << 1) | Dreg)
8158
2.48k
             : ((Dreg << 4) | Vdreg);
8159
2.48k
        int num = (given >> (single ? 0 : 1)) & 0x7f;
8160
2.48k
        int maxreg = single ? 31 : 15;
8161
2.48k
        int topreg = reg + num - 1;
8162
8163
2.48k
        func (stream, dis_style_text, "{");
8164
2.48k
        if (!num)
8165
400
          {
8166
      /* Nothing.  */
8167
400
          }
8168
2.08k
        else if (num == 1)
8169
400
          {
8170
400
      func (stream, dis_style_register,
8171
400
            "%c%d", reg_prefix, reg);
8172
400
      func (stream, dis_style_text, ", ");
8173
400
          }
8174
1.68k
        else if (topreg > maxreg)
8175
1.44k
          {
8176
1.44k
      func (stream, dis_style_register, "%c%d",
8177
1.44k
            reg_prefix, reg);
8178
1.44k
      func (stream, dis_style_text, "-<overflow reg d%d, ",
8179
1.44k
            single ? topreg >> 1 : topreg);
8180
1.44k
          }
8181
236
        else
8182
236
          {
8183
236
      func (stream, dis_style_register,
8184
236
            "%c%d", reg_prefix, reg);
8185
236
      func (stream, dis_style_text, "-");
8186
236
      func (stream, dis_style_register, "%c%d",
8187
236
            reg_prefix, topreg);
8188
236
      func (stream, dis_style_text, ", ");
8189
236
          }
8190
2.48k
        func (stream, dis_style_register, "VPR");
8191
2.48k
        func (stream, dis_style_text, "}");
8192
2.48k
      }
8193
2.48k
      break;
8194
8195
4.17k
    case 'u':
8196
4.17k
      if (cond != COND_UNCOND)
8197
930
        is_unpredictable = true;
8198
8199
      /* Fall through.  */
8200
480k
    case 'c':
8201
480k
      if (cond != COND_UNCOND && cp_num == 9)
8202
2.00k
        is_unpredictable = true;
8203
8204
      /* Fall through.  */
8205
480k
    case 'b':
8206
480k
      func (stream, dis_style_mnemonic, "%s",
8207
480k
      arm_conditional[cond]);
8208
480k
      break;
8209
8210
3.96k
    case 'J':
8211
3.96k
      {
8212
3.96k
        unsigned long regno
8213
3.96k
          = arm_decode_field_multiple (given, 13, 15, 22, 22);
8214
8215
3.96k
        switch (regno)
8216
3.96k
          {
8217
285
          case 0x1:
8218
285
      func (stream, dis_style_register, "FPSCR");
8219
285
      break;
8220
291
          case 0x2:
8221
291
      func (stream, dis_style_register, "FPSCR_nzcvqc");
8222
291
      break;
8223
485
          case 0xc:
8224
485
      func (stream, dis_style_register, "VPR");
8225
485
      break;
8226
370
          case 0xd:
8227
370
      func (stream, dis_style_register, "P0");
8228
370
      break;
8229
680
          case 0xe:
8230
680
      func (stream, dis_style_register, "FPCXTNS");
8231
680
      break;
8232
302
          case 0xf:
8233
302
      func (stream, dis_style_register, "FPCXTS");
8234
302
      break;
8235
1.55k
          default:
8236
1.55k
      func (stream, dis_style_text, "<invalid reg %lu>",
8237
1.55k
            regno);
8238
1.55k
      break;
8239
3.96k
          }
8240
3.96k
      }
8241
3.96k
      break;
8242
8243
1.32M
    case '0': case '1': case '2': case '3': case '4':
8244
1.95M
    case '5': case '6': case '7': case '8': case '9':
8245
1.95M
      {
8246
1.95M
        int width;
8247
8248
1.95M
        c = arm_decode_bitfield (c, given, &value, &width);
8249
8250
1.95M
        switch (*c)
8251
1.95M
          {
8252
41.4k
          case 'R':
8253
41.4k
      if (value == 15)
8254
5.90k
        is_unpredictable = true;
8255
      /* Fall through.  */
8256
93.2k
          case 'r':
8257
93.2k
      if (c[1] == 'u')
8258
5.98k
        {
8259
          /* Eat the 'u' character.  */
8260
5.98k
          ++ c;
8261
8262
5.98k
          if (u_reg == value)
8263
411
            is_unpredictable = true;
8264
5.98k
          u_reg = value;
8265
5.98k
        }
8266
93.2k
      func (stream, dis_style_register, "%s",
8267
93.2k
            arm_regnames[value]);
8268
93.2k
      break;
8269
6.72k
          case 'V':
8270
6.72k
      if (given & (1 << 6))
8271
3.10k
        goto Q;
8272
      /* FALLTHROUGH */
8273
9.43k
          case 'D':
8274
9.43k
      func (stream, dis_style_register, "d%ld", value);
8275
9.43k
      break;
8276
1.73k
          case 'Q':
8277
4.83k
          Q:
8278
4.83k
      if (value & 1)
8279
997
        func (stream, dis_style_text,
8280
997
        "<illegal reg q%ld.5>", value >> 1);
8281
3.83k
      else
8282
3.83k
        func (stream, dis_style_register,
8283
3.83k
        "q%ld", value >> 1);
8284
4.83k
      break;
8285
1.56M
          case 'd':
8286
1.56M
      func (stream, base_style, "%ld", value);
8287
1.56M
      value_in_comment = value;
8288
1.56M
      break;
8289
1.04k
          case 'E':
8290
1.04k
                        {
8291
        /* Converts immediate 8 bit back to float value.  */
8292
1.04k
        unsigned floatVal = (value & 0x80) << 24
8293
1.04k
          | (value & 0x3F) << 19
8294
1.04k
          | ((value & 0x40) ? (0xF8 << 22) : (1 << 30));
8295
8296
        /* Quarter float have a maximum value of 31.0.
8297
           Get floating point value multiplied by 1e7.
8298
           The maximum value stays in limit of a 32-bit int.  */
8299
1.04k
        unsigned decVal =
8300
1.04k
          (78125 << (((floatVal >> 23) & 0xFF) - 124)) *
8301
1.04k
          (16 + (value & 0xF));
8302
8303
1.04k
        if (!(decVal % 1000000))
8304
339
          {
8305
339
            func (stream, dis_style_immediate, "%ld", value);
8306
339
            func (stream, dis_style_comment_start,
8307
339
            "\t@ 0x%08x %c%u.%01u",
8308
339
            floatVal, value & 0x80 ? '-' : ' ',
8309
339
            decVal / 10000000,
8310
339
            decVal % 10000000 / 1000000);
8311
339
          }
8312
707
        else if (!(decVal % 10000))
8313
357
          {
8314
357
            func (stream, dis_style_immediate, "%ld", value);
8315
357
            func (stream, dis_style_comment_start,
8316
357
            "\t@ 0x%08x %c%u.%03u",
8317
357
            floatVal, value & 0x80 ? '-' : ' ',
8318
357
            decVal / 10000000,
8319
357
            decVal % 10000000 / 10000);
8320
357
          }
8321
350
        else
8322
350
          {
8323
350
            func (stream, dis_style_immediate, "%ld", value);
8324
350
            func (stream, dis_style_comment_start,
8325
350
            "\t@ 0x%08x %c%u.%07u",
8326
350
            floatVal, value & 0x80 ? '-' : ' ',
8327
350
            decVal / 10000000, decVal % 10000000);
8328
350
          }
8329
1.04k
        break;
8330
1.73k
      }
8331
1.29k
          case 'k':
8332
1.29k
      {
8333
1.29k
        int from = (given & (1 << 7)) ? 32 : 16;
8334
1.29k
        func (stream, dis_style_immediate, "%ld",
8335
1.29k
        from - value);
8336
1.29k
      }
8337
1.29k
      break;
8338
8339
1.13k
          case 'w':
8340
1.13k
      if (width == 2)
8341
855
        func (stream, dis_style_mnemonic, "%s",
8342
855
        iwmmxt_wwnames[value]);
8343
278
      else
8344
278
        func (stream, dis_style_mnemonic, "%s",
8345
278
        iwmmxt_wwssnames[value]);
8346
1.13k
      break;
8347
8348
14.0k
          case 'g':
8349
14.0k
      func (stream, dis_style_register, "%s",
8350
14.0k
            iwmmxt_regnames[value]);
8351
14.0k
      break;
8352
454
          case 'G':
8353
454
      func (stream, dis_style_register, "%s",
8354
454
            iwmmxt_cregnames[value]);
8355
454
      break;
8356
8357
201
          case 'x':
8358
201
      func (stream, dis_style_immediate, "0x%lx",
8359
201
            (value & 0xffffffffUL));
8360
201
      break;
8361
8362
3.14k
          case 'c':
8363
3.14k
      switch (value)
8364
3.14k
        {
8365
1.01k
        case 0:
8366
1.01k
          func (stream, dis_style_mnemonic, "eq");
8367
1.01k
          break;
8368
8369
328
        case 1:
8370
328
          func (stream, dis_style_mnemonic, "vs");
8371
328
          break;
8372
8373
775
        case 2:
8374
775
          func (stream, dis_style_mnemonic, "ge");
8375
775
          break;
8376
8377
1.02k
        case 3:
8378
1.02k
          func (stream, dis_style_mnemonic, "gt");
8379
1.02k
          break;
8380
8381
0
        default:
8382
0
          func (stream, dis_style_text, "??");
8383
0
          break;
8384
3.14k
        }
8385
3.14k
      break;
8386
8387
3.14k
          case '`':
8388
644
      c++;
8389
644
      if (value == 0)
8390
293
        func (stream, dis_style_mnemonic, "%c", *c);
8391
644
      break;
8392
244k
          case '\'':
8393
244k
      c++;
8394
244k
      if (value == ((1ul << width) - 1))
8395
111k
        func (stream, base_style, "%c", *c);
8396
244k
      break;
8397
14.0k
          case '?':
8398
14.0k
      func (stream, base_style, "%c",
8399
14.0k
            c[(1 << width) - (int) value]);
8400
14.0k
      c += 1 << width;
8401
14.0k
      break;
8402
0
          default:
8403
0
      abort ();
8404
1.95M
          }
8405
1.95M
      }
8406
1.95M
      break;
8407
8408
1.95M
    case 'y':
8409
48.1k
    case 'z':
8410
48.1k
      {
8411
48.1k
        int single = *c++ == 'y';
8412
48.1k
        int regno;
8413
8414
48.1k
        switch (*c)
8415
48.1k
          {
8416
416
          case '4': /* Sm pair */
8417
12.3k
          case '0': /* Sm, Dm */
8418
12.3k
      regno = given & 0x0000000f;
8419
12.3k
      if (single)
8420
7.62k
        {
8421
7.62k
          regno <<= 1;
8422
7.62k
          regno += (given >> 5) & 1;
8423
7.62k
        }
8424
4.73k
      else
8425
4.73k
        regno += ((given >> 5) & 1) << 4;
8426
12.3k
      break;
8427
8428
18.7k
          case '1': /* Sd, Dd */
8429
18.7k
      regno = (given >> 12) & 0x0000000f;
8430
18.7k
      if (single)
8431
13.0k
        {
8432
13.0k
          regno <<= 1;
8433
13.0k
          regno += (given >> 22) & 1;
8434
13.0k
        }
8435
5.64k
      else
8436
5.64k
        regno += ((given >> 22) & 1) << 4;
8437
18.7k
      break;
8438
8439
10.1k
          case '2': /* Sn, Dn */
8440
10.1k
      regno = (given >> 16) & 0x0000000f;
8441
10.1k
      if (single)
8442
6.21k
        {
8443
6.21k
          regno <<= 1;
8444
6.21k
          regno += (given >> 7) & 1;
8445
6.21k
        }
8446
3.95k
      else
8447
3.95k
        regno += ((given >> 7) & 1) << 4;
8448
10.1k
      break;
8449
8450
6.90k
          case '3': /* List */
8451
6.90k
      func (stream, dis_style_text, "{");
8452
6.90k
      regno = (given >> 12) & 0x0000000f;
8453
6.90k
      if (single)
8454
4.93k
        {
8455
4.93k
          regno <<= 1;
8456
4.93k
          regno += (given >> 22) & 1;
8457
4.93k
        }
8458
1.97k
      else
8459
1.97k
        regno += ((given >> 22) & 1) << 4;
8460
6.90k
      break;
8461
8462
0
          default:
8463
0
      abort ();
8464
48.1k
          }
8465
8466
48.1k
        func (stream, dis_style_register, "%c%d",
8467
48.1k
        single ? 's' : 'd', regno);
8468
8469
48.1k
        if (*c == '3')
8470
6.90k
          {
8471
6.90k
      int count = given & 0xff;
8472
8473
6.90k
      if (single == 0)
8474
1.97k
        count >>= 1;
8475
8476
6.90k
      if (--count)
8477
6.49k
        {
8478
6.49k
          func (stream, dis_style_text, "-");
8479
6.49k
          func (stream, dis_style_register, "%c%d",
8480
6.49k
          single ? 's' : 'd',
8481
6.49k
          regno + count);
8482
6.49k
        }
8483
8484
6.90k
      func (stream, dis_style_text, "}");
8485
6.90k
          }
8486
41.2k
        else if (*c == '4')
8487
416
          {
8488
416
      func (stream, dis_style_text, ", ");
8489
416
      func (stream, dis_style_register, "%c%d",
8490
416
            single ? 's' : 'd', regno + 1);
8491
416
          }
8492
48.1k
      }
8493
0
      break;
8494
8495
6.25k
    case 'L':
8496
6.25k
      switch (given & 0x00400100)
8497
6.25k
        {
8498
825
        case 0x00000000:
8499
825
          func (stream, dis_style_mnemonic, "b");
8500
825
          break;
8501
893
        case 0x00400000:
8502
893
          func (stream, dis_style_mnemonic, "h");
8503
893
          break;
8504
2.56k
        case 0x00000100:
8505
2.56k
          func (stream, dis_style_mnemonic, "w");
8506
2.56k
          break;
8507
1.97k
        case 0x00400100:
8508
1.97k
          func (stream, dis_style_mnemonic, "d");
8509
1.97k
          break;
8510
0
        default:
8511
0
          break;
8512
6.25k
        }
8513
6.25k
      break;
8514
8515
6.25k
    case 'Z':
8516
562
      {
8517
        /* given (20, 23) | given (0, 3) */
8518
562
        value = ((given >> 16) & 0xf0) | (given & 0xf);
8519
562
        func (stream, dis_style_immediate, "%d", (int) value);
8520
562
      }
8521
562
      break;
8522
8523
6.25k
    case 'l':
8524
      /* This is like the 'A' operator, except that if
8525
         the width field "M" is zero, then the offset is
8526
         *not* multiplied by four.  */
8527
6.25k
      {
8528
6.25k
        int offset = given & 0xff;
8529
6.25k
        int multiplier = (given & 0x00000100) ? 4 : 1;
8530
8531
6.25k
        func (stream, dis_style_text, "[");
8532
6.25k
        func (stream, dis_style_register, "%s",
8533
6.25k
        arm_regnames [(given >> 16) & 0xf]);
8534
8535
6.25k
        if (multiplier > 1)
8536
4.53k
          {
8537
4.53k
      value_in_comment = offset * multiplier;
8538
4.53k
      if (NEGATIVE_BIT_SET)
8539
1.54k
        value_in_comment = - value_in_comment;
8540
4.53k
          }
8541
8542
6.25k
        if (offset)
8543
5.07k
          {
8544
5.07k
      if (PRE_BIT_SET)
8545
890
        {
8546
890
          func (stream, dis_style_text, ", ");
8547
890
          func (stream, dis_style_immediate, "#%s%d",
8548
890
          NEGATIVE_BIT_SET ? "-" : "",
8549
890
          offset * multiplier);
8550
890
          func (stream, dis_style_text, "]%s",
8551
890
          WRITEBACK_BIT_SET ? "!" : "");
8552
890
        }
8553
4.18k
      else
8554
4.18k
        {
8555
4.18k
          func (stream, dis_style_text, "], ");
8556
4.18k
          func (stream, dis_style_immediate, "#%s%d",
8557
4.18k
          NEGATIVE_BIT_SET ? "-" : "",
8558
4.18k
          offset * multiplier);
8559
4.18k
        }
8560
5.07k
          }
8561
1.17k
        else
8562
1.17k
          func (stream, dis_style_text, "]");
8563
6.25k
      }
8564
6.25k
      break;
8565
8566
3.06k
    case 'r':
8567
3.06k
      {
8568
3.06k
        int imm4 = (given >> 4) & 0xf;
8569
3.06k
        int puw_bits = ((given >> 22) & 6) | ((given >> W_BIT) & 1);
8570
3.06k
        int ubit = ! NEGATIVE_BIT_SET;
8571
3.06k
        const char *rm = arm_regnames [given & 0xf];
8572
3.06k
        const char *rn = arm_regnames [(given >> 16) & 0xf];
8573
8574
3.06k
        switch (puw_bits)
8575
3.06k
          {
8576
292
          case 1:
8577
997
          case 3:
8578
997
      func (stream, dis_style_text, "[");
8579
997
      func (stream, dis_style_register, "%s", rn);
8580
997
      func (stream, dis_style_text, "], ");
8581
997
      func (stream, dis_style_text, "%c", ubit ? '+' : '-');
8582
997
      func (stream, dis_style_register, "%s", rm);
8583
997
      if (imm4)
8584
423
        {
8585
423
          func (stream, dis_style_text, ", ");
8586
423
          func (stream, dis_style_sub_mnemonic, "lsl ");
8587
423
          func (stream, dis_style_immediate, "#%d", imm4);
8588
423
        }
8589
997
      break;
8590
8591
385
          case 4:
8592
874
          case 5:
8593
1.16k
          case 6:
8594
1.78k
          case 7:
8595
1.78k
      func (stream, dis_style_text, "[");
8596
1.78k
      func (stream, dis_style_register, "%s", rn);
8597
1.78k
      func (stream, dis_style_text, ", ");
8598
1.78k
      func (stream, dis_style_text, "%c", ubit ? '+' : '-');
8599
1.78k
      func (stream, dis_style_register, "%s", rm);
8600
1.78k
      if (imm4 > 0)
8601
1.43k
        {
8602
1.43k
          func (stream, dis_style_text, ", ");
8603
1.43k
          func (stream, dis_style_sub_mnemonic, "lsl ");
8604
1.43k
          func (stream, dis_style_immediate, "#%d", imm4);
8605
1.43k
        }
8606
1.78k
      func (stream, dis_style_text, "]");
8607
1.78k
      if (puw_bits == 5 || puw_bits == 7)
8608
1.10k
        func (stream, dis_style_text, "!");
8609
1.78k
      break;
8610
8611
285
          default:
8612
285
      func (stream, dis_style_text, "INVALID");
8613
3.06k
          }
8614
3.06k
      }
8615
3.06k
      break;
8616
8617
3.06k
    case 'i':
8618
810
      {
8619
810
        long imm5;
8620
810
        imm5 = ((given & 0x100) >> 4) | (given & 0xf);
8621
810
        func (stream, dis_style_immediate, "%ld",
8622
810
        (imm5 == 0) ? 32 : imm5);
8623
810
      }
8624
810
      break;
8625
8626
0
    default:
8627
0
      abort ();
8628
5.91M
    }
8629
5.91M
      }
8630
7.21M
    else
8631
7.21M
      {
8632
7.21M
        if (*c == '@')
8633
1.97k
    base_style = dis_style_comment_start;
8634
8635
7.21M
        if (*c == '\t')
8636
490k
    base_style = dis_style_text;
8637
8638
7.21M
        func (stream, base_style, "%c", *c);
8639
7.21M
      }
8640
13.1M
  }
8641
8642
488k
      if (value_in_comment > 32 || value_in_comment < -16)
8643
175k
  func (stream, dis_style_comment_start, "\t@ 0x%lx",
8644
175k
        (value_in_comment & 0xffffffffUL));
8645
8646
488k
      if (is_unpredictable)
8647
17.0k
  func (stream, dis_style_comment_start, UNPREDICTABLE_INSTRUCTION);
8648
8649
488k
      return true;
8650
488k
    }
8651
8.70M
  return false;
8652
9.19M
}
8653
8654
static bool
8655
print_insn_coprocessor (bfd_vma pc,
8656
      struct disassemble_info *info,
8657
      long given,
8658
      bool thumb)
8659
4.75M
{
8660
4.75M
  return print_insn_coprocessor_1 (coprocessor_opcodes,
8661
4.75M
           pc, info, given, thumb);
8662
4.75M
}
8663
8664
static bool
8665
print_insn_generic_coprocessor (bfd_vma pc,
8666
        struct disassemble_info *info,
8667
        long given,
8668
        bool thumb)
8669
4.43M
{
8670
4.43M
  return print_insn_coprocessor_1 (generic_coprocessor_opcodes,
8671
4.43M
           pc, info, given, thumb);
8672
4.43M
}
8673
8674
/* Decodes and prints ARM addressing modes.  Returns the offset
8675
   used in the address, if any, if it is worthwhile printing the
8676
   offset as a hexadecimal value in a comment at the end of the
8677
   line of disassembly.  */
8678
8679
static signed long
8680
print_arm_address (bfd_vma pc, struct disassemble_info *info, long given)
8681
397k
{
8682
397k
  void *stream = info->stream;
8683
397k
  fprintf_styled_ftype func = info->fprintf_styled_func;
8684
397k
  bfd_vma offset = 0;
8685
8686
397k
  if (((given & 0x000f0000) == 0x000f0000)
8687
21.2k
      && ((given & 0x02000000) == 0))
8688
14.0k
    {
8689
14.0k
      offset = given & 0xfff;
8690
8691
14.0k
      func (stream, dis_style_text, "[");
8692
14.0k
      func (stream, dis_style_register, "pc");
8693
8694
14.0k
      if (PRE_BIT_SET)
8695
5.76k
  {
8696
    /* Pre-indexed.  Elide offset of positive zero when
8697
       non-writeback.  */
8698
5.76k
    if (WRITEBACK_BIT_SET || NEGATIVE_BIT_SET || offset)
8699
5.53k
      {
8700
5.53k
        func (stream, dis_style_text, ", ");
8701
5.53k
        func (stream, dis_style_immediate, "#%s%d",
8702
5.53k
        NEGATIVE_BIT_SET ? "-" : "", (int) offset);
8703
5.53k
      }
8704
8705
5.76k
    if (NEGATIVE_BIT_SET)
8706
3.65k
      offset = -offset;
8707
8708
5.76k
    offset += pc + 8;
8709
8710
    /* Cope with the possibility of write-back
8711
       being used.  Probably a very dangerous thing
8712
       for the programmer to do, but who are we to
8713
       argue ?  */
8714
5.76k
    func (stream, dis_style_text, "]%s", WRITEBACK_BIT_SET ? "!" : "");
8715
5.76k
  }
8716
8.24k
      else  /* Post indexed.  */
8717
8.24k
  {
8718
8.24k
    func (stream, dis_style_text, "], ");
8719
8.24k
    func (stream, dis_style_immediate, "#%s%d",
8720
8.24k
    NEGATIVE_BIT_SET ? "-" : "", (int) offset);
8721
8722
    /* Ie ignore the offset.  */
8723
8.24k
    offset = pc + 8;
8724
8.24k
  }
8725
8726
14.0k
      func (stream, dis_style_comment_start, "\t@ ");
8727
14.0k
      info->print_address_func (offset, info);
8728
14.0k
      offset = 0;
8729
14.0k
    }
8730
383k
  else
8731
383k
    {
8732
383k
      func (stream, dis_style_text, "[");
8733
383k
      func (stream, dis_style_register, "%s",
8734
383k
      arm_regnames[(given >> 16) & 0xf]);
8735
8736
383k
      if (PRE_BIT_SET)
8737
161k
  {
8738
161k
    if ((given & 0x02000000) == 0)
8739
108k
      {
8740
        /* Elide offset of positive zero when non-writeback.  */
8741
108k
        offset = given & 0xfff;
8742
108k
        if (WRITEBACK_BIT_SET || NEGATIVE_BIT_SET || offset)
8743
107k
    {
8744
107k
      func (stream, dis_style_text, ", ");
8745
107k
      func (stream, dis_style_immediate, "#%s%d",
8746
107k
      NEGATIVE_BIT_SET ? "-" : "", (int) offset);
8747
107k
    }
8748
108k
      }
8749
53.1k
    else
8750
53.1k
      {
8751
53.1k
        func (stream, dis_style_text, ", %s",
8752
53.1k
        NEGATIVE_BIT_SET ? "-" : "");
8753
53.1k
        arm_decode_shift (given, func, stream, true);
8754
53.1k
      }
8755
8756
161k
    func (stream, dis_style_text, "]%s",
8757
161k
    WRITEBACK_BIT_SET ? "!" : "");
8758
161k
  }
8759
221k
      else
8760
221k
  {
8761
221k
    if ((given & 0x02000000) == 0)
8762
162k
      {
8763
        /* Always show offset.  */
8764
162k
        offset = given & 0xfff;
8765
162k
        func (stream, dis_style_text, "], ");
8766
162k
        func (stream, dis_style_immediate, "#%s%d",
8767
162k
        NEGATIVE_BIT_SET ? "-" : "", (int) offset);
8768
162k
      }
8769
59.4k
    else
8770
59.4k
      {
8771
59.4k
        func (stream, dis_style_text, "], %s",
8772
59.4k
        NEGATIVE_BIT_SET ? "-" : "");
8773
59.4k
        arm_decode_shift (given, func, stream, true);
8774
59.4k
      }
8775
221k
  }
8776
383k
      if (NEGATIVE_BIT_SET)
8777
252k
  offset = -offset;
8778
383k
    }
8779
8780
397k
  return (signed long) offset;
8781
397k
}
8782
8783
8784
/* Print one cde instruction on INFO->STREAM.
8785
   Return TRUE if the instuction matched, FALSE if this is not a
8786
   recognised cde instruction.  */
8787
static bool
8788
print_insn_cde (struct disassemble_info *info, long given, bool thumb)
8789
622k
{
8790
622k
  const struct cdeopcode32 *insn;
8791
622k
  void *stream = info->stream;
8792
622k
  fprintf_styled_ftype func = info->fprintf_styled_func;
8793
622k
  enum disassembler_style base_style = dis_style_mnemonic;
8794
622k
  enum disassembler_style old_base_style = base_style;
8795
8796
622k
  if (thumb)
8797
622k
  {
8798
    /* Manually extract the coprocessor code from a known point.
8799
       This position is the same across all CDE instructions.  */
8800
8.04M
    for (insn = cde_opcodes; insn->assembler; insn++)
8801
7.43M
    {
8802
7.43M
      uint16_t coproc = (given >> insn->coproc_shift) & insn->coproc_mask;
8803
7.43M
      uint16_t coproc_mask = 1 << coproc;
8804
7.43M
      if (! (coproc_mask & cde_coprocs))
8805
6.53M
  continue;
8806
8807
895k
      if ((given & insn->mask) == insn->value)
8808
9.32k
      {
8809
9.32k
  bool is_unpredictable = false;
8810
9.32k
  const char *c;
8811
8812
218k
  for (c = insn->assembler; *c; c++)
8813
208k
  {
8814
208k
    if (*c == '%')
8815
76.3k
    {
8816
76.3k
      switch (*++c)
8817
76.3k
      {
8818
9.32k
        case '{':
8819
9.32k
    ++c;
8820
9.32k
    if (*c == '\0')
8821
0
      abort ();
8822
9.32k
    old_base_style = base_style;
8823
9.32k
    base_style = decode_base_style (*c);
8824
9.32k
    ++c;
8825
9.32k
    if (*c != ':')
8826
0
      abort ();
8827
9.32k
    break;
8828
8829
9.32k
        case '}':
8830
9.32k
    base_style = old_base_style;
8831
9.32k
    break;
8832
8833
0
        case '%':
8834
0
    func (stream, base_style, "%%");
8835
0
    break;
8836
8837
39.0k
        case '0': case '1': case '2': case '3': case '4':
8838
39.0k
        case '5': case '6': case '7': case '8': case '9':
8839
39.0k
        {
8840
39.0k
    int width;
8841
39.0k
    unsigned long value;
8842
8843
39.0k
    c = arm_decode_bitfield (c, given, &value, &width);
8844
8845
39.0k
    switch (*c)
8846
39.0k
    {
8847
4.15k
      case 'S':
8848
4.15k
        if (value > 10)
8849
2.03k
          is_unpredictable = true;
8850
        /* Fall through.  */
8851
4.15k
      case 'R':
8852
4.15k
        if (value == 13)
8853
208
          is_unpredictable = true;
8854
        /* Fall through.  */
8855
4.15k
      case 'r':
8856
4.15k
        func (stream, dis_style_register, "%s",
8857
4.15k
        arm_regnames[value]);
8858
4.15k
        break;
8859
8860
10.4k
      case 'n':
8861
10.4k
        if (value == 15)
8862
1.04k
          func (stream, dis_style_register, "%s", "APSR_nzcv");
8863
9.41k
        else
8864
9.41k
          func (stream, dis_style_register, "%s",
8865
9.41k
          arm_regnames[value]);
8866
10.4k
        break;
8867
8868
4.15k
      case 'T':
8869
4.15k
        func (stream, dis_style_register, "%s",
8870
4.15k
        arm_regnames[(value + 1) & 15]);
8871
4.15k
        break;
8872
8873
9.32k
      case 'd':
8874
9.32k
        func (stream, dis_style_immediate, "%ld", value);
8875
9.32k
        break;
8876
8877
10.9k
      case 'V':
8878
10.9k
        if (given & (1 << 6))
8879
7.09k
          func (stream, dis_style_register, "q%ld", value >> 1);
8880
3.83k
        else if (given & (1 << 24))
8881
1.33k
          func (stream, dis_style_register, "d%ld", value);
8882
2.49k
        else
8883
2.49k
          {
8884
      /* Encoding for S register is different than for D and
8885
         Q registers.  S registers are encoded using the top
8886
         single bit in position 22 as the lowest bit of the
8887
         register number, while for Q and D it represents the
8888
         highest bit of the register number.  */
8889
2.49k
      uint8_t top_bit = (value >> 4) & 1;
8890
2.49k
      uint8_t tmp = (value << 1) & 0x1e;
8891
2.49k
      uint8_t res = tmp | top_bit;
8892
2.49k
      func (stream, dis_style_register, "s%u", res);
8893
2.49k
          }
8894
10.9k
        break;
8895
8896
0
    default:
8897
0
      abort ();
8898
39.0k
    }
8899
39.0k
        }
8900
39.0k
      break;
8901
8902
39.0k
      case 'p':
8903
9.32k
        {
8904
9.32k
    uint8_t proc_number = (given >> 8) & 0x7;
8905
9.32k
    func (stream, dis_style_register, "p%u", proc_number);
8906
9.32k
    break;
8907
39.0k
        }
8908
8909
9.32k
      case 'a':
8910
9.32k
        {
8911
9.32k
    uint8_t a_offset = 28;
8912
9.32k
    if (given & (1 << a_offset))
8913
5.32k
      func (stream, dis_style_mnemonic, "a");
8914
9.32k
    break;
8915
39.0k
        }
8916
0
    default:
8917
0
      abort ();
8918
76.3k
    }
8919
76.3k
  }
8920
132k
  else
8921
132k
    {
8922
132k
      if (*c == '@')
8923
0
        base_style = dis_style_comment_start;
8924
132k
      if (*c == '\t')
8925
9.32k
        base_style = dis_style_text;
8926
8927
132k
      func (stream, base_style, "%c", *c);
8928
132k
    }
8929
208k
      }
8930
8931
9.32k
      if (is_unpredictable)
8932
2.03k
  func (stream, dis_style_comment_start, UNPREDICTABLE_INSTRUCTION);
8933
8934
9.32k
      return true;
8935
9.32k
      }
8936
895k
    }
8937
613k
    return false;
8938
622k
  }
8939
0
  else
8940
0
    return false;
8941
622k
}
8942
8943
8944
/* Print one neon instruction on INFO->STREAM.
8945
   Return TRUE if the instuction matched, FALSE if this is not a
8946
   recognised neon instruction.  */
8947
8948
static bool
8949
print_insn_neon (struct disassemble_info *info, long given, bool thumb)
8950
4.07M
{
8951
4.07M
  const struct opcode32 *insn;
8952
4.07M
  void *stream = info->stream;
8953
4.07M
  fprintf_styled_ftype func = info->fprintf_styled_func;
8954
4.07M
  enum disassembler_style base_style = dis_style_mnemonic;
8955
4.07M
  enum disassembler_style old_base_style = base_style;
8956
8957
4.07M
  if (thumb)
8958
227k
    {
8959
227k
      if ((given & 0xef000000) == 0xef000000)
8960
71.5k
  {
8961
    /* Move bit 28 to bit 24 to translate Thumb2 to ARM encoding.  */
8962
71.5k
    unsigned long bit28 = given & (1 << 28);
8963
8964
71.5k
    given &= 0x00ffffff;
8965
71.5k
    if (bit28)
8966
67.2k
            given |= 0xf3000000;
8967
4.25k
          else
8968
4.25k
      given |= 0xf2000000;
8969
71.5k
  }
8970
155k
      else if ((given & 0xff000000) == 0xf9000000)
8971
19.7k
  given ^= 0xf9000000 ^ 0xf4000000;
8972
      /* BFloat16 neon instructions without special top byte handling.  */
8973
135k
      else if ((given & 0xff000000) == 0xfe000000
8974
121k
         || (given & 0xff000000) == 0xfc000000)
8975
23.2k
  ;
8976
      /* vdup is also a valid neon instruction.  */
8977
112k
      else if ((given & 0xff900f5f) != 0xee800b10)
8978
112k
  return false;
8979
227k
    }
8980
8981
1.19G
  for (insn = neon_opcodes; insn->assembler; insn++)
8982
1.19G
    {
8983
1.19G
      unsigned long cond_mask = insn->mask;
8984
1.19G
      unsigned long cond_value = insn->value;
8985
1.19G
      int cond;
8986
8987
1.19G
      if (thumb)
8988
28.7M
        {
8989
28.7M
          if ((cond_mask & 0xf0000000) == 0) {
8990
              /* For the entries in neon_opcodes, an opcode mask/value with
8991
                 the high 4 bits equal to 0 indicates a conditional
8992
                 instruction. For thumb however, we need to include those
8993
                 bits in the instruction matching.  */
8994
689k
              cond_mask |= 0xf0000000;
8995
              /* Furthermore, the thumb encoding of a conditional instruction
8996
                 will have the high 4 bits equal to 0xe.  */
8997
689k
              cond_value |= 0xe0000000;
8998
689k
          }
8999
28.7M
          if (ifthen_state)
9000
236k
            cond = IFTHEN_COND;
9001
28.5M
          else
9002
28.5M
            cond = COND_UNCOND;
9003
28.7M
        }
9004
1.16G
      else
9005
1.16G
        {
9006
1.16G
          if ((given & 0xf0000000) == 0xf0000000)
9007
88.8M
            {
9008
              /* If the instruction is unconditional, update the mask to only
9009
                 match against unconditional opcode values.  */
9010
88.8M
              cond_mask |= 0xf0000000;
9011
88.8M
              cond = COND_UNCOND;
9012
88.8M
            }
9013
1.07G
          else
9014
1.07G
            {
9015
1.07G
              cond = (given >> 28) & 0xf;
9016
1.07G
              if (cond == 0xe)
9017
40.3M
                cond = COND_UNCOND;
9018
1.07G
            }
9019
1.16G
        }
9020
9021
1.19G
      if ((given & cond_mask) == cond_value)
9022
76.3k
  {
9023
76.3k
    signed long value_in_comment = 0;
9024
76.3k
    bool is_unpredictable = false;
9025
76.3k
    const char *c;
9026
9027
1.23M
    for (c = insn->assembler; *c; c++)
9028
1.16M
      {
9029
1.16M
        if (*c == '%')
9030
392k
    {
9031
392k
      switch (*++c)
9032
392k
        {
9033
13.5k
        case '{':
9034
13.5k
          ++c;
9035
13.5k
          if (*c == '\0')
9036
0
      abort ();
9037
13.5k
          old_base_style = base_style;
9038
13.5k
          base_style = decode_base_style (*c);
9039
13.5k
          ++c;
9040
13.5k
          if (*c != ':')
9041
0
      abort ();
9042
13.5k
          break;
9043
9044
13.5k
        case '}':
9045
13.5k
          base_style = old_base_style;
9046
13.5k
          break;
9047
9048
0
        case '%':
9049
0
          func (stream, base_style, "%%");
9050
0
          break;
9051
9052
6.81k
        case 'u':
9053
6.81k
          if (thumb && ifthen_state)
9054
315
      is_unpredictable = true;
9055
9056
          /* Fall through.  */
9057
75.4k
        case 'c':
9058
75.4k
          func (stream, dis_style_mnemonic, "%s",
9059
75.4k
          arm_conditional[cond]);
9060
75.4k
          break;
9061
9062
11.3k
        case 'A':
9063
11.3k
          {
9064
11.3k
      static const unsigned char enc[16] =
9065
11.3k
      {
9066
11.3k
        0x4, 0x14, /* st4 0,1 */
9067
11.3k
        0x4, /* st1 2 */
9068
11.3k
        0x4, /* st2 3 */
9069
11.3k
        0x3, /* st3 4 */
9070
11.3k
        0x13, /* st3 5 */
9071
11.3k
        0x3, /* st1 6 */
9072
11.3k
        0x1, /* st1 7 */
9073
11.3k
        0x2, /* st2 8 */
9074
11.3k
        0x12, /* st2 9 */
9075
11.3k
        0x2, /* st1 10 */
9076
11.3k
        0, 0, 0, 0, 0
9077
11.3k
      };
9078
11.3k
      int rd = ((given >> 12) & 0xf) | (((given >> 22) & 1) << 4);
9079
11.3k
      int rn = ((given >> 16) & 0xf);
9080
11.3k
      int rm = ((given >> 0) & 0xf);
9081
11.3k
      int align = ((given >> 4) & 0x3);
9082
11.3k
      int type = ((given >> 8) & 0xf);
9083
11.3k
      int n = enc[type] & 0xf;
9084
11.3k
      int stride = (enc[type] >> 4) + 1;
9085
11.3k
      int ix;
9086
9087
11.3k
      func (stream, dis_style_text, "{");
9088
11.3k
      if (stride > 1)
9089
9.93k
        for (ix = 0; ix != n; ix++)
9090
7.24k
          {
9091
7.24k
            if (ix > 0)
9092
4.56k
        func (stream, dis_style_text, ",");
9093
7.24k
            func (stream, dis_style_register, "d%d",
9094
7.24k
            rd + ix * stride);
9095
7.24k
          }
9096
8.63k
      else if (n == 1)
9097
683
        func (stream, dis_style_register, "d%d", rd);
9098
7.95k
      else
9099
7.95k
        {
9100
7.95k
          func (stream, dis_style_register, "d%d", rd);
9101
7.95k
          func (stream, dis_style_text, "-");
9102
7.95k
          func (stream, dis_style_register, "d%d",
9103
7.95k
          rd + n - 1);
9104
7.95k
        }
9105
11.3k
      func (stream, dis_style_text, "}, [");
9106
11.3k
      func (stream, dis_style_register, "%s",
9107
11.3k
            arm_regnames[rn]);
9108
11.3k
      if (align)
9109
5.43k
        {
9110
5.43k
          func (stream, dis_style_text, " :");
9111
5.43k
          func (stream, dis_style_immediate, "%d",
9112
5.43k
          32 << align);
9113
5.43k
        }
9114
11.3k
      func (stream, dis_style_text, "]");
9115
11.3k
      if (rm == 0xd)
9116
1.66k
        func (stream, dis_style_text, "!");
9117
9.65k
      else if (rm != 0xf)
9118
9.20k
        {
9119
9.20k
          func (stream, dis_style_text, ", ");
9120
9.20k
          func (stream, dis_style_register, "%s",
9121
9.20k
          arm_regnames[rm]);
9122
9.20k
        }
9123
11.3k
          }
9124
11.3k
          break;
9125
9126
8.43k
        case 'B':
9127
8.43k
          {
9128
8.43k
      int rd = ((given >> 12) & 0xf) | (((given >> 22) & 1) << 4);
9129
8.43k
      int rn = ((given >> 16) & 0xf);
9130
8.43k
      int rm = ((given >> 0) & 0xf);
9131
8.43k
      int idx_align = ((given >> 4) & 0xf);
9132
8.43k
                        int align = 0;
9133
8.43k
      int size = ((given >> 10) & 0x3);
9134
8.43k
      int idx = idx_align >> (size + 1);
9135
8.43k
                        int length = ((given >> 8) & 3) + 1;
9136
8.43k
                        int stride = 1;
9137
8.43k
                        int i;
9138
9139
8.43k
                        if (length > 1 && size > 0)
9140
4.30k
                          stride = (idx_align & (1 << size)) ? 2 : 1;
9141
9142
8.43k
                        switch (length)
9143
8.43k
                          {
9144
3.23k
                          case 1:
9145
3.23k
                            {
9146
3.23k
                              int amask = (1 << size) - 1;
9147
3.23k
                              if ((idx_align & (1 << size)) != 0)
9148
1.32k
                                return false;
9149
1.90k
                              if (size > 0)
9150
1.16k
                                {
9151
1.16k
                                  if ((idx_align & amask) == amask)
9152
237
                                    align = 8 << size;
9153
927
                                  else if ((idx_align & amask) != 0)
9154
470
                                    return false;
9155
1.16k
                                }
9156
1.90k
                              }
9157
1.43k
                            break;
9158
9159
1.49k
                          case 2:
9160
1.49k
                            if (size == 2 && (idx_align & 2) != 0)
9161
449
                              return false;
9162
1.04k
                            align = (idx_align & 1) ? 16 << size : 0;
9163
1.04k
                            break;
9164
9165
1.71k
                          case 3:
9166
1.71k
                            if ((size == 2 && (idx_align & 3) != 0)
9167
1.39k
                                || (idx_align & 1) != 0)
9168
1.23k
                              return false;
9169
485
                            break;
9170
9171
1.98k
                          case 4:
9172
1.98k
                            if (size == 2)
9173
932
                              {
9174
932
                                if ((idx_align & 3) == 3)
9175
309
                                  return false;
9176
623
                                align = (idx_align & 3) * 64;
9177
623
                              }
9178
1.05k
                            else
9179
1.05k
                              align = (idx_align & 1) ? 32 << size : 0;
9180
1.68k
                            break;
9181
9182
1.68k
                          default:
9183
0
                            abort ();
9184
8.43k
                          }
9185
9186
4.64k
      func (stream, dis_style_text, "{");
9187
16.3k
                        for (i = 0; i < length; i++)
9188
11.7k
        {
9189
11.7k
          if (i > 0)
9190
7.05k
            func (stream, dis_style_text, ",");
9191
11.7k
          func (stream, dis_style_register, "d%d[%d]",
9192
11.7k
          rd + i * stride, idx);
9193
11.7k
        }
9194
4.64k
      func (stream, dis_style_text, "}, [");
9195
4.64k
      func (stream, dis_style_register, "%s",
9196
4.64k
            arm_regnames[rn]);
9197
4.64k
      if (align)
9198
1.74k
        {
9199
1.74k
          func (stream, dis_style_text, " :");
9200
1.74k
          func (stream, dis_style_immediate, "%d", align);
9201
1.74k
        }
9202
4.64k
      func (stream, dis_style_text, "]");
9203
4.64k
      if (rm == 0xd)
9204
390
        func (stream, dis_style_text, "!");
9205
4.25k
      else if (rm != 0xf)
9206
3.36k
        {
9207
3.36k
          func (stream, dis_style_text, ", ");
9208
3.36k
          func (stream, dis_style_register, "%s",
9209
3.36k
          arm_regnames[rm]);
9210
3.36k
        }
9211
4.64k
          }
9212
0
          break;
9213
9214
3.20k
        case 'C':
9215
3.20k
          {
9216
3.20k
      int rd = ((given >> 12) & 0xf) | (((given >> 22) & 1) << 4);
9217
3.20k
      int rn = ((given >> 16) & 0xf);
9218
3.20k
      int rm = ((given >> 0) & 0xf);
9219
3.20k
      int align = ((given >> 4) & 0x1);
9220
3.20k
      int size = ((given >> 6) & 0x3);
9221
3.20k
      int type = ((given >> 8) & 0x3);
9222
3.20k
      int n = type + 1;
9223
3.20k
      int stride = ((given >> 5) & 0x1);
9224
3.20k
      int ix;
9225
9226
3.20k
      if (stride && (n == 1))
9227
749
        n++;
9228
2.45k
      else
9229
2.45k
        stride++;
9230
9231
3.20k
      func (stream, dis_style_text, "{");
9232
3.20k
      if (stride > 1)
9233
5.64k
        for (ix = 0; ix != n; ix++)
9234
4.42k
          {
9235
4.42k
            if (ix > 0)
9236
3.20k
        func (stream, dis_style_text, ",");
9237
4.42k
            func (stream, dis_style_register, "d%d[]",
9238
4.42k
            rd + ix * stride);
9239
4.42k
          }
9240
1.98k
      else if (n == 1)
9241
286
        func (stream, dis_style_register, "d%d[]", rd);
9242
1.69k
      else
9243
1.69k
        {
9244
1.69k
          func (stream, dis_style_register, "d%d[]", rd);
9245
1.69k
          func (stream, dis_style_text, "-");
9246
1.69k
          func (stream, dis_style_register, "d%d[]",
9247
1.69k
          rd + n - 1);
9248
1.69k
        }
9249
3.20k
      func (stream, dis_style_text, "}, [");
9250
3.20k
      func (stream, dis_style_register, "%s",
9251
3.20k
            arm_regnames[rn]);
9252
3.20k
      if (align)
9253
2.22k
        {
9254
2.22k
                            align = (8 * (type + 1)) << size;
9255
2.22k
                            if (type == 3)
9256
744
                              align = (size > 1) ? align >> 1 : align;
9257
2.22k
          if (type == 2 || (type == 0 && !size))
9258
956
            func (stream, dis_style_text,
9259
956
            " :<bad align %d>", align);
9260
1.26k
          else
9261
1.26k
            {
9262
1.26k
        func (stream, dis_style_text, " :");
9263
1.26k
        func (stream, dis_style_immediate,
9264
1.26k
              "%d", align);
9265
1.26k
            }
9266
2.22k
        }
9267
3.20k
      func (stream, dis_style_text, "]");
9268
3.20k
      if (rm == 0xd)
9269
715
        func (stream, dis_style_text, "!");
9270
2.48k
      else if (rm != 0xf)
9271
1.86k
        {
9272
1.86k
          func (stream, dis_style_text, ", ");
9273
1.86k
          func (stream, dis_style_register, "%s",
9274
1.86k
          arm_regnames[rm]);
9275
1.86k
        }
9276
3.20k
          }
9277
3.20k
          break;
9278
9279
3.28k
        case 'D':
9280
3.28k
          {
9281
3.28k
      int raw_reg = (given & 0xf) | ((given >> 1) & 0x10);
9282
3.28k
      int size = (given >> 20) & 3;
9283
3.28k
      int reg = raw_reg & ((4 << size) - 1);
9284
3.28k
      int ix = raw_reg >> size >> 2;
9285
9286
3.28k
      func (stream, dis_style_register, "d%d[%d]", reg, ix);
9287
3.28k
          }
9288
3.28k
          break;
9289
9290
3.31k
        case 'E':
9291
          /* Neon encoded constant for mov, mvn, vorr, vbic.  */
9292
3.31k
          {
9293
3.31k
      int bits = 0;
9294
3.31k
      int cmode = (given >> 8) & 0xf;
9295
3.31k
      int op = (given >> 5) & 0x1;
9296
3.31k
      unsigned long value = 0, hival = 0;
9297
3.31k
      unsigned shift;
9298
3.31k
                        int size = 0;
9299
3.31k
                        int isfloat = 0;
9300
9301
3.31k
      bits |= ((given >> 24) & 1) << 7;
9302
3.31k
      bits |= ((given >> 16) & 7) << 4;
9303
3.31k
      bits |= ((given >> 0) & 15) << 0;
9304
9305
3.31k
      if (cmode < 8)
9306
1.14k
        {
9307
1.14k
          shift = (cmode >> 1) & 3;
9308
1.14k
          value = (unsigned long) bits << (8 * shift);
9309
1.14k
                            size = 32;
9310
1.14k
        }
9311
2.17k
      else if (cmode < 12)
9312
331
        {
9313
331
          shift = (cmode >> 1) & 1;
9314
331
          value = (unsigned long) bits << (8 * shift);
9315
331
                            size = 16;
9316
331
        }
9317
1.84k
      else if (cmode < 14)
9318
451
        {
9319
451
          shift = (cmode & 1) + 1;
9320
451
          value = (unsigned long) bits << (8 * shift);
9321
451
          value |= (1ul << (8 * shift)) - 1;
9322
451
                            size = 32;
9323
451
        }
9324
1.38k
      else if (cmode == 14)
9325
956
        {
9326
956
          if (op)
9327
669
            {
9328
        /* Bit replication into bytes.  */
9329
669
        int ix;
9330
669
        unsigned long mask;
9331
9332
669
        value = 0;
9333
669
                                hival = 0;
9334
6.02k
        for (ix = 7; ix >= 0; ix--)
9335
5.35k
          {
9336
5.35k
            mask = ((bits >> ix) & 1) ? 0xff : 0;
9337
5.35k
                                    if (ix <= 3)
9338
2.67k
              value = (value << 8) | mask;
9339
2.67k
                                    else
9340
2.67k
                                      hival = (hival << 8) | mask;
9341
5.35k
          }
9342
669
                                size = 64;
9343
669
            }
9344
287
                            else
9345
287
                              {
9346
                                /* Byte replication.  */
9347
287
                                value = (unsigned long) bits;
9348
287
                                size = 8;
9349
287
                              }
9350
956
        }
9351
433
      else if (!op)
9352
433
        {
9353
          /* Floating point encoding.  */
9354
433
          int tmp;
9355
9356
433
          value = (unsigned long)  (bits & 0x7f) << 19;
9357
433
          value |= (unsigned long) (bits & 0x80) << 24;
9358
433
          tmp = bits & 0x40 ? 0x3c : 0x40;
9359
433
          value |= (unsigned long) tmp << 24;
9360
433
                            size = 32;
9361
433
                            isfloat = 1;
9362
433
        }
9363
0
      else
9364
0
        {
9365
0
          func (stream, dis_style_text,
9366
0
          "<illegal constant %.8x:%x:%x>",
9367
0
                                  bits, cmode, op);
9368
0
                            size = 32;
9369
0
          break;
9370
0
        }
9371
3.31k
                        switch (size)
9372
3.31k
                          {
9373
287
                          case 8:
9374
287
          func (stream, dis_style_immediate, "#%ld", value);
9375
287
          func (stream, dis_style_comment_start,
9376
287
          "\t@ 0x%.2lx", value);
9377
287
                            break;
9378
9379
331
                          case 16:
9380
331
          func (stream, dis_style_immediate, "#%ld", value);
9381
331
          func (stream, dis_style_comment_start,
9382
331
          "\t@ 0x%.4lx", value);
9383
331
                            break;
9384
9385
2.03k
                          case 32:
9386
2.03k
                            if (isfloat)
9387
433
                              {
9388
433
                                unsigned char valbytes[4];
9389
433
                                double fvalue;
9390
9391
                                /* Do this a byte at a time so we don't have to
9392
                                   worry about the host's endianness.  */
9393
433
                                valbytes[0] = value & 0xff;
9394
433
                                valbytes[1] = (value >> 8) & 0xff;
9395
433
                                valbytes[2] = (value >> 16) & 0xff;
9396
433
                                valbytes[3] = (value >> 24) & 0xff;
9397
9398
433
                                floatformat_to_double
9399
433
                                  (& floatformat_ieee_single_little, valbytes,
9400
433
                                  & fvalue);
9401
9402
433
        func (stream, dis_style_immediate,
9403
433
              "#%.7g", fvalue);
9404
433
        func (stream, dis_style_comment_start,
9405
433
              "\t@ 0x%.8lx", value);
9406
433
                              }
9407
1.59k
                            else
9408
1.59k
            {
9409
1.59k
        func (stream, dis_style_immediate, "#%ld",
9410
1.59k
              (long) (((value & 0x80000000L) != 0)
9411
1.59k
                ? value | ~0xffffffffL : value));
9412
1.59k
        func (stream, dis_style_comment_start,
9413
1.59k
              "\t@ 0x%.8lx", value);
9414
1.59k
            }
9415
2.03k
                            break;
9416
9417
669
                          case 64:
9418
669
          func (stream, dis_style_immediate,
9419
669
          "#0x%.8lx%.8lx", hival, value);
9420
669
                            break;
9421
9422
0
                          default:
9423
0
                            abort ();
9424
3.31k
                          }
9425
3.31k
          }
9426
3.31k
          break;
9427
9428
3.31k
        case 'F':
9429
2.33k
          {
9430
2.33k
      int regno = ((given >> 16) & 0xf) | ((given >> (7 - 4)) & 0x10);
9431
2.33k
      int num = (given >> 8) & 0x3;
9432
9433
2.33k
      func (stream, dis_style_text, "{");
9434
2.33k
      if (!num)
9435
444
        func (stream, dis_style_register, "d%d", regno);
9436
1.89k
      else if (num + regno >= 32)
9437
965
        {
9438
965
          func (stream, dis_style_register, "d%d", regno);
9439
965
          func (stream, dis_style_text, "-<overflow reg d%d",
9440
965
          regno + num);
9441
965
        }
9442
929
      else
9443
929
        {
9444
929
          func (stream, dis_style_register, "d%d", regno);
9445
929
          func (stream, dis_style_text, "-");
9446
929
          func (stream, dis_style_register, "d%d",
9447
929
          regno + num);
9448
929
        }
9449
2.33k
      func (stream, dis_style_text, "}");
9450
2.33k
          }
9451
2.33k
          break;
9452
9453
9454
240k
        case '0': case '1': case '2': case '3': case '4':
9455
257k
        case '5': case '6': case '7': case '8': case '9':
9456
257k
          {
9457
257k
      int width;
9458
257k
      unsigned long value;
9459
9460
257k
      c = arm_decode_bitfield (c, given, &value, &width);
9461
9462
257k
      switch (*c)
9463
257k
        {
9464
754
        case 'r':
9465
754
          func (stream, dis_style_register, "%s",
9466
754
          arm_regnames[value]);
9467
754
          break;
9468
6.09k
        case 'd':
9469
6.09k
          func (stream, base_style, "%ld", value);
9470
6.09k
          value_in_comment = value;
9471
6.09k
          break;
9472
7.80k
        case 'e':
9473
7.80k
          func (stream, dis_style_immediate, "%ld",
9474
7.80k
          (1ul << width) - value);
9475
7.80k
          break;
9476
9477
43.2k
        case 'S':
9478
44.6k
        case 'T':
9479
44.6k
        case 'U':
9480
          /* Various width encodings.  */
9481
44.6k
          {
9482
44.6k
            int base = 8 << (*c - 'S'); /* 8,16 or 32 */
9483
44.6k
            int limit;
9484
44.6k
            unsigned low, high;
9485
9486
44.6k
            c++;
9487
44.6k
            if (*c >= '0' && *c <= '9')
9488
43.5k
        limit = *c - '0';
9489
1.01k
            else if (*c >= 'a' && *c <= 'f')
9490
1.01k
        limit = *c - 'a' + 10;
9491
0
            else
9492
0
        abort ();
9493
44.6k
            low = limit >> 2;
9494
44.6k
            high = limit & 3;
9495
9496
44.6k
            if (value < low || value > high)
9497
12.2k
        func (stream, dis_style_text,
9498
12.2k
              "<illegal width %d>", base << value);
9499
32.3k
            else
9500
32.3k
        func (stream, base_style, "%d",
9501
32.3k
              base << value);
9502
44.6k
          }
9503
0
          break;
9504
96.7k
        case 'R':
9505
96.7k
          if (given & (1 << 6))
9506
64.3k
            goto Q;
9507
          /* FALLTHROUGH */
9508
50.2k
        case 'D':
9509
50.2k
          func (stream, dis_style_register, "d%ld", value);
9510
50.2k
          break;
9511
17.9k
        case 'Q':
9512
82.3k
        Q:
9513
82.3k
          if (value & 1)
9514
40.6k
            func (stream, dis_style_text,
9515
40.6k
            "<illegal reg q%ld.5>", value >> 1);
9516
41.6k
          else
9517
41.6k
            func (stream, dis_style_register,
9518
41.6k
            "q%ld", value >> 1);
9519
82.3k
          break;
9520
9521
0
        case '`':
9522
0
          c++;
9523
0
          if (value == 0)
9524
0
            func (stream, dis_style_text, "%c", *c);
9525
0
          break;
9526
0
        case '\'':
9527
0
          c++;
9528
0
          if (value == ((1ul << width) - 1))
9529
0
            func (stream, dis_style_text, "%c", *c);
9530
0
          break;
9531
65.9k
        case '?':
9532
65.9k
          func (stream, dis_style_mnemonic, "%c",
9533
65.9k
          c[(1 << width) - (int) value]);
9534
65.9k
          c += 1 << width;
9535
65.9k
          break;
9536
0
        default:
9537
0
          abort ();
9538
257k
        }
9539
257k
          }
9540
257k
          break;
9541
9542
257k
        default:
9543
0
          abort ();
9544
392k
        }
9545
392k
    }
9546
771k
        else
9547
771k
    {
9548
771k
      if (*c == '@')
9549
0
        base_style = dis_style_comment_start;
9550
9551
771k
      if (*c == '\t')
9552
76.3k
        base_style = dis_style_text;
9553
9554
771k
      func (stream, base_style, "%c", *c);
9555
9556
771k
    }
9557
1.16M
      }
9558
9559
72.5k
    if (value_in_comment > 32 || value_in_comment < -16)
9560
2.35k
      func (stream, dis_style_comment_start, "\t@ 0x%lx",
9561
2.35k
      value_in_comment);
9562
9563
72.5k
    if (is_unpredictable)
9564
315
      func (stream, dis_style_comment_start, UNPREDICTABLE_INSTRUCTION);
9565
9566
72.5k
    return true;
9567
76.3k
  }
9568
1.19G
    }
9569
3.88M
  return false;
9570
3.96M
}
9571
9572
/* Print one mve instruction on INFO->STREAM.
9573
   Return TRUE if the instuction matched, FALSE if this is not a
9574
   recognised mve instruction.  */
9575
9576
static bool
9577
print_insn_mve (struct disassemble_info *info, long given)
9578
621k
{
9579
621k
  const struct mopcode32 *insn;
9580
621k
  void *stream = info->stream;
9581
621k
  fprintf_styled_ftype func = info->fprintf_styled_func;
9582
621k
  enum disassembler_style base_style = dis_style_mnemonic;
9583
621k
  enum disassembler_style old_base_style = base_style;
9584
9585
123M
  for (insn = mve_opcodes; insn->assembler; insn++)
9586
123M
    {
9587
123M
      if (((given & insn->mask) == insn->value)
9588
219k
    && !is_mve_encoding_conflict (given, insn->mve_op))
9589
174k
  {
9590
174k
    signed long value_in_comment = 0;
9591
174k
    bool is_unpredictable = false;
9592
174k
    bool is_undefined = false;
9593
174k
    const char *c;
9594
174k
    enum mve_unpredictable unpredictable_cond = UNPRED_NONE;
9595
174k
    enum mve_undefined undefined_cond = UNDEF_NONE;
9596
9597
    /* Most vector mve instruction are illegal in a it block.
9598
       There are a few exceptions; check for them.  */
9599
174k
    if (ifthen_state && !is_mve_okay_in_it (insn->mve_op))
9600
1.84k
      {
9601
1.84k
        is_unpredictable = true;
9602
1.84k
        unpredictable_cond = UNPRED_IT_BLOCK;
9603
1.84k
      }
9604
173k
    else if (is_mve_unpredictable (given, insn->mve_op,
9605
173k
           &unpredictable_cond))
9606
29.3k
      is_unpredictable = true;
9607
9608
174k
    if (is_mve_undefined (given, insn->mve_op, &undefined_cond))
9609
18.8k
      is_undefined = true;
9610
9611
    /* In "VORR Qd, Qm, Qn", if Qm==Qn, VORR is nothing but VMOV,
9612
       i.e "VMOV Qd, Qm".  */
9613
174k
    if ((insn->mve_op == MVE_VORR_REG)
9614
983
        && (arm_decode_field (given, 1, 3)
9615
983
      == arm_decode_field (given, 17, 19)))
9616
735
      continue;
9617
9618
3.12M
    for (c = insn->assembler; *c; c++)
9619
2.95M
      {
9620
2.95M
        if (*c == '%')
9621
948k
    {
9622
948k
      switch (*++c)
9623
948k
        {
9624
38.6k
        case '{':
9625
38.6k
          ++c;
9626
38.6k
          if (*c == '\0')
9627
0
      abort ();
9628
38.6k
          old_base_style = base_style;
9629
38.6k
          base_style = decode_base_style (*c);
9630
38.6k
          ++c;
9631
38.6k
          if (*c != ':')
9632
0
      abort ();
9633
38.6k
          break;
9634
9635
38.6k
        case '}':
9636
38.6k
          base_style = old_base_style;
9637
38.6k
          break;
9638
9639
0
        case '%':
9640
0
          func (stream, base_style, "%%");
9641
0
          break;
9642
9643
3.50k
        case 'a':
9644
          /* Don't print anything for '+' as it is implied.  */
9645
3.50k
          if (arm_decode_field (given, 23, 23) == 0)
9646
2.76k
      func (stream, dis_style_immediate, "-");
9647
3.50k
          break;
9648
9649
16.6k
        case 'c':
9650
16.6k
          if (ifthen_state)
9651
9.53k
      func (stream, dis_style_mnemonic, "%s",
9652
9.53k
            arm_conditional[IFTHEN_COND]);
9653
16.6k
          break;
9654
9655
9.28k
        case 'd':
9656
9.28k
          print_mve_vld_str_addr (info, given, insn->mve_op);
9657
9.28k
          break;
9658
9659
11.2k
        case 'i':
9660
11.2k
          {
9661
11.2k
      long mve_mask = mve_extract_pred_mask (given);
9662
11.2k
      func (stream, dis_style_mnemonic, "%s",
9663
11.2k
            mve_predicatenames[mve_mask]);
9664
11.2k
          }
9665
11.2k
          break;
9666
9667
8.44k
        case 'j':
9668
8.44k
          {
9669
8.44k
      unsigned int imm5 = 0;
9670
8.44k
      imm5 |= arm_decode_field (given, 6, 7);
9671
8.44k
      imm5 |= (arm_decode_field (given, 12, 14) << 2);
9672
8.44k
      func (stream, dis_style_immediate, "#%u",
9673
8.44k
            (imm5 == 0) ? 32 : imm5);
9674
8.44k
          }
9675
8.44k
          break;
9676
9677
1.44k
        case 'k':
9678
1.44k
          func (stream, dis_style_immediate, "#%u",
9679
1.44k
          (arm_decode_field (given, 7, 7) == 0) ? 64 : 48);
9680
1.44k
          break;
9681
9682
14.1k
        case 'n':
9683
14.1k
          print_vec_condition (info, given, insn->mve_op);
9684
14.1k
          break;
9685
9686
5.91k
        case 'o':
9687
5.91k
          if (arm_decode_field (given, 0, 0) == 1)
9688
3.64k
      {
9689
3.64k
        unsigned long size
9690
3.64k
          = arm_decode_field (given, 4, 4)
9691
3.64k
            | (arm_decode_field (given, 6, 6) << 1);
9692
9693
3.64k
        func (stream, dis_style_text, ", ");
9694
3.64k
        func (stream, dis_style_sub_mnemonic, "uxtw ");
9695
3.64k
        func (stream, dis_style_immediate, "#%lu", size);
9696
3.64k
      }
9697
5.91k
          break;
9698
9699
7.06k
        case 'm':
9700
7.06k
          print_mve_rounding_mode (info, given, insn->mve_op);
9701
7.06k
          break;
9702
9703
14.5k
        case 's':
9704
14.5k
          print_mve_vcvt_size (info, given, insn->mve_op);
9705
14.5k
          break;
9706
9707
36.5k
        case 'u':
9708
36.5k
          {
9709
36.5k
      unsigned long op1 = arm_decode_field (given, 21, 22);
9710
9711
36.5k
      if ((insn->mve_op == MVE_VMOV_VEC_LANE_TO_GP))
9712
1.17k
        {
9713
          /* Check for signed.  */
9714
1.17k
          if (arm_decode_field (given, 23, 23) == 0)
9715
603
            {
9716
        /* We don't print 's' for S32.  */
9717
603
        if ((arm_decode_field (given, 5, 6) == 0)
9718
0
            && ((op1 == 0) || (op1 == 1)))
9719
0
          ;
9720
603
        else
9721
603
          func (stream, dis_style_mnemonic, "s");
9722
603
            }
9723
571
          else
9724
571
            func (stream, dis_style_mnemonic, "u");
9725
1.17k
        }
9726
35.3k
      else
9727
35.3k
        {
9728
35.3k
          if (arm_decode_field (given, 28, 28) == 0)
9729
17.4k
            func (stream, dis_style_mnemonic, "s");
9730
17.8k
          else
9731
17.8k
            func (stream, dis_style_mnemonic, "u");
9732
35.3k
        }
9733
36.5k
          }
9734
36.5k
          break;
9735
9736
139k
        case 'v':
9737
139k
          print_instruction_predicate (info);
9738
139k
          break;
9739
9740
4.51k
        case 'w':
9741
4.51k
          if (arm_decode_field (given, 21, 21) == 1)
9742
2.14k
      func (stream, dis_style_text, "!");
9743
4.51k
          break;
9744
9745
3.23k
        case 'B':
9746
3.23k
          print_mve_register_blocks (info, given, insn->mve_op);
9747
3.23k
          break;
9748
9749
11.1k
        case 'E':
9750
          /* SIMD encoded constant for mov, mvn, vorr, vbic.  */
9751
9752
11.1k
          print_simd_imm8 (info, given, 28, insn);
9753
11.1k
          break;
9754
9755
1.99k
        case 'N':
9756
1.99k
          print_mve_vmov_index (info, given);
9757
1.99k
          break;
9758
9759
13.4k
        case 'T':
9760
13.4k
          if (arm_decode_field (given, 12, 12) == 0)
9761
7.95k
      func (stream, dis_style_mnemonic, "b");
9762
5.47k
          else
9763
5.47k
      func (stream, dis_style_mnemonic, "t");
9764
13.4k
          break;
9765
9766
4.93k
        case 'X':
9767
4.93k
          if (arm_decode_field (given, 12, 12) == 1)
9768
1.70k
      func (stream, dis_style_mnemonic, "x");
9769
4.93k
          break;
9770
9771
513k
        case '0': case '1': case '2': case '3': case '4':
9772
563k
        case '5': case '6': case '7': case '8': case '9':
9773
563k
          {
9774
563k
      int width;
9775
563k
      unsigned long value;
9776
9777
563k
      c = arm_decode_bitfield (c, given, &value, &width);
9778
9779
563k
      switch (*c)
9780
563k
        {
9781
12.0k
        case 'Z':
9782
12.0k
          if (value == 13)
9783
1.90k
            is_unpredictable = true;
9784
10.1k
          else if (value == 15)
9785
1.83k
            func (stream, dis_style_register, "zr");
9786
8.33k
          else
9787
8.33k
            func (stream, dis_style_register, "%s",
9788
8.33k
            arm_regnames[value]);
9789
12.0k
          break;
9790
9791
1.95k
        case 'c':
9792
1.95k
          func (stream, dis_style_sub_mnemonic, "%s",
9793
1.95k
          arm_conditional[value]);
9794
1.95k
          break;
9795
9796
1.48k
        case 'C':
9797
1.48k
          value ^= 1;
9798
1.48k
          func (stream, dis_style_sub_mnemonic, "%s",
9799
1.48k
          arm_conditional[value]);
9800
1.48k
          break;
9801
9802
11.9k
        case 'S':
9803
11.9k
          if (value == 13 || value == 15)
9804
2.87k
            is_unpredictable = true;
9805
9.08k
          else
9806
9.08k
            func (stream, dis_style_register, "%s",
9807
9.08k
            arm_regnames[value]);
9808
11.9k
          break;
9809
9810
121k
        case 's':
9811
121k
          print_mve_size (info,
9812
121k
              value,
9813
121k
              insn->mve_op);
9814
121k
          break;
9815
940
        case 'I':
9816
940
          if (value == 1)
9817
459
            func (stream, dis_style_mnemonic, "i");
9818
940
          break;
9819
6.45k
        case 'A':
9820
6.45k
          if (value == 1)
9821
2.00k
            func (stream, dis_style_mnemonic, "a");
9822
6.45k
          break;
9823
14.3k
        case 'h':
9824
14.3k
          {
9825
14.3k
            unsigned int odd_reg = (value << 1) | 1;
9826
14.3k
            func (stream, dis_style_register, "%s",
9827
14.3k
            arm_regnames[odd_reg]);
9828
14.3k
          }
9829
14.3k
          break;
9830
3.50k
        case 'i':
9831
3.50k
          {
9832
3.50k
            unsigned long imm
9833
3.50k
        = arm_decode_field (given, 0, 6);
9834
3.50k
            unsigned long mod_imm = imm;
9835
9836
3.50k
            switch (insn->mve_op)
9837
3.50k
        {
9838
721
        case MVE_VLDRW_GATHER_T5:
9839
1.49k
        case MVE_VSTRW_SCATTER_T5:
9840
1.49k
          mod_imm = mod_imm << 2;
9841
1.49k
          break;
9842
1.37k
        case MVE_VSTRD_SCATTER_T6:
9843
2.00k
        case MVE_VLDRD_GATHER_T6:
9844
2.00k
          mod_imm = mod_imm << 3;
9845
2.00k
          break;
9846
9847
0
        default:
9848
0
          break;
9849
3.50k
        }
9850
9851
3.50k
            func (stream, dis_style_immediate, "%lu",
9852
3.50k
            mod_imm);
9853
3.50k
          }
9854
0
          break;
9855
5.37k
        case 'k':
9856
5.37k
          func (stream, dis_style_immediate, "%lu",
9857
5.37k
          64 - value);
9858
5.37k
          break;
9859
17.7k
        case 'l':
9860
17.7k
          {
9861
17.7k
            unsigned int even_reg = value << 1;
9862
17.7k
            func (stream, dis_style_register, "%s",
9863
17.7k
            arm_regnames[even_reg]);
9864
17.7k
          }
9865
17.7k
          break;
9866
3.84k
        case 'u':
9867
3.84k
          switch (value)
9868
3.84k
            {
9869
636
            case 0:
9870
636
        func (stream, dis_style_immediate, "1");
9871
636
        break;
9872
402
            case 1:
9873
402
        func (stream, dis_style_immediate, "2");
9874
402
        break;
9875
2.10k
            case 2:
9876
2.10k
        func (stream, dis_style_immediate, "4");
9877
2.10k
        break;
9878
698
            case 3:
9879
698
        func (stream, dis_style_immediate, "8");
9880
698
        break;
9881
0
            default:
9882
0
        break;
9883
3.84k
            }
9884
3.84k
          break;
9885
7.33k
        case 'o':
9886
7.33k
          print_mve_rotate (info, value, width);
9887
7.33k
          break;
9888
42.2k
        case 'r':
9889
42.2k
          func (stream, dis_style_register, "%s",
9890
42.2k
          arm_regnames[value]);
9891
42.2k
          break;
9892
14.8k
        case 'd':
9893
14.8k
          if (mve_shift_insn_p (insn->mve_op))
9894
10.4k
            print_mve_shift_n (info, given, insn->mve_op);
9895
4.44k
          else if (insn->mve_op == MVE_VSHLL_T2)
9896
368
            func (stream, dis_style_immediate, "%s",
9897
368
            mve_vec_sizename[value]);
9898
4.07k
          else
9899
4.07k
            {
9900
4.07k
        if (insn->mve_op == MVE_VSHLC && value == 0)
9901
459
          value = 32;
9902
4.07k
        func (stream, base_style, "%ld", value);
9903
4.07k
        value_in_comment = value;
9904
4.07k
            }
9905
14.8k
          break;
9906
0
        case 'F':
9907
0
          func (stream, dis_style_register, "s%ld", value);
9908
0
          break;
9909
297k
        case 'Q':
9910
297k
          if (value & 0x8)
9911
133k
            func (stream, dis_style_text,
9912
133k
            "<illegal reg q%ld.5>", value);
9913
163k
          else
9914
163k
            func (stream, dis_style_register, "q%ld", value);
9915
297k
          break;
9916
521
        case 'x':
9917
521
          func (stream, dis_style_immediate,
9918
521
          "0x%08lx", value);
9919
521
          break;
9920
0
        default:
9921
0
          abort ();
9922
563k
        }
9923
563k
      break;
9924
563k
          default:
9925
0
      abort ();
9926
563k
          }
9927
948k
        }
9928
948k
    }
9929
2.00M
        else
9930
2.00M
    {
9931
2.00M
      if (*c == '@')
9932
521
        base_style = dis_style_comment_start;
9933
9934
2.00M
      if (*c == '\t')
9935
173k
        base_style = dis_style_text;
9936
9937
2.00M
      func (stream, base_style, "%c", *c);
9938
2.00M
    }
9939
2.95M
      }
9940
9941
174k
    if (value_in_comment > 32 || value_in_comment < -16)
9942
0
      func (stream, dis_style_comment_start, "\t@ 0x%lx",
9943
0
      value_in_comment);
9944
9945
174k
    if (is_unpredictable)
9946
34.6k
      print_mve_unpredictable (info, unpredictable_cond);
9947
9948
174k
    if (is_undefined)
9949
18.8k
      print_mve_undefined (info, undefined_cond);
9950
9951
174k
    if (!vpt_block_state.in_vpt_block
9952
160k
        && !ifthen_state
9953
149k
        && is_vpt_instruction (given))
9954
5.08k
      mark_inside_vpt_block (given);
9955
169k
    else if (vpt_block_state.in_vpt_block)
9956
13.3k
      update_vpt_block_state ();
9957
9958
174k
    return true;
9959
174k
  }
9960
123M
    }
9961
446k
  return false;
9962
621k
}
9963
9964
9965
/* Return the name of a v7A special register.  */
9966
9967
static const char *
9968
banked_regname (unsigned reg)
9969
75.4k
{
9970
75.4k
  switch (reg)
9971
75.4k
    {
9972
328
      case 15: return "CPSR";
9973
615
      case 32: return "R8_usr";
9974
492
      case 33: return "R9_usr";
9975
350
      case 34: return "R10_usr";
9976
472
      case 35: return "R11_usr";
9977
239
      case 36: return "R12_usr";
9978
515
      case 37: return "SP_usr";
9979
730
      case 38: return "LR_usr";
9980
393
      case 40: return "R8_fiq";
9981
287
      case 41: return "R9_fiq";
9982
310
      case 42: return "R10_fiq";
9983
395
      case 43: return "R11_fiq";
9984
217
      case 44: return "R12_fiq";
9985
307
      case 45: return "SP_fiq";
9986
640
      case 46: return "LR_fiq";
9987
2.24k
      case 48: return "LR_irq";
9988
1.96k
      case 49: return "SP_irq";
9989
333
      case 50: return "LR_svc";
9990
263
      case 51: return "SP_svc";
9991
301
      case 52: return "LR_abt";
9992
685
      case 53: return "SP_abt";
9993
388
      case 54: return "LR_und";
9994
320
      case 55: return "SP_und";
9995
565
      case 60: return "LR_mon";
9996
314
      case 61: return "SP_mon";
9997
475
      case 62: return "ELR_hyp";
9998
497
      case 63: return "SP_hyp";
9999
281
      case 79: return "SPSR";
10000
558
      case 110: return "SPSR_fiq";
10001
383
      case 112: return "SPSR_irq";
10002
378
      case 114: return "SPSR_svc";
10003
278
      case 116: return "SPSR_abt";
10004
245
      case 118: return "SPSR_und";
10005
923
      case 124: return "SPSR_mon";
10006
330
      case 126: return "SPSR_hyp";
10007
57.4k
      default: return NULL;
10008
75.4k
    }
10009
75.4k
}
10010
10011
/* Return the name of the DMB/DSB option.  */
10012
static const char *
10013
data_barrier_option (unsigned option)
10014
1.24k
{
10015
1.24k
  switch (option & 0xf)
10016
1.24k
    {
10017
37
    case 0xf: return "sy";
10018
10
    case 0xe: return "st";
10019
2
    case 0xd: return "ld";
10020
0
    case 0xb: return "ish";
10021
225
    case 0xa: return "ishst";
10022
14
    case 0x9: return "ishld";
10023
37
    case 0x7: return "un";
10024
64
    case 0x6: return "unst";
10025
200
    case 0x5: return "nshld";
10026
0
    case 0x3: return "osh";
10027
0
    case 0x2: return "oshst";
10028
0
    case 0x1: return "oshld";
10029
658
    default:  return NULL;
10030
1.24k
    }
10031
1.24k
}
10032
10033
/* Print one ARM instruction from PC on INFO->STREAM.  */
10034
10035
static void
10036
print_insn_arm (bfd_vma pc, struct disassemble_info *info, long given)
10037
3.87M
{
10038
3.87M
  const struct opcode32 *insn;
10039
3.87M
  void *stream = info->stream;
10040
3.87M
  fprintf_styled_ftype func = info->fprintf_styled_func;
10041
3.87M
  struct arm_private_data *private_data = info->private_data;
10042
3.87M
  enum disassembler_style base_style = dis_style_mnemonic;
10043
3.87M
  enum disassembler_style old_base_style = base_style;
10044
10045
3.87M
  if (print_insn_coprocessor (pc, info, given, false))
10046
24.4k
    return;
10047
10048
3.84M
  if (print_insn_neon (info, given, false))
10049
21.2k
    return;
10050
10051
3.82M
  if (print_insn_generic_coprocessor (pc, info, given, false))
10052
351k
    return;
10053
10054
934M
  for (insn = arm_opcodes; insn->assembler; insn++)
10055
934M
    {
10056
934M
      if ((given & insn->mask) != insn->value)
10057
931M
  continue;
10058
10059
3.78M
      if (! ARM_CPU_HAS_FEATURE (insn->arch, private_data->features))
10060
58.8k
  continue;
10061
10062
      /* Special case: an instruction with all bits set in the condition field
10063
   (0xFnnn_nnnn) is only matched if all those bits are set in insn->mask,
10064
   or by the catchall at the end of the table.  */
10065
3.72M
      if ((given & 0xF0000000) != 0xF0000000
10066
508k
    || (insn->mask & 0xF0000000) == 0xF0000000
10067
498k
    || (insn->mask == 0 && insn->value == 0))
10068
3.47M
  {
10069
3.47M
    unsigned long u_reg = 16;
10070
3.47M
    unsigned long U_reg = 16;
10071
3.47M
    bool is_unpredictable = false;
10072
3.47M
    signed long value_in_comment = 0;
10073
3.47M
    const char *c;
10074
10075
51.4M
    for (c = insn->assembler; *c; c++)
10076
47.9M
      {
10077
47.9M
        if (*c == '%')
10078
14.7M
    {
10079
14.7M
      bool allow_unpredictable = false;
10080
10081
14.7M
      switch (*++c)
10082
14.7M
        {
10083
8.62k
        case '{':
10084
8.62k
          ++c;
10085
8.62k
          if (*c == '\0')
10086
0
      abort ();
10087
8.62k
          old_base_style = base_style;
10088
8.62k
          base_style = decode_base_style (*c);
10089
8.62k
          ++c;
10090
8.62k
          if (*c != ':')
10091
0
      abort ();
10092
8.62k
          break;
10093
10094
8.62k
        case '}':
10095
8.62k
          base_style = old_base_style;
10096
8.62k
          break;
10097
10098
0
        case '%':
10099
0
          func (stream, base_style, "%%");
10100
0
          break;
10101
10102
397k
        case 'a':
10103
397k
          value_in_comment = print_arm_address (pc, info, given);
10104
397k
          break;
10105
10106
196
        case 'P':
10107
          /* Set P address bit and use normal address
10108
       printing routine.  */
10109
196
          value_in_comment = print_arm_address (pc, info, given | (1 << P_BIT));
10110
196
          break;
10111
10112
388
        case 'T':
10113
          /* Armv4 does not have a BX instruction, however, when
10114
       assembled with the --fix-v4bx option GAS will accept
10115
       and assemble a BX instruction when assembling for
10116
       Armv4.  When disassembling we also disassemble it as a
10117
       BX instruction, but do make the user aware that this
10118
       instruction is only supported on HW from Armv4T
10119
       onwards.  */
10120
388
          if (info->mach == bfd_mach_arm_4)
10121
194
      func (stream, dis_style_text, "\t@ from Armv4T onwards");
10122
388
          break;
10123
10124
19.1k
        case 'S':
10125
19.1k
          allow_unpredictable = true;
10126
          /* Fall through.  */
10127
87.7k
        case 's':
10128
87.7k
                      if ((given & 0x004f0000) == 0x004f0000)
10129
14.9k
      {
10130
                          /* PC relative with immediate offset.  */
10131
14.9k
        bfd_vma offset = ((given & 0xf00) >> 4) | (given & 0xf);
10132
10133
14.9k
        if (PRE_BIT_SET)
10134
1.40k
          {
10135
            /* Elide positive zero offset.  */
10136
1.40k
            if (offset || NEGATIVE_BIT_SET)
10137
1.19k
        {
10138
1.19k
          func (stream, dis_style_text, "[");
10139
1.19k
          func (stream, dis_style_register, "pc");
10140
1.19k
          func (stream, dis_style_text, ", ");
10141
1.19k
          func (stream, dis_style_immediate, "#%s%d",
10142
1.19k
          (NEGATIVE_BIT_SET ? "-" : ""),
10143
1.19k
          (int) offset);
10144
1.19k
          func (stream, dis_style_text, "]");
10145
1.19k
        }
10146
209
            else
10147
209
        {
10148
209
          func (stream, dis_style_text, "[");
10149
209
          func (stream, dis_style_register, "pc");
10150
209
          func (stream, dis_style_text, "]");
10151
209
        }
10152
1.40k
            if (NEGATIVE_BIT_SET)
10153
369
        offset = -offset;
10154
1.40k
            func (stream, dis_style_comment_start, "\t@ ");
10155
1.40k
            info->print_address_func (offset + pc + 8, info);
10156
1.40k
          }
10157
13.5k
        else
10158
13.5k
          {
10159
            /* Always show the offset.  */
10160
13.5k
            func (stream, dis_style_text, "[");
10161
13.5k
            func (stream, dis_style_register, "pc");
10162
13.5k
            func (stream, dis_style_text, "], ");
10163
13.5k
            func (stream, dis_style_immediate, "#%s%d",
10164
13.5k
            NEGATIVE_BIT_SET ? "-" : "", (int) offset);
10165
13.5k
            if (! allow_unpredictable)
10166
2.65k
        is_unpredictable = true;
10167
13.5k
          }
10168
14.9k
      }
10169
72.7k
          else
10170
72.7k
      {
10171
72.7k
        int offset = ((given & 0xf00) >> 4) | (given & 0xf);
10172
10173
72.7k
        func (stream, dis_style_text, "[");
10174
72.7k
        func (stream, dis_style_register, "%s",
10175
72.7k
        arm_regnames[(given >> 16) & 0xf]);
10176
10177
72.7k
        if (PRE_BIT_SET)
10178
9.94k
          {
10179
9.94k
            if (IMMEDIATE_BIT_SET)
10180
4.74k
        {
10181
          /* Elide offset for non-writeback
10182
             positive zero.  */
10183
4.74k
          if (WRITEBACK_BIT_SET || NEGATIVE_BIT_SET
10184
1.80k
              || offset)
10185
4.54k
            {
10186
4.54k
              func (stream, dis_style_text, ", ");
10187
4.54k
              func (stream, dis_style_immediate,
10188
4.54k
              "#%s%d",
10189
4.54k
              (NEGATIVE_BIT_SET ? "-" : ""),
10190
4.54k
              offset);
10191
4.54k
            }
10192
10193
4.74k
          if (NEGATIVE_BIT_SET)
10194
1.58k
            offset = -offset;
10195
10196
4.74k
          value_in_comment = offset;
10197
4.74k
        }
10198
5.19k
            else
10199
5.19k
        {
10200
          /* Register Offset or Register Pre-Indexed.  */
10201
5.19k
          func (stream, dis_style_text, ", %s",
10202
5.19k
          NEGATIVE_BIT_SET ? "-" : "");
10203
5.19k
          func (stream, dis_style_register, "%s",
10204
5.19k
          arm_regnames[given & 0xf]);
10205
10206
          /* Writing back to the register that is the source/
10207
             destination of the load/store is unpredictable.  */
10208
5.19k
          if (! allow_unpredictable
10209
5.19k
              && WRITEBACK_BIT_SET
10210
1.71k
              && ((given & 0xf) == ((given >> 12) & 0xf)))
10211
236
            is_unpredictable = true;
10212
5.19k
        }
10213
10214
9.94k
            func (stream, dis_style_text, "]%s",
10215
9.94k
            WRITEBACK_BIT_SET ? "!" : "");
10216
9.94k
          }
10217
62.8k
        else
10218
62.8k
          {
10219
62.8k
            if (IMMEDIATE_BIT_SET)
10220
11.8k
        {
10221
          /* Immediate Post-indexed.  */
10222
          /* PR 10924: Offset must be printed, even if it is zero.  */
10223
11.8k
          func (stream, dis_style_text, "], ");
10224
11.8k
          func (stream, dis_style_immediate, "#%s%d",
10225
11.8k
          NEGATIVE_BIT_SET ? "-" : "", offset);
10226
11.8k
          if (NEGATIVE_BIT_SET)
10227
3.73k
            offset = -offset;
10228
11.8k
          value_in_comment = offset;
10229
11.8k
        }
10230
51.0k
            else
10231
51.0k
        {
10232
          /* Register Post-indexed.  */
10233
51.0k
          func (stream, dis_style_text, "], %s",
10234
51.0k
          NEGATIVE_BIT_SET ? "-" : "");
10235
51.0k
          func (stream, dis_style_register, "%s",
10236
51.0k
          arm_regnames[given & 0xf]);
10237
10238
          /* Writing back to the register that is the source/
10239
             destination of the load/store is unpredictable.  */
10240
51.0k
          if (! allow_unpredictable
10241
46.5k
              && (given & 0xf) == ((given >> 12) & 0xf))
10242
9.11k
            is_unpredictable = true;
10243
51.0k
        }
10244
10245
62.8k
            if (! allow_unpredictable)
10246
54.5k
        {
10247
          /* Writeback is automatically implied by post- addressing.
10248
             Setting the W bit is unnecessary and ARM specify it as
10249
             being unpredictable.  */
10250
54.5k
          if (WRITEBACK_BIT_SET
10251
              /* Specifying the PC register as the post-indexed
10252
           registers is also unpredictable.  */
10253
47.4k
              || (! IMMEDIATE_BIT_SET && ((given & 0xf) == 0xf)))
10254
27.4k
            is_unpredictable = true;
10255
54.5k
        }
10256
62.8k
          }
10257
72.7k
      }
10258
87.7k
          break;
10259
10260
199k
        case 'b':
10261
199k
          {
10262
199k
      bfd_vma disp = (((given & 0xffffff) ^ 0x800000) - 0x800000);
10263
199k
      bfd_vma target = disp * 4 + pc + 8;
10264
199k
      info->print_address_func (target, info);
10265
10266
      /* Fill in instruction information.  */
10267
199k
      info->insn_info_valid = 1;
10268
199k
      info->insn_type = dis_branch;
10269
199k
      info->target = target;
10270
199k
          }
10271
199k
          break;
10272
10273
3.04M
        case 'c':
10274
3.04M
          if (((given >> 28) & 0xf) != 0xe)
10275
2.93M
      func (stream, dis_style_mnemonic, "%s",
10276
2.93M
            arm_conditional [(given >> 28) & 0xf]);
10277
3.04M
          break;
10278
10279
332k
        case 'm':
10280
332k
          {
10281
332k
      int started = 0;
10282
332k
      int reg;
10283
10284
332k
      func (stream, dis_style_text, "{");
10285
5.65M
      for (reg = 0; reg < 16; reg++)
10286
5.32M
        if ((given & (1 << reg)) != 0)
10287
2.02M
          {
10288
2.02M
            if (started)
10289
1.72M
        func (stream, dis_style_text, ", ");
10290
2.02M
            started = 1;
10291
2.02M
            func (stream, dis_style_register, "%s",
10292
2.02M
            arm_regnames[reg]);
10293
2.02M
          }
10294
332k
      func (stream, dis_style_text, "}");
10295
332k
      if (! started)
10296
29.3k
        is_unpredictable = true;
10297
332k
          }
10298
332k
          break;
10299
10300
1.62k
        case 'q':
10301
1.62k
          arm_decode_shift (given, func, stream, false);
10302
1.62k
          break;
10303
10304
1.80M
        case 'o':
10305
1.80M
          if ((given & 0x02000000) != 0)
10306
313k
      {
10307
313k
        unsigned int rotate = (given & 0xf00) >> 7;
10308
313k
        unsigned int immed = (given & 0xff);
10309
313k
        unsigned int a, i;
10310
10311
313k
        a = (immed << ((32 - rotate) & 31)
10312
313k
             | immed >> rotate) & 0xffffffff;
10313
        /* If there is another encoding with smaller rotate,
10314
           the rotate should be specified directly.  */
10315
1.55M
        for (i = 0; i < 32; i += 2)
10316
1.55M
          if ((a << i | a >> ((32 - i) & 31)) <= 0xff)
10317
313k
            break;
10318
10319
313k
        if (i != rotate)
10320
51.4k
          {
10321
51.4k
            func (stream, dis_style_immediate, "#%d", immed);
10322
51.4k
            func (stream, dis_style_text, ", ");
10323
51.4k
            func (stream, dis_style_immediate, "%d", rotate);
10324
51.4k
          }
10325
261k
        else
10326
261k
          func (stream, dis_style_immediate, "#%d", a);
10327
313k
        value_in_comment = a;
10328
313k
      }
10329
1.48M
          else
10330
1.48M
      arm_decode_shift (given, func, stream, true);
10331
1.80M
          break;
10332
10333
134k
        case 'p':
10334
134k
          if ((given & 0x0000f000) == 0x0000f000)
10335
4.47k
      func (stream, dis_style_mnemonic, "p");
10336
134k
          break;
10337
134k
        case 'O':
10338
134k
          if ((given & 0x0000f000) == 0x0000f000)
10339
4.47k
      func (stream, dis_style_text,
10340
4.47k
            "\t@ p-variant is OBSOLETE");
10341
134k
          break;
10342
10343
347k
        case 't':
10344
347k
          if ((given & 0x01200000) == 0x00200000)
10345
75.3k
      func (stream, dis_style_mnemonic, "t");
10346
347k
          break;
10347
10348
0
        case 'A':
10349
0
          {
10350
0
      int offset = given & 0xff;
10351
10352
0
      value_in_comment = offset * 4;
10353
0
      if (NEGATIVE_BIT_SET)
10354
0
        value_in_comment = - value_in_comment;
10355
10356
0
      func (stream, dis_style_text, "[%s",
10357
0
            arm_regnames [(given >> 16) & 0xf]);
10358
10359
0
      if (PRE_BIT_SET)
10360
0
        {
10361
0
          if (offset)
10362
0
            func (stream, dis_style_text, ", #%d]%s",
10363
0
            (int) value_in_comment,
10364
0
            WRITEBACK_BIT_SET ? "!" : "");
10365
0
          else
10366
0
            func (stream, dis_style_text, "]");
10367
0
        }
10368
0
      else
10369
0
        {
10370
0
          func (stream, dis_style_text, "]");
10371
10372
0
          if (WRITEBACK_BIT_SET)
10373
0
            {
10374
0
        if (offset)
10375
0
          func (stream, dis_style_text,
10376
0
          ", #%d", (int) value_in_comment);
10377
0
            }
10378
0
          else
10379
0
            {
10380
0
        func (stream, dis_style_text,
10381
0
              ", {%d}", (int) offset);
10382
0
        value_in_comment = offset;
10383
0
            }
10384
0
        }
10385
0
          }
10386
0
          break;
10387
10388
8.85k
        case 'B':
10389
          /* Print ARM V5 BLX(1) address: pc+25 bits.  */
10390
8.85k
          {
10391
8.85k
      bfd_vma address;
10392
8.85k
      bfd_vma offset = 0;
10393
10394
8.85k
      if (! NEGATIVE_BIT_SET)
10395
        /* Is signed, hi bits should be ones.  */
10396
2.64k
        offset = (-1) ^ 0x00ffffff;
10397
10398
      /* Offset is (SignExtend(offset field)<<2).  */
10399
8.85k
      offset += given & 0x00ffffff;
10400
8.85k
      offset <<= 2;
10401
8.85k
      address = offset + pc + 8;
10402
10403
8.85k
      if (given & 0x01000000)
10404
        /* H bit allows addressing to 2-byte boundaries.  */
10405
5.10k
        address += 2;
10406
10407
8.85k
            info->print_address_func (address, info);
10408
10409
      /* Fill in instruction information.  */
10410
8.85k
      info->insn_info_valid = 1;
10411
8.85k
      info->insn_type = dis_branch;
10412
8.85k
      info->target = address;
10413
8.85k
          }
10414
8.85k
          break;
10415
10416
4.67k
        case 'C':
10417
4.67k
          if ((given & 0x02000200) == 0x200)
10418
1.49k
      {
10419
1.49k
        const char * name;
10420
1.49k
        unsigned sysm = (given & 0x004f0000) >> 16;
10421
10422
1.49k
        sysm |= (given & 0x300) >> 4;
10423
1.49k
        name = banked_regname (sysm);
10424
10425
1.49k
        if (name != NULL)
10426
1.03k
          func (stream, dis_style_register, "%s", name);
10427
458
        else
10428
458
          func (stream, dis_style_text,
10429
458
          "(UNDEF: %lu)", (unsigned long) sysm);
10430
1.49k
      }
10431
3.18k
          else
10432
3.18k
      {
10433
3.18k
        func (stream, dis_style_register, "%cPSR_",
10434
3.18k
        (given & 0x00400000) ? 'S' : 'C');
10435
10436
3.18k
        if (given & 0x80000)
10437
978
          func (stream, dis_style_register, "f");
10438
3.18k
        if (given & 0x40000)
10439
1.69k
          func (stream, dis_style_register, "s");
10440
3.18k
        if (given & 0x20000)
10441
1.96k
          func (stream, dis_style_register, "x");
10442
3.18k
        if (given & 0x10000)
10443
1.25k
          func (stream, dis_style_register, "c");
10444
3.18k
      }
10445
4.67k
          break;
10446
10447
779
        case 'U':
10448
779
          if ((given & 0xf0) == 0x60)
10449
391
      {
10450
391
        switch (given & 0xf)
10451
391
          {
10452
197
          case 0xf:
10453
197
            func (stream, dis_style_sub_mnemonic, "sy");
10454
197
            break;
10455
194
          default:
10456
194
            func (stream, dis_style_immediate, "#%d",
10457
194
            (int) given & 0xf);
10458
194
            break;
10459
391
          }
10460
391
      }
10461
388
          else
10462
388
      {
10463
388
        const char * opt = data_barrier_option (given & 0xf);
10464
388
        if (opt != NULL)
10465
194
          func (stream, dis_style_sub_mnemonic, "%s", opt);
10466
194
        else
10467
194
          func (stream, dis_style_immediate,
10468
194
          "#%d", (int) given & 0xf);
10469
388
      }
10470
779
          break;
10471
10472
8.10M
        case '0': case '1': case '2': case '3': case '4':
10473
8.19M
        case '5': case '6': case '7': case '8': case '9':
10474
8.19M
          {
10475
8.19M
      int width;
10476
8.19M
      unsigned long value;
10477
10478
8.19M
      c = arm_decode_bitfield (c, given, &value, &width);
10479
10480
8.19M
      switch (*c)
10481
8.19M
        {
10482
1.13M
        case 'R':
10483
1.13M
          if (value == 15)
10484
59.8k
            is_unpredictable = true;
10485
          /* Fall through.  */
10486
4.41M
        case 'r':
10487
4.41M
        case 'T':
10488
          /* We want register + 1 when decoding T.  */
10489
4.41M
          if (*c == 'T')
10490
195
            value = (value + 1) & 0xf;
10491
10492
4.41M
          if (c[1] == 'u')
10493
20.2k
            {
10494
        /* Eat the 'u' character.  */
10495
20.2k
        ++ c;
10496
10497
20.2k
        if (u_reg == value)
10498
1.62k
          is_unpredictable = true;
10499
20.2k
        u_reg = value;
10500
20.2k
            }
10501
4.41M
          if (c[1] == 'U')
10502
1.19k
            {
10503
        /* Eat the 'U' character.  */
10504
1.19k
        ++ c;
10505
10506
1.19k
        if (U_reg == value)
10507
338
          is_unpredictable = true;
10508
1.19k
        U_reg = value;
10509
1.19k
            }
10510
4.41M
          func (stream, dis_style_register, "%s",
10511
4.41M
          arm_regnames[value]);
10512
4.41M
          break;
10513
3.70k
        case 'd':
10514
3.70k
          func (stream, base_style, "%ld", value);
10515
3.70k
          value_in_comment = value;
10516
3.70k
          break;
10517
0
        case 'b':
10518
0
          func (stream, dis_style_immediate,
10519
0
          "%ld", value * 8);
10520
0
          value_in_comment = value * 8;
10521
0
          break;
10522
2.21k
        case 'W':
10523
2.21k
          func (stream, dis_style_immediate,
10524
2.21k
          "%ld", value + 1);
10525
2.21k
          value_in_comment = value + 1;
10526
2.21k
          break;
10527
537k
        case 'x':
10528
537k
          func (stream, dis_style_immediate,
10529
537k
          "0x%08lx", value);
10530
10531
          /* Some SWI instructions have special
10532
             meanings.  */
10533
537k
          if ((given & 0x0fffffff) == 0x0FF00000)
10534
238
            func (stream, dis_style_comment_start,
10535
238
            "\t@ IMB");
10536
537k
          else if ((given & 0x0fffffff) == 0x0FF00001)
10537
206
            func (stream, dis_style_comment_start,
10538
206
            "\t@ IMBRange");
10539
537k
          break;
10540
256
        case 'X':
10541
256
          func (stream, dis_style_immediate,
10542
256
          "%01lx", value & 0xf);
10543
256
          value_in_comment = value;
10544
256
          break;
10545
0
        case '`':
10546
0
          c++;
10547
0
          if (value == 0)
10548
0
            func (stream, dis_style_text, "%c", *c);
10549
0
          break;
10550
2.57M
        case '\'':
10551
2.57M
          c++;
10552
2.57M
          if (value == ((1ul << width) - 1))
10553
589k
            func (stream, base_style, "%c", *c);
10554
2.57M
          break;
10555
650k
        case '?':
10556
650k
          func (stream, base_style, "%c",
10557
650k
          c[(1 << width) - (int) value]);
10558
650k
          c += 1 << width;
10559
650k
          break;
10560
0
        default:
10561
0
          abort ();
10562
8.19M
        }
10563
8.19M
          }
10564
8.19M
          break;
10565
10566
8.19M
        case 'e':
10567
2.45k
          {
10568
2.45k
      int imm;
10569
10570
2.45k
      imm = (given & 0xf) | ((given & 0xfff00) >> 4);
10571
2.45k
      func (stream, dis_style_immediate, "%d", imm);
10572
2.45k
      value_in_comment = imm;
10573
2.45k
          }
10574
2.45k
          break;
10575
10576
694
        case 'E':
10577
          /* LSB and WIDTH fields of BFI or BFC.  The machine-
10578
       language instruction encodes LSB and MSB.  */
10579
694
          {
10580
694
      long msb = (given & 0x001f0000) >> 16;
10581
694
      long lsb = (given & 0x00000f80) >> 7;
10582
694
      long w = msb - lsb + 1;
10583
10584
694
      if (w > 0)
10585
201
        {
10586
201
          func (stream, dis_style_immediate, "#%lu", lsb);
10587
201
          func (stream, dis_style_text, ", ");
10588
201
          func (stream, dis_style_immediate, "#%lu", w);
10589
201
        }
10590
493
      else
10591
493
        func (stream, dis_style_text,
10592
493
        "(invalid: %lu:%lu)", lsb, msb);
10593
694
          }
10594
694
          break;
10595
10596
56.8k
        case 'R':
10597
          /* Get the PSR/banked register name.  */
10598
56.8k
          {
10599
56.8k
      const char * name;
10600
56.8k
      unsigned sysm = (given & 0x004f0000) >> 16;
10601
10602
56.8k
      sysm |= (given & 0x300) >> 4;
10603
56.8k
      name = banked_regname (sysm);
10604
10605
56.8k
      if (name != NULL)
10606
3.02k
        func (stream, dis_style_register, "%s", name);
10607
53.8k
      else
10608
53.8k
        func (stream, dis_style_text,
10609
53.8k
        "(UNDEF: %lu)", (unsigned long) sysm);
10610
56.8k
          }
10611
56.8k
          break;
10612
10613
18.7k
        case 'V':
10614
          /* 16-bit unsigned immediate from a MOVT or MOVW
10615
       instruction, encoded in bits 0:11 and 15:19.  */
10616
18.7k
          {
10617
18.7k
      long hi = (given & 0x000f0000) >> 4;
10618
18.7k
      long lo = (given & 0x00000fff);
10619
18.7k
      long imm16 = hi | lo;
10620
10621
18.7k
      func (stream, dis_style_immediate, "#%lu", imm16);
10622
18.7k
      value_in_comment = imm16;
10623
18.7k
          }
10624
18.7k
          break;
10625
10626
0
        default:
10627
0
          abort ();
10628
14.7M
        }
10629
14.7M
    }
10630
33.1M
        else
10631
33.1M
    {
10632
10633
33.1M
      if (*c == '@')
10634
420k
        base_style = dis_style_comment_start;
10635
10636
33.1M
      if (*c == '\t')
10637
3.89M
        base_style = dis_style_text;
10638
10639
33.1M
      func (stream, base_style, "%c", *c);
10640
33.1M
    }
10641
47.9M
      }
10642
10643
3.47M
    if (value_in_comment > 32 || value_in_comment < -16)
10644
467k
      func (stream, dis_style_comment_start, "\t@ 0x%lx",
10645
467k
      (value_in_comment & 0xffffffffUL));
10646
10647
3.47M
    if (is_unpredictable)
10648
115k
      func (stream, dis_style_comment_start, UNPREDICTABLE_INSTRUCTION);
10649
10650
3.47M
    return;
10651
3.47M
  }
10652
3.72M
    }
10653
1.11k
  func (stream, dis_style_comment_start, UNKNOWN_INSTRUCTION_32BIT,
10654
1.11k
  (unsigned) given);
10655
1.11k
  return;
10656
3.47M
}
10657
10658
/* Print one 16-bit Thumb instruction from PC on INFO->STREAM.  */
10659
10660
static void
10661
print_insn_thumb16 (bfd_vma pc, struct disassemble_info *info, long given)
10662
3.04M
{
10663
3.04M
  const struct opcode16 *insn;
10664
3.04M
  void *stream = info->stream;
10665
3.04M
  fprintf_styled_ftype func = info->fprintf_styled_func;
10666
3.04M
  enum disassembler_style base_style = dis_style_mnemonic;
10667
3.04M
  enum disassembler_style old_base_style = base_style;
10668
10669
202M
  for (insn = thumb_opcodes; insn->assembler; insn++)
10670
202M
    if ((given & insn->mask) == insn->value)
10671
3.04M
      {
10672
3.04M
  signed long value_in_comment = 0;
10673
3.04M
  const char *c = insn->assembler;
10674
10675
44.8M
  for (; *c; c++)
10676
41.7M
    {
10677
41.7M
      int domaskpc = 0;
10678
41.7M
      int domasklr = 0;
10679
10680
41.7M
      if (*c != '%')
10681
27.2M
        {
10682
27.2M
    if (*c == '@')
10683
168k
      base_style = dis_style_comment_start;
10684
10685
27.2M
    if (*c == '\t')
10686
3.16M
      base_style = dis_style_text;
10687
10688
27.2M
    func (stream, base_style, "%c", *c);
10689
10690
27.2M
    continue;
10691
27.2M
        }
10692
10693
14.5M
      switch (*++c)
10694
14.5M
        {
10695
1.91M
    case '{':
10696
1.91M
      ++c;
10697
1.91M
      if (*c == '\0')
10698
0
        abort ();
10699
1.91M
      old_base_style = base_style;
10700
1.91M
      base_style = decode_base_style (*c);
10701
1.91M
      ++c;
10702
1.91M
      if (*c != ':')
10703
0
        abort ();
10704
1.91M
      break;
10705
10706
1.91M
    case '}':
10707
1.91M
      base_style = old_base_style;
10708
1.91M
      break;
10709
10710
0
        case '%':
10711
0
    func (stream, base_style, "%%");
10712
0
    break;
10713
10714
1.41M
        case 'c':
10715
1.41M
    if (ifthen_state)
10716
34.2k
      func (stream, dis_style_mnemonic, "%s",
10717
34.2k
      arm_conditional[IFTHEN_COND]);
10718
1.41M
    break;
10719
10720
1.43M
        case 'C':
10721
1.43M
    if (ifthen_state)
10722
35.7k
      func (stream, dis_style_mnemonic, "%s",
10723
35.7k
      arm_conditional[IFTHEN_COND]);
10724
1.39M
    else
10725
1.39M
      func (stream, dis_style_mnemonic, "s");
10726
1.43M
    break;
10727
10728
50.0k
        case 'I':
10729
50.0k
    {
10730
50.0k
      unsigned int tmp;
10731
10732
50.0k
      ifthen_next_state = given & 0xff;
10733
192k
      for (tmp = given << 1; tmp & 0xf; tmp <<= 1)
10734
141k
        func (stream, dis_style_mnemonic,
10735
141k
        ((given ^ tmp) & 0x10) ? "e" : "t");
10736
50.0k
      func (stream, dis_style_text, "\t");
10737
50.0k
      func (stream, dis_style_sub_mnemonic, "%s",
10738
50.0k
      arm_conditional[(given >> 4) & 0xf]);
10739
50.0k
    }
10740
50.0k
    break;
10741
10742
103k
        case 'x':
10743
103k
    if (ifthen_next_state)
10744
1.98k
      func (stream, dis_style_comment_start,
10745
1.98k
      "\t@ unpredictable branch in IT block\n");
10746
103k
    break;
10747
10748
176k
        case 'X':
10749
176k
    if (ifthen_state)
10750
28.9k
      func (stream, dis_style_comment_start,
10751
28.9k
      "\t@ unpredictable <IT:%s>",
10752
28.9k
      arm_conditional[IFTHEN_COND]);
10753
176k
    break;
10754
10755
28.6k
        case 'S':
10756
28.6k
    {
10757
28.6k
      long reg;
10758
10759
28.6k
      reg = (given >> 3) & 0x7;
10760
28.6k
      if (given & (1 << 6))
10761
19.4k
        reg += 8;
10762
10763
28.6k
      func (stream, dis_style_register, "%s", arm_regnames[reg]);
10764
28.6k
    }
10765
28.6k
    break;
10766
10767
19.5k
        case 'D':
10768
19.5k
    {
10769
19.5k
      long reg;
10770
10771
19.5k
      reg = given & 0x7;
10772
19.5k
      if (given & (1 << 7))
10773
8.40k
        reg += 8;
10774
10775
19.5k
      func (stream, dis_style_register, "%s", arm_regnames[reg]);
10776
19.5k
    }
10777
19.5k
    break;
10778
10779
12.8k
        case 'N':
10780
12.8k
    if (given & (1 << 8))
10781
10.0k
      domasklr = 1;
10782
    /* Fall through.  */
10783
21.1k
        case 'O':
10784
21.1k
    if (*c == 'O' && (given & (1 << 8)))
10785
4.82k
      domaskpc = 1;
10786
    /* Fall through.  */
10787
167k
        case 'M':
10788
167k
    {
10789
167k
      int started = 0;
10790
167k
      int reg;
10791
10792
167k
      func (stream, dis_style_text, "{");
10793
10794
      /* It would be nice if we could spot
10795
         ranges, and generate the rS-rE format: */
10796
1.51M
      for (reg = 0; (reg < 8); reg++)
10797
1.34M
        if ((given & (1 << reg)) != 0)
10798
682k
          {
10799
682k
      if (started)
10800
529k
        func (stream, dis_style_text, ", ");
10801
682k
      started = 1;
10802
682k
      func (stream, dis_style_register, "%s",
10803
682k
            arm_regnames[reg]);
10804
682k
          }
10805
10806
167k
      if (domasklr)
10807
10.0k
        {
10808
10.0k
          if (started)
10809
9.06k
      func (stream, dis_style_text, ", ");
10810
10.0k
          started = 1;
10811
10.0k
          func (stream, dis_style_register, "%s",
10812
10.0k
          arm_regnames[14] /* "lr" */);
10813
10.0k
        }
10814
10815
167k
      if (domaskpc)
10816
4.82k
        {
10817
4.82k
          if (started)
10818
4.22k
      func (stream, dis_style_text, ", ");
10819
4.82k
          func (stream, dis_style_register, "%s",
10820
4.82k
          arm_regnames[15] /* "pc" */);
10821
4.82k
        }
10822
10823
167k
      func (stream, dis_style_text, "}");
10824
167k
    }
10825
167k
    break;
10826
10827
84.5k
        case 'W':
10828
    /* Print writeback indicator for a LDMIA.  We are doing a
10829
       writeback if the base register is not in the register
10830
       mask.  */
10831
84.5k
    if ((given & (1 << ((given & 0x0700) >> 8))) == 0)
10832
42.5k
      func (stream, dis_style_text, "!");
10833
84.5k
    break;
10834
10835
34.3k
        case 'b':
10836
    /* Print ARM V6T2 CZB address: pc+4+6 bits.  */
10837
34.3k
    {
10838
34.3k
      bfd_vma address = (pc + 4
10839
34.3k
             + ((given & 0x00f8) >> 2)
10840
34.3k
             + ((given & 0x0200) >> 3));
10841
34.3k
      info->print_address_func (address, info);
10842
10843
      /* Fill in instruction information.  */
10844
34.3k
      info->insn_info_valid = 1;
10845
34.3k
      info->insn_type = dis_branch;
10846
34.3k
      info->target = address;
10847
34.3k
    }
10848
34.3k
    break;
10849
10850
188k
        case 's':
10851
    /* Right shift immediate -- bits 6..10; 1-31 print
10852
       as themselves, 0 prints as 32.  */
10853
188k
    {
10854
188k
      long imm = (given & 0x07c0) >> 6;
10855
188k
      if (imm == 0)
10856
16.9k
        imm = 32;
10857
188k
      func (stream, dis_style_immediate, "#%ld", imm);
10858
188k
    }
10859
188k
    break;
10860
10861
4.89M
        case '0': case '1': case '2': case '3': case '4':
10862
6.97M
        case '5': case '6': case '7': case '8': case '9':
10863
6.97M
    {
10864
6.97M
      int bitstart = *c++ - '0';
10865
6.97M
      int bitend = 0;
10866
10867
7.07M
      while (*c >= '0' && *c <= '9')
10868
94.9k
        bitstart = (bitstart * 10) + *c++ - '0';
10869
10870
6.97M
      switch (*c)
10871
6.97M
        {
10872
6.88M
        case '-':
10873
6.88M
          {
10874
6.88M
      bfd_vma reg;
10875
10876
6.88M
      c++;
10877
15.7M
      while (*c >= '0' && *c <= '9')
10878
8.87M
        bitend = (bitend * 10) + *c++ - '0';
10879
6.88M
      if (!bitend)
10880
0
        abort ();
10881
6.88M
      reg = given >> bitstart;
10882
6.88M
      reg &= ((bfd_vma) 2 << (bitend - bitstart)) - 1;
10883
10884
6.88M
      switch (*c)
10885
6.88M
        {
10886
4.82M
        case 'r':
10887
4.82M
          func (stream, dis_style_register, "%s",
10888
4.82M
          arm_regnames[reg]);
10889
4.82M
          break;
10890
10891
901k
        case 'd':
10892
901k
          func (stream, dis_style_immediate, "%ld",
10893
901k
          (long) reg);
10894
901k
          value_in_comment = reg;
10895
901k
          break;
10896
10897
175k
        case 'H':
10898
175k
          func (stream, dis_style_immediate, "%ld",
10899
175k
          (long) (reg << 1));
10900
175k
          value_in_comment = reg << 1;
10901
175k
          break;
10902
10903
531k
        case 'W':
10904
531k
          func (stream, dis_style_immediate, "%ld",
10905
531k
          (long) (reg << 2));
10906
531k
          value_in_comment = reg << 2;
10907
531k
          break;
10908
10909
149k
        case 'a':
10910
          /* PC-relative address -- the bottom two
10911
             bits of the address are dropped
10912
             before the calculation.  */
10913
149k
          info->print_address_func
10914
149k
            (((pc + 4) & ~3) + (reg << 2), info);
10915
149k
          value_in_comment = 0;
10916
149k
          break;
10917
10918
27.7k
        case 'x':
10919
27.7k
          func (stream, dis_style_immediate, "0x%04lx",
10920
27.7k
          (long) reg);
10921
27.7k
          break;
10922
10923
184k
        case 'B':
10924
184k
          reg = ((reg ^ (1 << bitend)) - (1 << bitend));
10925
184k
          bfd_vma target = reg * 2 + pc + 4;
10926
184k
          info->print_address_func (target, info);
10927
184k
          value_in_comment = 0;
10928
10929
          /* Fill in instruction information.  */
10930
184k
          info->insn_info_valid = 1;
10931
184k
          info->insn_type = dis_branch;
10932
184k
          info->target = target;
10933
184k
          break;
10934
10935
90.8k
        case 'c':
10936
90.8k
          func (stream, dis_style_mnemonic, "%s",
10937
90.8k
          arm_conditional [reg]);
10938
90.8k
          break;
10939
10940
0
        default:
10941
0
          abort ();
10942
6.88M
        }
10943
6.88M
          }
10944
6.88M
          break;
10945
10946
6.88M
        case '\'':
10947
63.1k
          c++;
10948
63.1k
          if ((given & (1 << bitstart)) != 0)
10949
28.8k
      func (stream, base_style, "%c", *c);
10950
63.1k
          break;
10951
10952
33.9k
        case '?':
10953
33.9k
          ++c;
10954
33.9k
          if ((given & (1 << bitstart)) != 0)
10955
26.3k
      func (stream, base_style, "%c", *c++);
10956
7.64k
          else
10957
7.64k
      func (stream, base_style, "%c", *++c);
10958
33.9k
          break;
10959
10960
0
        default:
10961
0
          abort ();
10962
6.97M
        }
10963
6.97M
    }
10964
6.97M
    break;
10965
10966
6.97M
        default:
10967
0
    abort ();
10968
14.5M
        }
10969
14.5M
    }
10970
10971
3.04M
  if (value_in_comment > 32 || value_in_comment < -16)
10972
685k
    func (stream, dis_style_comment_start,
10973
685k
    "\t@ 0x%lx", value_in_comment);
10974
3.04M
  return;
10975
3.04M
      }
10976
10977
  /* No match.  */
10978
0
  func (stream, dis_style_comment_start, UNKNOWN_INSTRUCTION_16BIT,
10979
0
  (unsigned) given);
10980
0
  return;
10981
3.04M
}
10982
10983
/* Return the name of an V7M special register.  */
10984
10985
static const char *
10986
psr_name (int regno)
10987
18.9k
{
10988
18.9k
  switch (regno)
10989
18.9k
    {
10990
660
    case 0x0: return "APSR";
10991
314
    case 0x1: return "IAPSR";
10992
363
    case 0x2: return "EAPSR";
10993
263
    case 0x3: return "PSR";
10994
612
    case 0x5: return "IPSR";
10995
322
    case 0x6: return "EPSR";
10996
241
    case 0x7: return "IEPSR";
10997
654
    case 0x8: return "MSP";
10998
377
    case 0x9: return "PSP";
10999
481
    case 0xa: return "MSPLIM";
11000
461
    case 0xb: return "PSPLIM";
11001
371
    case 0x10: return "PRIMASK";
11002
310
    case 0x11: return "BASEPRI";
11003
204
    case 0x12: return "BASEPRI_MAX";
11004
322
    case 0x13: return "FAULTMASK";
11005
294
    case 0x14: return "CONTROL";
11006
536
    case 0x20: return "PAC_KEY_P_0";
11007
334
    case 0x21: return "PAC_KEY_P_1";
11008
466
    case 0x22: return "PAC_KEY_P_2";
11009
251
    case 0x23: return "PAC_KEY_P_3";
11010
331
    case 0x24: return "PAC_KEY_U_0";
11011
335
    case 0x25: return "PAC_KEY_U_1";
11012
301
    case 0x26: return "PAC_KEY_U_2";
11013
215
    case 0x27: return "PAC_KEY_U_3";
11014
283
    case 0x88: return "MSP_NS";
11015
409
    case 0x89: return "PSP_NS";
11016
402
    case 0x8a: return "MSPLIM_NS";
11017
556
    case 0x8b: return "PSPLIM_NS";
11018
334
    case 0x90: return "PRIMASK_NS";
11019
881
    case 0x91: return "BASEPRI_NS";
11020
237
    case 0x93: return "FAULTMASK_NS";
11021
358
    case 0x94: return "CONTROL_NS";
11022
399
    case 0x98: return "SP_NS";
11023
1.19k
    case 0xa0: return "PAC_KEY_P_0_NS";
11024
298
    case 0xa1: return "PAC_KEY_P_1_NS";
11025
441
    case 0xa2: return "PAC_KEY_P_2_NS";
11026
413
    case 0xa3: return "PAC_KEY_P_3_NS";
11027
286
    case 0xa4: return "PAC_KEY_U_0_NS";
11028
341
    case 0xa5: return "PAC_KEY_U_1_NS";
11029
311
    case 0xa6: return "PAC_KEY_U_2_NS";
11030
361
    case 0xa7: return "PAC_KEY_U_3_NS";
11031
2.40k
    default: return "<unknown>";
11032
18.9k
    }
11033
18.9k
}
11034
11035
/* Print one 32-bit Thumb instruction from PC on INFO->STREAM.  */
11036
11037
static void
11038
print_insn_thumb32 (bfd_vma pc, struct disassemble_info *info, long given)
11039
880k
{
11040
880k
  const struct opcode32 *insn;
11041
880k
  void *stream = info->stream;
11042
880k
  fprintf_styled_ftype func = info->fprintf_styled_func;
11043
880k
  bool is_mve = is_v81m_architecture (info);
11044
880k
  enum disassembler_style base_style = dis_style_mnemonic;
11045
880k
  enum disassembler_style old_base_style = base_style;
11046
11047
880k
  if (print_insn_coprocessor (pc, info, given, true))
11048
32.3k
    return;
11049
11050
848k
  if (!is_mve && print_insn_neon (info, given, true))
11051
51.3k
    return;
11052
11053
796k
  if (is_mve && print_insn_mve (info, given))
11054
174k
    return;
11055
11056
622k
  if (print_insn_cde (info, given, true))
11057
9.32k
    return;
11058
11059
613k
  if (print_insn_generic_coprocessor (pc, info, given, true))
11060
80.1k
    return;
11061
11062
123M
  for (insn = thumb32_opcodes; insn->assembler; insn++)
11063
123M
    if ((given & insn->mask) == insn->value)
11064
533k
      {
11065
533k
  bool is_clrm = false;
11066
533k
  bool is_unpredictable = false;
11067
533k
  signed long value_in_comment = 0;
11068
533k
  const char *c = insn->assembler;
11069
11070
13.5M
  for (; *c; c++)
11071
13.0M
    {
11072
13.0M
      if (*c != '%')
11073
12.0M
        {
11074
12.0M
    if (*c == '@')
11075
375k
      base_style = dis_style_comment_start;
11076
12.0M
    if (*c == '\t')
11077
907k
      base_style = dis_style_text;
11078
12.0M
    func (stream, base_style, "%c", *c);
11079
12.0M
    continue;
11080
12.0M
        }
11081
11082
989k
      switch (*++c)
11083
989k
        {
11084
16.6k
        case '{':
11085
16.6k
    ++c;
11086
16.6k
    if (*c == '\0')
11087
0
      abort ();
11088
16.6k
    old_base_style = base_style;
11089
16.6k
    base_style = decode_base_style (*c);
11090
16.6k
    ++c;
11091
16.6k
    if (*c != ':')
11092
0
      abort ();
11093
16.6k
    break;
11094
11095
16.6k
        case '}':
11096
16.6k
    base_style = old_base_style;
11097
16.6k
    break;
11098
11099
0
        case '%':
11100
0
    func (stream, base_style, "%%");
11101
0
    break;
11102
11103
141k
        case 'c':
11104
141k
    if (ifthen_state)
11105
4.09k
      func (stream, dis_style_mnemonic, "%s",
11106
4.09k
      arm_conditional[IFTHEN_COND]);
11107
141k
    break;
11108
11109
32.7k
        case 'x':
11110
32.7k
    if (ifthen_next_state)
11111
1.29k
      func (stream, dis_style_comment_start,
11112
1.29k
      "\t@ unpredictable branch in IT block\n");
11113
32.7k
    break;
11114
11115
9.92k
        case 'X':
11116
9.92k
    if (ifthen_state)
11117
492
      func (stream, dis_style_comment_start,
11118
492
      "\t@ unpredictable <IT:%s>",
11119
492
      arm_conditional[IFTHEN_COND]);
11120
9.92k
    break;
11121
11122
1.57k
        case 'I':
11123
1.57k
    {
11124
1.57k
      unsigned int imm12 = 0;
11125
11126
1.57k
      imm12 |= (given & 0x000000ffu);
11127
1.57k
      imm12 |= (given & 0x00007000u) >> 4;
11128
1.57k
      imm12 |= (given & 0x04000000u) >> 15;
11129
1.57k
      func (stream, dis_style_immediate, "#%u", imm12);
11130
1.57k
      value_in_comment = imm12;
11131
1.57k
    }
11132
1.57k
    break;
11133
11134
10.2k
        case 'M':
11135
10.2k
    {
11136
10.2k
      unsigned int bits = 0, imm, imm8, mod;
11137
11138
10.2k
      bits |= (given & 0x000000ffu);
11139
10.2k
      bits |= (given & 0x00007000u) >> 4;
11140
10.2k
      bits |= (given & 0x04000000u) >> 15;
11141
10.2k
      imm8 = (bits & 0x0ff);
11142
10.2k
      mod = (bits & 0xf00) >> 8;
11143
10.2k
      switch (mod)
11144
10.2k
        {
11145
2.01k
        case 0: imm = imm8; break;
11146
730
        case 1: imm = ((imm8 << 16) | imm8); break;
11147
434
        case 2: imm = ((imm8 << 24) | (imm8 << 8)); break;
11148
971
        case 3: imm = ((imm8 << 24) | (imm8 << 16) | (imm8 << 8) | imm8); break;
11149
6.14k
        default:
11150
6.14k
          mod  = (bits & 0xf80) >> 7;
11151
6.14k
          imm8 = (bits & 0x07f) | 0x80;
11152
6.14k
          imm  = (((imm8 << (32 - mod)) | (imm8 >> mod)) & 0xffffffff);
11153
10.2k
        }
11154
10.2k
      func (stream, dis_style_immediate, "#%u", imm);
11155
10.2k
      value_in_comment = imm;
11156
10.2k
    }
11157
0
    break;
11158
11159
674
        case 'J':
11160
674
    {
11161
674
      unsigned int imm = 0;
11162
11163
674
      imm |= (given & 0x000000ffu);
11164
674
      imm |= (given & 0x00007000u) >> 4;
11165
674
      imm |= (given & 0x04000000u) >> 15;
11166
674
      imm |= (given & 0x000f0000u) >> 4;
11167
674
      func (stream, dis_style_immediate, "#%u", imm);
11168
674
      value_in_comment = imm;
11169
674
    }
11170
674
    break;
11171
11172
335
        case 'K':
11173
335
    {
11174
335
      unsigned int imm = 0;
11175
11176
335
      imm |= (given & 0x000f0000u) >> 16;
11177
335
      imm |= (given & 0x00000ff0u) >> 0;
11178
335
      imm |= (given & 0x0000000fu) << 12;
11179
335
      func (stream, dis_style_immediate, "#%u", imm);
11180
335
      value_in_comment = imm;
11181
335
    }
11182
335
    break;
11183
11184
353
        case 'H':
11185
353
    {
11186
353
      unsigned int imm = 0;
11187
11188
353
      imm |= (given & 0x000f0000u) >> 4;
11189
353
      imm |= (given & 0x00000fffu) >> 0;
11190
353
      func (stream, dis_style_immediate, "#%u", imm);
11191
353
      value_in_comment = imm;
11192
353
    }
11193
353
    break;
11194
11195
318
        case 'V':
11196
318
    {
11197
318
      unsigned int imm = 0;
11198
11199
318
      imm |= (given & 0x00000fffu);
11200
318
      imm |= (given & 0x000f0000u) >> 4;
11201
318
      func (stream, dis_style_immediate, "#%u", imm);
11202
318
      value_in_comment = imm;
11203
318
    }
11204
318
    break;
11205
11206
6.81k
        case 'S':
11207
6.81k
    {
11208
6.81k
      unsigned int reg = (given & 0x0000000fu);
11209
6.81k
      unsigned int stp = (given & 0x00000030u) >> 4;
11210
6.81k
      unsigned int imm = 0;
11211
6.81k
      imm |= (given & 0x000000c0u) >> 6;
11212
6.81k
      imm |= (given & 0x00007000u) >> 10;
11213
11214
6.81k
      func (stream, dis_style_register, "%s", arm_regnames[reg]);
11215
6.81k
      switch (stp)
11216
6.81k
        {
11217
1.72k
        case 0:
11218
1.72k
          if (imm > 0)
11219
1.03k
      {
11220
1.03k
        func (stream, dis_style_text, ", ");
11221
1.03k
        func (stream, dis_style_sub_mnemonic, "lsl ");
11222
1.03k
        func (stream, dis_style_immediate, "#%u", imm);
11223
1.03k
      }
11224
1.72k
          break;
11225
11226
1.98k
        case 1:
11227
1.98k
          if (imm == 0)
11228
504
      imm = 32;
11229
1.98k
          func (stream, dis_style_text, ", ");
11230
1.98k
          func (stream, dis_style_sub_mnemonic, "lsr ");
11231
1.98k
          func (stream, dis_style_immediate, "#%u", imm);
11232
1.98k
          break;
11233
11234
1.40k
        case 2:
11235
1.40k
          if (imm == 0)
11236
330
      imm = 32;
11237
1.40k
          func (stream, dis_style_text, ", ");
11238
1.40k
          func (stream, dis_style_sub_mnemonic, "asr ");
11239
1.40k
          func (stream, dis_style_immediate, "#%u", imm);
11240
1.40k
          break;
11241
11242
1.71k
        case 3:
11243
1.71k
          if (imm == 0)
11244
377
      {
11245
377
        func (stream, dis_style_text, ", ");
11246
377
        func (stream, dis_style_sub_mnemonic, "rrx");
11247
377
      }
11248
1.33k
          else
11249
1.33k
      {
11250
1.33k
        func (stream, dis_style_text, ", ");
11251
1.33k
        func (stream, dis_style_sub_mnemonic, "ror ");
11252
1.33k
        func (stream, dis_style_immediate, "#%u", imm);
11253
1.33k
      }
11254
6.81k
        }
11255
6.81k
    }
11256
6.81k
    break;
11257
11258
25.3k
        case 'a':
11259
25.3k
    {
11260
25.3k
      unsigned int Rn  = (given & 0x000f0000) >> 16;
11261
25.3k
      unsigned int U   = ! NEGATIVE_BIT_SET;
11262
25.3k
      unsigned int op  = (given & 0x00000f00) >> 8;
11263
25.3k
      unsigned int i12 = (given & 0x00000fff);
11264
25.3k
      unsigned int i8  = (given & 0x000000ff);
11265
25.3k
      bool writeback = false, postind = false;
11266
25.3k
      bfd_vma offset = 0;
11267
11268
25.3k
      func (stream, dis_style_text, "[");
11269
25.3k
      func (stream, dis_style_register, "%s", arm_regnames[Rn]);
11270
25.3k
      if (U) /* 12-bit positive immediate offset.  */
11271
14.6k
        {
11272
14.6k
          offset = i12;
11273
14.6k
          if (Rn != 15)
11274
11.7k
      value_in_comment = offset;
11275
14.6k
        }
11276
10.7k
      else if (Rn == 15) /* 12-bit negative immediate offset.  */
11277
1.09k
        offset = - (int) i12;
11278
9.60k
      else if (op == 0x0) /* Shifted register offset.  */
11279
1.26k
        {
11280
1.26k
          unsigned int Rm = (i8 & 0x0f);
11281
1.26k
          unsigned int sh = (i8 & 0x30) >> 4;
11282
11283
1.26k
          func (stream, dis_style_text, ", ");
11284
1.26k
          func (stream, dis_style_register, "%s",
11285
1.26k
          arm_regnames[Rm]);
11286
1.26k
          if (sh)
11287
693
      {
11288
693
        func (stream, dis_style_text, ", ");
11289
693
        func (stream, dis_style_sub_mnemonic, "lsl ");
11290
693
        func (stream, dis_style_immediate, "#%u", sh);
11291
693
      }
11292
1.26k
          func (stream, dis_style_text, "]");
11293
1.26k
          break;
11294
1.26k
        }
11295
8.34k
      else switch (op)
11296
8.34k
        {
11297
628
        case 0xE:  /* 8-bit positive immediate offset.  */
11298
628
          offset = i8;
11299
628
          break;
11300
11301
1.00k
        case 0xC:  /* 8-bit negative immediate offset.  */
11302
1.00k
          offset = -i8;
11303
1.00k
          break;
11304
11305
1.10k
        case 0xF:  /* 8-bit + preindex with wb.  */
11306
1.10k
          offset = i8;
11307
1.10k
          writeback = true;
11308
1.10k
          break;
11309
11310
656
        case 0xD:  /* 8-bit - preindex with wb.  */
11311
656
          offset = -i8;
11312
656
          writeback = true;
11313
656
          break;
11314
11315
944
        case 0xB:  /* 8-bit + postindex.  */
11316
944
          offset = i8;
11317
944
          postind = true;
11318
944
          break;
11319
11320
625
        case 0x9:  /* 8-bit - postindex.  */
11321
625
          offset = -i8;
11322
625
          postind = true;
11323
625
          break;
11324
11325
3.38k
        default:
11326
3.38k
          func (stream, dis_style_text, ", <undefined>]");
11327
3.38k
          goto skip;
11328
8.34k
        }
11329
11330
20.7k
      if (postind)
11331
1.56k
        {
11332
1.56k
          func (stream, dis_style_text, "], ");
11333
1.56k
          func (stream, dis_style_immediate, "#%d", (int) offset);
11334
1.56k
        }
11335
19.1k
      else
11336
19.1k
        {
11337
19.1k
          if (offset)
11338
17.8k
      {
11339
17.8k
        func (stream, dis_style_text, ", ");
11340
17.8k
        func (stream, dis_style_immediate, "#%d",
11341
17.8k
        (int) offset);
11342
17.8k
      }
11343
19.1k
          func (stream, dis_style_text, writeback ? "]!" : "]");
11344
19.1k
        }
11345
11346
20.7k
      if (Rn == 15)
11347
4.02k
        {
11348
4.02k
          func (stream, dis_style_comment_start, "\t@ ");
11349
4.02k
          info->print_address_func (((pc + 4) & ~3) + offset, info);
11350
4.02k
        }
11351
20.7k
    }
11352
24.1k
        skip:
11353
24.1k
    break;
11354
11355
0
        case 'A':
11356
0
    {
11357
0
      unsigned int U   = ! NEGATIVE_BIT_SET;
11358
0
      unsigned int W   = WRITEBACK_BIT_SET;
11359
0
      unsigned int Rn  = (given & 0x000f0000) >> 16;
11360
0
      unsigned int off = (given & 0x000000ff);
11361
11362
0
      func (stream, dis_style_text, "[");
11363
0
      func (stream, dis_style_register, "%s", arm_regnames[Rn]);
11364
11365
0
      if (PRE_BIT_SET)
11366
0
        {
11367
0
          if (off || !U)
11368
0
      {
11369
0
        func (stream, dis_style_text, ", ");
11370
0
        func (stream, dis_style_immediate, "#%c%u",
11371
0
        U ? '+' : '-', off * 4);
11372
0
        value_in_comment = off * 4 * (U ? 1 : -1);
11373
0
      }
11374
0
          func (stream, dis_style_text, "]");
11375
0
          if (W)
11376
0
      func (stream, dis_style_text, "!");
11377
0
        }
11378
0
      else
11379
0
        {
11380
0
          func (stream, dis_style_text, "], ");
11381
0
          if (W)
11382
0
      {
11383
0
        func (stream, dis_style_immediate, "#%c%u",
11384
0
        U ? '+' : '-', off * 4);
11385
0
        value_in_comment = off * 4 * (U ? 1 : -1);
11386
0
      }
11387
0
          else
11388
0
      {
11389
0
        func (stream, dis_style_text, "{");
11390
0
        func (stream, dis_style_immediate, "%u", off);
11391
0
        func (stream, dis_style_text, "}");
11392
0
        value_in_comment = off;
11393
0
      }
11394
0
        }
11395
0
    }
11396
0
    break;
11397
11398
24.2k
        case 'w':
11399
24.2k
    {
11400
24.2k
      unsigned int Sbit = (given & 0x01000000) >> 24;
11401
24.2k
      unsigned int type = (given & 0x00600000) >> 21;
11402
11403
24.2k
      switch (type)
11404
24.2k
        {
11405
6.21k
        case 0:
11406
6.21k
          func (stream, dis_style_mnemonic, Sbit ? "sb" : "b");
11407
6.21k
          break;
11408
2.97k
        case 1:
11409
2.97k
          func (stream, dis_style_mnemonic, Sbit ? "sh" : "h");
11410
2.97k
          break;
11411
3.15k
        case 2:
11412
3.15k
          if (Sbit)
11413
775
      func (stream, dis_style_text, "??");
11414
3.15k
          break;
11415
11.9k
        case 3:
11416
11.9k
          func (stream, dis_style_text, "??");
11417
11.9k
          break;
11418
24.2k
        }
11419
24.2k
    }
11420
24.2k
    break;
11421
11422
24.2k
        case 'n':
11423
1.00k
    is_clrm = true;
11424
    /* Fall through.  */
11425
4.36k
        case 'm':
11426
4.36k
    {
11427
4.36k
      int started = 0;
11428
4.36k
      int reg;
11429
11430
4.36k
      func (stream, dis_style_text, "{");
11431
74.2k
      for (reg = 0; reg < 16; reg++)
11432
69.8k
        if ((given & (1 << reg)) != 0)
11433
34.9k
          {
11434
34.9k
      if (started)
11435
30.7k
        func (stream, dis_style_text, ", ");
11436
34.9k
      started = 1;
11437
34.9k
      if (is_clrm && reg == 13)
11438
0
        func (stream, dis_style_text, "(invalid: %s)",
11439
0
        arm_regnames[reg]);
11440
34.9k
      else if (is_clrm && reg == 15)
11441
965
        func (stream, dis_style_register, "%s", "APSR");
11442
34.0k
      else
11443
34.0k
        func (stream, dis_style_register, "%s",
11444
34.0k
        arm_regnames[reg]);
11445
34.9k
          }
11446
4.36k
      func (stream, dis_style_text, "}");
11447
4.36k
    }
11448
4.36k
    break;
11449
11450
751
        case 'E':
11451
751
    {
11452
751
      unsigned int msb = (given & 0x0000001f);
11453
751
      unsigned int lsb = 0;
11454
11455
751
      lsb |= (given & 0x000000c0u) >> 6;
11456
751
      lsb |= (given & 0x00007000u) >> 10;
11457
751
      func (stream, dis_style_immediate, "#%u", lsb);
11458
751
      func (stream, dis_style_text, ", ");
11459
751
      func (stream, dis_style_immediate, "#%u", msb - lsb + 1);
11460
751
    }
11461
751
    break;
11462
11463
634
        case 'F':
11464
634
    {
11465
634
      unsigned int width = (given & 0x0000001f) + 1;
11466
634
      unsigned int lsb = 0;
11467
11468
634
      lsb |= (given & 0x000000c0u) >> 6;
11469
634
      lsb |= (given & 0x00007000u) >> 10;
11470
634
      func (stream, dis_style_immediate, "#%u", lsb);
11471
634
      func (stream, dis_style_text, ", ");
11472
634
      func (stream, dis_style_immediate, "#%u", width);
11473
634
    }
11474
634
    break;
11475
11476
5.44k
        case 'G':
11477
5.44k
    {
11478
5.44k
      unsigned int boff = (((given & 0x07800000) >> 23) << 1);
11479
5.44k
      func (stream, dis_style_immediate, "%x", boff);
11480
5.44k
    }
11481
5.44k
    break;
11482
11483
866
        case 'W':
11484
866
    {
11485
866
      unsigned int immA = (given & 0x001f0000u) >> 16;
11486
866
      unsigned int immB = (given & 0x000007feu) >> 1;
11487
866
      unsigned int immC = (given & 0x00000800u) >> 11;
11488
866
      bfd_vma offset = 0;
11489
11490
866
      offset |= immA << 12;
11491
866
      offset |= immB << 2;
11492
866
      offset |= immC << 1;
11493
      /* Sign extend.  */
11494
866
      offset = (offset & 0x10000) ? offset - (1 << 17) : offset;
11495
11496
866
      info->print_address_func (pc + 4 + offset, info);
11497
866
    }
11498
866
    break;
11499
11500
2.51k
        case 'Y':
11501
2.51k
    {
11502
2.51k
      unsigned int immA = (given & 0x007f0000u) >> 16;
11503
2.51k
      unsigned int immB = (given & 0x000007feu) >> 1;
11504
2.51k
      unsigned int immC = (given & 0x00000800u) >> 11;
11505
2.51k
      bfd_vma offset = 0;
11506
11507
2.51k
      offset |= immA << 12;
11508
2.51k
      offset |= immB << 2;
11509
2.51k
      offset |= immC << 1;
11510
      /* Sign extend.  */
11511
2.51k
      offset = (offset & 0x40000) ? offset - (1 << 19) : offset;
11512
11513
2.51k
      info->print_address_func (pc + 4 + offset, info);
11514
2.51k
    }
11515
2.51k
    break;
11516
11517
1.99k
        case 'Z':
11518
1.99k
    {
11519
1.99k
      unsigned int immA = (given & 0x00010000u) >> 16;
11520
1.99k
      unsigned int immB = (given & 0x000007feu) >> 1;
11521
1.99k
      unsigned int immC = (given & 0x00000800u) >> 11;
11522
1.99k
      bfd_vma offset = 0;
11523
11524
1.99k
      offset |= immA << 12;
11525
1.99k
      offset |= immB << 2;
11526
1.99k
      offset |= immC << 1;
11527
      /* Sign extend.  */
11528
1.99k
      offset = (offset & 0x1000) ? offset - (1 << 13) : offset;
11529
11530
1.99k
      info->print_address_func (pc + 4 + offset, info);
11531
11532
1.99k
      unsigned int T    = (given & 0x00020000u) >> 17;
11533
1.99k
      unsigned int endoffset = (((given & 0x07800000) >> 23) << 1);
11534
1.99k
      unsigned int boffset   = (T == 1) ? 4 : 2;
11535
1.99k
      func (stream, dis_style_text, ", ");
11536
1.99k
      func (stream, dis_style_immediate, "%x",
11537
1.99k
      endoffset + boffset);
11538
1.99k
    }
11539
1.99k
    break;
11540
11541
1.09k
        case 'Q':
11542
1.09k
    {
11543
1.09k
      unsigned int immh = (given & 0x000007feu) >> 1;
11544
1.09k
      unsigned int imml = (given & 0x00000800u) >> 11;
11545
1.09k
      bfd_vma imm32 = 0;
11546
11547
1.09k
      imm32 |= immh << 2;
11548
1.09k
      imm32 |= imml << 1;
11549
11550
1.09k
      info->print_address_func (pc + 4 + imm32, info);
11551
1.09k
    }
11552
1.09k
    break;
11553
11554
226
        case 'P':
11555
226
    {
11556
226
      unsigned int immh = (given & 0x000007feu) >> 1;
11557
226
      unsigned int imml = (given & 0x00000800u) >> 11;
11558
226
      bfd_vma imm32 = 0;
11559
11560
226
      imm32 |= immh << 2;
11561
226
      imm32 |= imml << 1;
11562
11563
226
      info->print_address_func (pc + 4 - imm32, info);
11564
226
    }
11565
226
    break;
11566
11567
9.58k
        case 'b':
11568
9.58k
    {
11569
9.58k
      unsigned int S = (given & 0x04000000u) >> 26;
11570
9.58k
      unsigned int J1 = (given & 0x00002000u) >> 13;
11571
9.58k
      unsigned int J2 = (given & 0x00000800u) >> 11;
11572
9.58k
      bfd_vma offset = 0;
11573
11574
9.58k
      offset |= !S << 20;
11575
9.58k
      offset |= J2 << 19;
11576
9.58k
      offset |= J1 << 18;
11577
9.58k
      offset |= (given & 0x003f0000) >> 4;
11578
9.58k
      offset |= (given & 0x000007ff) << 1;
11579
9.58k
      offset -= (1 << 20);
11580
11581
9.58k
      bfd_vma target = pc + 4 + offset;
11582
9.58k
      info->print_address_func (target, info);
11583
11584
      /* Fill in instruction information.  */
11585
9.58k
      info->insn_info_valid = 1;
11586
9.58k
      info->insn_type = dis_branch;
11587
9.58k
      info->target = target;
11588
9.58k
    }
11589
9.58k
    break;
11590
11591
32.7k
        case 'B':
11592
32.7k
    {
11593
32.7k
      unsigned int S = (given & 0x04000000u) >> 26;
11594
32.7k
      unsigned int I1 = (given & 0x00002000u) >> 13;
11595
32.7k
      unsigned int I2 = (given & 0x00000800u) >> 11;
11596
32.7k
      bfd_vma offset = 0;
11597
11598
32.7k
      offset |= !S << 24;
11599
32.7k
      offset |= !(I1 ^ S) << 23;
11600
32.7k
      offset |= !(I2 ^ S) << 22;
11601
32.7k
      offset |= (given & 0x03ff0000u) >> 4;
11602
32.7k
      offset |= (given & 0x000007ffu) << 1;
11603
32.7k
      offset -= (1 << 24);
11604
32.7k
      offset += pc + 4;
11605
11606
      /* BLX target addresses are always word aligned.  */
11607
32.7k
      if ((given & 0x00001000u) == 0)
11608
4.60k
          offset &= ~2u;
11609
11610
32.7k
      info->print_address_func (offset, info);
11611
11612
      /* Fill in instruction information.  */
11613
32.7k
      info->insn_info_valid = 1;
11614
32.7k
      info->insn_type = dis_branch;
11615
32.7k
      info->target = offset;
11616
32.7k
    }
11617
32.7k
    break;
11618
11619
2.53k
        case 's':
11620
2.53k
    {
11621
2.53k
      unsigned int shift = 0;
11622
11623
2.53k
      shift |= (given & 0x000000c0u) >> 6;
11624
2.53k
      shift |= (given & 0x00007000u) >> 10;
11625
2.53k
      if (WRITEBACK_BIT_SET)
11626
324
        {
11627
324
          func (stream, dis_style_text, ", ");
11628
324
          func (stream, dis_style_sub_mnemonic, "asr ");
11629
324
          func (stream, dis_style_immediate, "#%u", shift);
11630
324
        }
11631
2.21k
      else if (shift)
11632
1.36k
        {
11633
1.36k
          func (stream, dis_style_text, ", ");
11634
1.36k
          func (stream, dis_style_sub_mnemonic, "lsl ");
11635
1.36k
          func (stream, dis_style_immediate, "#%u", shift);
11636
1.36k
        }
11637
      /* else print nothing - lsl #0 */
11638
2.53k
    }
11639
2.53k
    break;
11640
11641
670
        case 'R':
11642
670
    {
11643
670
      unsigned int rot = (given & 0x00000030) >> 4;
11644
11645
670
      if (rot)
11646
393
        {
11647
393
          func (stream, dis_style_text, ", ");
11648
393
          func (stream, dis_style_sub_mnemonic, "ror ");
11649
393
          func (stream, dis_style_immediate, "#%u", rot * 8);
11650
393
        }
11651
670
    }
11652
670
    break;
11653
11654
1.54k
        case 'U':
11655
1.54k
    if ((given & 0xf0) == 0x60)
11656
686
      {
11657
686
        switch (given & 0xf)
11658
686
          {
11659
370
          case 0xf:
11660
370
      func (stream, dis_style_sub_mnemonic, "sy");
11661
370
      break;
11662
316
          default:
11663
316
      func (stream, dis_style_immediate, "#%d",
11664
316
            (int) given & 0xf);
11665
316
      break;
11666
686
          }
11667
686
      }
11668
859
    else
11669
859
      {
11670
859
        const char * opt = data_barrier_option (given & 0xf);
11671
859
        if (opt != NULL)
11672
395
          func (stream, dis_style_sub_mnemonic, "%s", opt);
11673
464
        else
11674
464
          func (stream, dis_style_immediate, "#%d",
11675
464
          (int) given & 0xf);
11676
859
       }
11677
1.54k
    break;
11678
11679
15.8k
        case 'C':
11680
15.8k
    if ((given & 0xff) == 0)
11681
1.05k
      {
11682
1.05k
        func (stream, dis_style_register, "%cPSR_",
11683
1.05k
        (given & 0x100000) ? 'S' : 'C');
11684
11685
1.05k
        if (given & 0x800)
11686
264
          func (stream, dis_style_register, "f");
11687
1.05k
        if (given & 0x400)
11688
380
          func (stream, dis_style_register, "s");
11689
1.05k
        if (given & 0x200)
11690
558
          func (stream, dis_style_register, "x");
11691
1.05k
        if (given & 0x100)
11692
734
          func (stream, dis_style_register, "c");
11693
1.05k
      }
11694
14.8k
    else if (is_v81m_architecture (info))
11695
4.16k
      func (stream, dis_style_register, "%s",
11696
4.16k
      psr_name (given & 0xff));
11697
11698
10.6k
    else if ((given & 0x20) == 0x20)
11699
9.33k
      {
11700
9.33k
        char const* name;
11701
9.33k
        unsigned sysm = (given & 0xf00) >> 8;
11702
11703
9.33k
        sysm |= (given & 0x30);
11704
9.33k
        sysm |= (given & 0x00100000) >> 14;
11705
9.33k
        name = banked_regname (sysm);
11706
11707
9.33k
        if (name != NULL)
11708
7.41k
          func (stream, dis_style_register, "%s", name);
11709
1.92k
        else
11710
1.92k
          func (stream, dis_style_text,
11711
1.92k
          "(UNDEF: %lu)", (unsigned long) sysm);
11712
9.33k
      }
11713
1.31k
    else
11714
1.31k
      {
11715
1.31k
        func (stream, dis_style_register, "%s",
11716
1.31k
        psr_name (given & 0xff));
11717
1.31k
      }
11718
15.8k
    break;
11719
11720
21.2k
        case 'D':
11721
21.2k
    if (is_v81m_architecture (info))
11722
8.22k
      func (stream, dis_style_register, "%s",
11723
8.22k
      psr_name (given & 0xff));
11724
13.0k
    else if (((given & 0xff) == 0)
11725
11.9k
       || ((given & 0x20) == 0x20))
11726
7.82k
      {
11727
7.82k
        char const* name;
11728
7.82k
        unsigned sm = (given & 0xf0000) >> 16;
11729
11730
7.82k
        sm |= (given & 0x30);
11731
7.82k
        sm |= (given & 0x00100000) >> 14;
11732
7.82k
        name = banked_regname (sm);
11733
11734
7.82k
        if (name != NULL)
11735
6.53k
          func (stream, dis_style_register, "%s", name);
11736
1.29k
        else
11737
1.29k
          func (stream, dis_style_text,
11738
1.29k
          "(UNDEF: %lu)", (unsigned long) sm);
11739
7.82k
      }
11740
5.23k
    else
11741
5.23k
      func (stream, dis_style_register, "%s",
11742
5.23k
      psr_name (given & 0xff));
11743
21.2k
    break;
11744
11745
530k
        case '0': case '1': case '2': case '3': case '4':
11746
590k
        case '5': case '6': case '7': case '8': case '9':
11747
590k
    {
11748
590k
      int width;
11749
590k
      unsigned long val;
11750
11751
590k
      c = arm_decode_bitfield (c, given, &val, &width);
11752
11753
590k
      switch (*c)
11754
590k
        {
11755
1.09k
        case 's':
11756
1.09k
          if (val <= 3)
11757
1.09k
      func (stream, dis_style_mnemonic, "%s",
11758
1.09k
            mve_vec_sizename[val]);
11759
0
          else
11760
0
      func (stream, dis_style_text, "<undef size>");
11761
1.09k
          break;
11762
11763
791
        case 'd':
11764
791
          func (stream, base_style, "%lu", val);
11765
791
          value_in_comment = val;
11766
791
          break;
11767
11768
2.14k
        case 'D':
11769
2.14k
          func (stream, dis_style_immediate, "%lu", val + 1);
11770
2.14k
          value_in_comment = val + 1;
11771
2.14k
          break;
11772
11773
9.42k
        case 'W':
11774
9.42k
          func (stream, dis_style_immediate, "%lu", val * 4);
11775
9.42k
          value_in_comment = val * 4;
11776
9.42k
          break;
11777
11778
1.16k
        case 'S':
11779
1.16k
          if (val == 13)
11780
710
      is_unpredictable = true;
11781
          /* Fall through.  */
11782
7.11k
        case 'R':
11783
7.11k
          if (val == 15)
11784
1.36k
      is_unpredictable = true;
11785
          /* Fall through.  */
11786
151k
        case 'r':
11787
151k
          func (stream, dis_style_register, "%s",
11788
151k
          arm_regnames[val]);
11789
151k
          break;
11790
11791
11.5k
        case 'c':
11792
11.5k
          func (stream, base_style, "%s", arm_conditional[val]);
11793
11.5k
          break;
11794
11795
26.8k
        case '\'':
11796
26.8k
          c++;
11797
26.8k
          if (val == ((1ul << width) - 1))
11798
13.5k
      func (stream, base_style, "%c", *c);
11799
26.8k
          break;
11800
11801
9.20k
        case '`':
11802
9.20k
          c++;
11803
9.20k
          if (val == 0)
11804
1.39k
      func (stream, dis_style_immediate, "%c", *c);
11805
9.20k
          break;
11806
11807
1.69k
        case '?':
11808
1.69k
          func (stream, dis_style_mnemonic, "%c",
11809
1.69k
          c[(1 << width) - (int) val]);
11810
1.69k
          c += 1 << width;
11811
1.69k
          break;
11812
11813
375k
        case 'x':
11814
375k
          func (stream, dis_style_immediate, "0x%lx",
11815
375k
          val & 0xffffffffUL);
11816
375k
          break;
11817
11818
0
        default:
11819
0
          abort ();
11820
590k
        }
11821
590k
    }
11822
590k
    break;
11823
11824
590k
        case 'L':
11825
    /* PR binutils/12534
11826
       If we have a PC relative offset in an LDRD or STRD
11827
       instructions then display the decoded address.  */
11828
9.20k
    if (((given >> 16) & 0xf) == 0xf)
11829
2.24k
      {
11830
2.24k
        bfd_vma offset = (given & 0xff) * 4;
11831
11832
2.24k
        if ((given & (1 << 23)) == 0)
11833
444
          offset = - offset;
11834
2.24k
        func (stream, dis_style_comment_start, "\t@ ");
11835
2.24k
        info->print_address_func ((pc & ~3) + 4 + offset, info);
11836
2.24k
      }
11837
9.20k
    break;
11838
11839
0
        default:
11840
0
    abort ();
11841
989k
        }
11842
989k
    }
11843
11844
533k
  if (value_in_comment > 32 || value_in_comment < -16)
11845
31.8k
    func (stream, dis_style_comment_start, "\t@ 0x%lx",
11846
31.8k
    value_in_comment);
11847
11848
533k
  if (is_unpredictable)
11849
1.81k
    func (stream, dis_style_comment_start, UNPREDICTABLE_INSTRUCTION);
11850
11851
533k
  return;
11852
533k
      }
11853
11854
  /* No match.  */
11855
0
  func (stream, dis_style_comment_start, UNKNOWN_INSTRUCTION_32BIT,
11856
0
  (unsigned) given);
11857
0
  return;
11858
533k
}
11859
11860
/* Print data bytes on INFO->STREAM.  */
11861
11862
static void
11863
print_insn_data (bfd_vma pc ATTRIBUTE_UNUSED,
11864
     struct disassemble_info *info,
11865
     long given)
11866
0
{
11867
0
  fprintf_styled_ftype func = info->fprintf_styled_func;
11868
11869
0
  switch (info->bytes_per_chunk)
11870
0
    {
11871
0
    case 1:
11872
0
      func (info->stream, dis_style_assembler_directive, ".byte");
11873
0
      func (info->stream, dis_style_text, "\t");
11874
0
      func (info->stream, dis_style_immediate, "0x%02lx", given);
11875
0
      break;
11876
0
    case 2:
11877
0
      func (info->stream, dis_style_assembler_directive, ".short");
11878
0
      func (info->stream, dis_style_text, "\t");
11879
0
      func (info->stream, dis_style_immediate, "0x%04lx", given);
11880
0
      break;
11881
0
    case 4:
11882
0
      func (info->stream, dis_style_assembler_directive, ".word");
11883
0
      func (info->stream, dis_style_text, "\t");
11884
0
      func (info->stream, dis_style_immediate, "0x%08lx", given);
11885
0
      break;
11886
0
    default:
11887
0
      abort ();
11888
0
    }
11889
0
}
11890
11891
/* Disallow mapping symbols ($a, $b, $d, $t etc) from
11892
   being displayed in symbol relative addresses.
11893
11894
   Also disallow private symbol, with __tagsym$$ prefix,
11895
   from ARM RVCT toolchain being displayed.  */
11896
11897
bool
11898
arm_symbol_is_valid (asymbol * sym,
11899
         struct disassemble_info * info ATTRIBUTE_UNUSED)
11900
5.97k
{
11901
5.97k
  const char * name;
11902
11903
5.97k
  if (sym == NULL)
11904
0
    return false;
11905
11906
5.97k
  name = bfd_asymbol_name (sym);
11907
11908
5.97k
  return (name && *name != '$' && strncmp (name, "__tagsym$$", 10));
11909
5.97k
}
11910
11911
/* Parse a disassembler option.  */
11912
11913
static bool
11914
arm_parse_option (const char *opt, void *data ATTRIBUTE_UNUSED)
11915
20.5k
{
11916
20.5k
  if (startswith (opt, "reg-names-"))
11917
456
    {
11918
456
      unsigned int i;
11919
4.31k
      for (i = 0; i < NUM_ARM_OPTIONS; i++)
11920
3.89k
  if (strcmp (opt, regnames[i].name) == 0)
11921
38
    {
11922
38
      regname_selected = i;
11923
38
      break;
11924
38
    }
11925
11926
456
      if (i >= NUM_ARM_OPTIONS)
11927
  /* xgettext: c-format */
11928
418
  opcodes_error_handler (_("unrecognised register name set: %s"),
11929
418
             opt);
11930
456
    }
11931
20.1k
  else if (startswith (opt, "force-thumb"))
11932
3.03k
    force_thumb = 1;
11933
17.0k
  else if (startswith (opt, "no-force-thumb"))
11934
50
    force_thumb = 0;
11935
17.0k
  else if (startswith (opt, "coproc"))
11936
642
    {
11937
642
      const char *procptr = opt + sizeof ("coproc") - 1;
11938
642
      char *endptr;
11939
642
      uint8_t coproc_number = strtol (procptr, &endptr, 10);
11940
642
      if (endptr != procptr + 1 || coproc_number > 7)
11941
162
  opcodes_error_handler (_("cde coprocessor not between 0-7: %s"),
11942
162
             opt);
11943
480
      else if (*endptr != '=')
11944
82
  opcodes_error_handler (_("coproc must have an argument: %s"),
11945
82
             opt);
11946
398
      else
11947
398
  {
11948
398
    endptr += 1;
11949
398
    if (startswith (endptr, "generic"))
11950
22
      cde_coprocs &= ~(1 << coproc_number);
11951
376
    else if (startswith (endptr, "cde")
11952
354
       || startswith (endptr, "CDE"))
11953
116
      cde_coprocs |= (1 << coproc_number);
11954
260
    else
11955
260
      opcodes_error_handler
11956
260
        (_("coprocN argument takes options \"generic\","
11957
260
     " \"cde\", or \"CDE\": %s"), opt);
11958
398
  }
11959
642
    }
11960
16.3k
  else
11961
    /* xgettext: c-format */
11962
16.3k
    opcodes_error_handler (_("unrecognised disassembler option: %s"), opt);
11963
20.5k
  return true;
11964
20.5k
}
11965
11966
static bool
11967
mapping_symbol_for_insn (bfd_vma pc, struct disassemble_info *info,
11968
       enum map_type *map_symbol);
11969
11970
/* Search back through the insn stream to determine if this instruction is
11971
   conditionally executed.  */
11972
11973
static void
11974
find_ifthen_state (bfd_vma pc,
11975
       struct disassemble_info *info,
11976
       bool little)
11977
14.7k
{
11978
14.7k
  unsigned char b[2];
11979
14.7k
  unsigned int insn;
11980
14.7k
  int status;
11981
  /* COUNT is twice the number of instructions seen.  It will be odd if we
11982
     just crossed an instruction boundary.  */
11983
14.7k
  int count;
11984
14.7k
  int it_count;
11985
14.7k
  unsigned int seen_it;
11986
14.7k
  bfd_vma addr;
11987
11988
14.7k
  ifthen_address = pc;
11989
14.7k
  ifthen_state = 0;
11990
11991
14.7k
  addr = pc;
11992
14.7k
  count = 1;
11993
14.7k
  it_count = 0;
11994
14.7k
  seen_it = 0;
11995
  /* Scan backwards looking for IT instructions, keeping track of where
11996
     instruction boundaries are.  We don't know if something is actually an
11997
     IT instruction until we find a definite instruction boundary.  */
11998
14.7k
  for (;;)
11999
16.4k
    {
12000
16.4k
      if (addr == 0 || info->symbol_at_address_func (addr, info))
12001
44
  {
12002
    /* A symbol must be on an instruction boundary, and will not
12003
       be within an IT block.  */
12004
44
    if (seen_it && (count & 1))
12005
0
      break;
12006
12007
44
    return;
12008
44
  }
12009
16.4k
      addr -= 2;
12010
16.4k
      status = info->read_memory_func (addr, (bfd_byte *) b, 2, info);
12011
16.4k
      if (status)
12012
14.0k
  return;
12013
12014
2.33k
      if (little)
12015
2.33k
  insn = (b[0]) | (b[1] << 8);
12016
0
      else
12017
0
  insn = (b[1]) | (b[0] << 8);
12018
2.33k
      if (seen_it)
12019
0
  {
12020
0
    if ((insn & 0xf800) < 0xe800)
12021
0
      {
12022
        /* Addr + 2 is an instruction boundary.  See if this matches
12023
           the expected boundary based on the position of the last
12024
     IT candidate.  */
12025
0
        if (count & 1)
12026
0
    break;
12027
0
        seen_it = 0;
12028
0
      }
12029
0
  }
12030
2.33k
      if ((insn & 0xff00) == 0xbf00 && (insn & 0xf) != 0)
12031
0
  {
12032
0
    enum map_type type = MAP_ARM;
12033
0
    bool found = mapping_symbol_for_insn (addr, info, &type);
12034
12035
0
    if (!found || (found && type == MAP_THUMB))
12036
0
      {
12037
        /* This could be an IT instruction.  */
12038
0
        seen_it = insn;
12039
0
        it_count = count >> 1;
12040
0
      }
12041
0
  }
12042
2.33k
      if ((insn & 0xf800) >= 0xe800)
12043
0
  count++;
12044
2.33k
      else
12045
2.33k
  count = (count + 2) | 1;
12046
      /* IT blocks contain at most 4 instructions.  */
12047
2.33k
      if (count >= 8 && !seen_it)
12048
583
  return;
12049
2.33k
    }
12050
  /* We found an IT instruction.  */
12051
0
  ifthen_state = (seen_it & 0xe0) | ((seen_it << it_count) & 0x1f);
12052
0
  if ((ifthen_state & 0xf) == 0)
12053
0
    ifthen_state = 0;
12054
0
}
12055
12056
/* Returns nonzero and sets *MAP_TYPE if the N'th symbol is a
12057
   mapping symbol.  */
12058
12059
static int
12060
is_mapping_symbol (struct disassemble_info *info,
12061
       int n,
12062
       enum map_type *map_type)
12063
63.0k
{
12064
63.0k
  const char *name = bfd_asymbol_name (info->symtab[n]);
12065
12066
63.0k
  if (name[0] == '$'
12067
0
      && (name[1] == 'a' || name[1] == 't' || name[1] == 'd')
12068
0
      && (name[2] == 0 || name[2] == '.'))
12069
0
    {
12070
0
      *map_type = ((name[1] == 'a') ? MAP_ARM
12071
0
       : (name[1] == 't') ? MAP_THUMB
12072
0
       : MAP_DATA);
12073
0
      return true;
12074
0
    }
12075
12076
63.0k
  return false;
12077
63.0k
}
12078
12079
/* Try to infer the code type (ARM or Thumb) from a mapping symbol.
12080
   Returns nonzero if *MAP_TYPE was set.  */
12081
12082
static int
12083
get_map_sym_type (struct disassemble_info *info,
12084
      int n,
12085
      enum map_type *map_type)
12086
64.2k
{
12087
  /* If the symbol is in a different section, ignore it.  */
12088
64.2k
  if (info->section != NULL && info->section != info->symtab[n]->section)
12089
1.28k
    return false;
12090
12091
63.0k
  return is_mapping_symbol (info, n, map_type);
12092
64.2k
}
12093
12094
/* Try to infer the code type (ARM or Thumb) from a non-mapping symbol.
12095
   Returns nonzero if *MAP_TYPE was set.  */
12096
12097
static int
12098
get_sym_code_type (struct disassemble_info *info,
12099
       int n,
12100
       enum map_type *map_type)
12101
31.5k
{
12102
31.5k
  elf_symbol_type *es;
12103
31.5k
  unsigned int type;
12104
31.5k
  asymbol * sym;
12105
12106
  /* If the symbol is in a different section, ignore it.  */
12107
31.5k
  if (info->section != NULL && info->section != info->symtab[n]->section)
12108
0
    return false;
12109
12110
  /* PR 30230: Reject non-ELF symbols, eg synthetic ones.  */
12111
31.5k
  sym = info->symtab[n];
12112
31.5k
  if (bfd_asymbol_flavour (sym) != bfd_target_elf_flavour)
12113
0
    return false;
12114
12115
31.5k
  es = (elf_symbol_type *) sym;
12116
31.5k
  type = ELF_ST_TYPE (es->internal_elf_sym.st_info);
12117
12118
  /* If the symbol has function type then use that.  */
12119
31.5k
  if (type == STT_FUNC || type == STT_GNU_IFUNC)
12120
31.5k
    {
12121
31.5k
      if (ARM_GET_SYM_BRANCH_TYPE (es->internal_elf_sym.st_target_internal)
12122
31.5k
    == ST_BRANCH_TO_THUMB)
12123
31.4k
  *map_type = MAP_THUMB;
12124
28
      else
12125
28
  *map_type = MAP_ARM;
12126
31.5k
      return true;
12127
31.5k
    }
12128
12129
0
  return false;
12130
31.5k
}
12131
12132
/* Search the mapping symbol state for instruction at pc.  This is only
12133
   applicable for elf target.
12134
12135
   There is an assumption Here, info->private_data contains the correct AND
12136
   up-to-date information about current scan process.  The information will be
12137
   used to speed this search process.
12138
12139
   Return TRUE if the mapping state can be determined, and map_symbol
12140
   will be updated accordingly.  Otherwise, return FALSE.  */
12141
12142
static bool
12143
mapping_symbol_for_insn (bfd_vma pc, struct disassemble_info *info,
12144
       enum map_type *map_symbol)
12145
32.6k
{
12146
32.6k
  bfd_vma addr, section_vma = 0;
12147
32.6k
  int n, last_sym = -1;
12148
32.6k
  bool found = false;
12149
32.6k
  bool can_use_search_opt_p = false;
12150
12151
  /* Sanity check.  */
12152
32.6k
  if (info == NULL)
12153
0
    return false;
12154
12155
  /* Default to DATA.  A text section is required by the ABI to contain an
12156
     INSN mapping symbol at the start.  A data section has no such
12157
     requirement, hence if no mapping symbol is found the section must
12158
     contain only data.  This however isn't very useful if the user has
12159
     fully stripped the binaries.  If this is the case use the section
12160
     attributes to determine the default.  If we have no section default to
12161
     INSN as well, as we may be disassembling some raw bytes on a baremetal
12162
     HEX file or similar.  */
12163
32.6k
  enum map_type type = MAP_DATA;
12164
32.6k
  if ((info->section && info->section->flags & SEC_CODE) || !info->section)
12165
31.6k
    type = MAP_ARM;
12166
32.6k
  struct arm_private_data *private_data;
12167
12168
32.6k
  if (info->private_data == NULL || info->symtab == NULL
12169
32.6k
      || info->symtab_size == 0
12170
32.6k
      || bfd_asymbol_flavour (*info->symtab) != bfd_target_elf_flavour)
12171
0
    return false;
12172
12173
32.6k
  private_data = info->private_data;
12174
12175
  /* First, look for mapping symbols.  */
12176
32.6k
  if (pc <= private_data->last_mapping_addr)
12177
107
    private_data->last_mapping_sym = -1;
12178
12179
  /* Start scanning at the start of the function, or wherever
12180
     we finished last time.  */
12181
32.6k
  n = info->symtab_pos + 1;
12182
12183
  /* If the last stop offset is different from the current one it means we
12184
     are disassembling a different glob of bytes.  As such the optimization
12185
     would not be safe and we should start over.  */
12186
32.6k
  can_use_search_opt_p
12187
32.6k
    = (private_data->last_mapping_sym >= 0
12188
31.4k
       && info->stop_offset == private_data->last_stop_offset);
12189
12190
32.6k
  if (n >= private_data->last_mapping_sym && can_use_search_opt_p)
12191
31.4k
    n = private_data->last_mapping_sym;
12192
12193
  /* Look down while we haven't passed the location being disassembled.
12194
     The reason for this is that there's no defined order between a symbol
12195
     and an mapping symbol that may be at the same address.  We may have to
12196
     look at least one position ahead.  */
12197
65.4k
  for (; n < info->symtab_size; n++)
12198
33.0k
    {
12199
33.0k
      addr = bfd_asymbol_value (info->symtab[n]);
12200
33.0k
      if (addr > pc)
12201
244
  break;
12202
32.7k
      if (get_map_sym_type (info, n, &type))
12203
0
  {
12204
0
    last_sym = n;
12205
0
    found = true;
12206
0
  }
12207
32.7k
    }
12208
12209
32.6k
  if (!found)
12210
32.6k
    {
12211
32.6k
      n = info->symtab_pos;
12212
32.6k
      if (n >= private_data->last_mapping_sym && can_use_search_opt_p)
12213
31.4k
  n = private_data->last_mapping_sym;
12214
12215
      /* No mapping symbol found at this address.  Look backwards
12216
   for a preceeding one, but don't go pass the section start
12217
   otherwise a data section with no mapping symbol can pick up
12218
   a text mapping symbol of a preceeding section.  The documentation
12219
   says section can be NULL, in which case we will seek up all the
12220
   way to the top.  */
12221
32.6k
      if (info->section)
12222
32.6k
  section_vma = info->section->vma;
12223
12224
64.1k
      for (; n >= 0; n--)
12225
31.5k
  {
12226
31.5k
    addr = bfd_asymbol_value (info->symtab[n]);
12227
31.5k
    if (addr < section_vma)
12228
0
      break;
12229
12230
31.5k
    if (get_map_sym_type (info, n, &type))
12231
0
      {
12232
0
        last_sym = n;
12233
0
        found = true;
12234
0
        break;
12235
0
      }
12236
31.5k
  }
12237
32.6k
    }
12238
12239
  /* If no mapping symbol was found, try looking up without a mapping
12240
     symbol.  This is done by walking up from the current PC to the nearest
12241
     symbol.  We don't actually have to loop here since symtab_pos will
12242
     contain the nearest symbol already.  */
12243
32.6k
  if (!found)
12244
32.6k
    {
12245
32.6k
      n = info->symtab_pos;
12246
32.6k
      if (n >= 0 && get_sym_code_type (info, n, &type))
12247
31.5k
  {
12248
31.5k
    last_sym = n;
12249
31.5k
    found = true;
12250
31.5k
  }
12251
32.6k
    }
12252
12253
32.6k
  private_data->last_mapping_sym = last_sym;
12254
32.6k
  private_data->last_type = type;
12255
32.6k
  private_data->last_stop_offset = info->stop_offset;
12256
12257
32.6k
  *map_symbol = type;
12258
32.6k
  return found;
12259
32.6k
}
12260
12261
/* Given a bfd_mach_arm_XXX value, this function fills in the fields
12262
   of the supplied arm_feature_set structure with bitmasks indicating
12263
   the supported base architectures and coprocessor extensions.
12264
12265
   FIXME: This could more efficiently implemented as a constant array,
12266
   although it would also be less robust.  */
12267
12268
static void
12269
select_arm_features (unsigned long mach,
12270
         arm_feature_set * features)
12271
18.1k
{
12272
18.1k
  arm_feature_set arch_fset;
12273
18.1k
  const arm_feature_set fpu_any = FPU_ANY;
12274
12275
18.1k
#undef ARM_SET_FEATURES
12276
18.1k
#define ARM_SET_FEATURES(FSET) \
12277
18.1k
  {             \
12278
18.1k
    const arm_feature_set fset = FSET;      \
12279
18.1k
    arch_fset = fset;         \
12280
18.1k
  }
12281
12282
  /* When several architecture versions share the same bfd_mach_arm_XXX value
12283
     the most featureful is chosen.  */
12284
18.1k
  switch (mach)
12285
18.1k
    {
12286
339
    case bfd_mach_arm_2:  ARM_SET_FEATURES (ARM_ARCH_V2); break;
12287
91
    case bfd_mach_arm_2a:  ARM_SET_FEATURES (ARM_ARCH_V2S); break;
12288
180
    case bfd_mach_arm_3:  ARM_SET_FEATURES (ARM_ARCH_V3); break;
12289
684
    case bfd_mach_arm_3M:  ARM_SET_FEATURES (ARM_ARCH_V3M); break;
12290
165
    case bfd_mach_arm_4:  ARM_SET_FEATURES (ARM_ARCH_V4); break;
12291
0
    case bfd_mach_arm_ep9312:
12292
43
    case bfd_mach_arm_4T:  ARM_SET_FEATURES (ARM_ARCH_V4T); break;
12293
217
    case bfd_mach_arm_5:  ARM_SET_FEATURES (ARM_ARCH_V5); break;
12294
191
    case bfd_mach_arm_5T:  ARM_SET_FEATURES (ARM_ARCH_V5T); break;
12295
153
    case bfd_mach_arm_5TE:  ARM_SET_FEATURES (ARM_ARCH_V5TE); break;
12296
287
    case bfd_mach_arm_XScale:  ARM_SET_FEATURES (ARM_ARCH_XSCALE); break;
12297
381
    case bfd_mach_arm_iWMMXt:  ARM_SET_FEATURES (ARM_ARCH_IWMMXT); break;
12298
529
    case bfd_mach_arm_iWMMXt2:  ARM_SET_FEATURES (ARM_ARCH_IWMMXT2); break;
12299
43
    case bfd_mach_arm_5TEJ:  ARM_SET_FEATURES (ARM_ARCH_V5TEJ); break;
12300
77
    case bfd_mach_arm_6:  ARM_SET_FEATURES (ARM_ARCH_V6); break;
12301
125
    case bfd_mach_arm_6KZ:  ARM_SET_FEATURES (ARM_ARCH_V6KZ); break;
12302
74
    case bfd_mach_arm_6T2:  ARM_SET_FEATURES (ARM_ARCH_V6KZT2); break;
12303
56
    case bfd_mach_arm_6K:  ARM_SET_FEATURES (ARM_ARCH_V6K); break;
12304
98
    case bfd_mach_arm_7:  ARM_SET_FEATURES (ARM_ARCH_V7VE); break;
12305
94
    case bfd_mach_arm_6M:  ARM_SET_FEATURES (ARM_ARCH_V6M); break;
12306
73
    case bfd_mach_arm_6SM:  ARM_SET_FEATURES (ARM_ARCH_V6SM); break;
12307
130
    case bfd_mach_arm_7EM:  ARM_SET_FEATURES (ARM_ARCH_V7EM); break;
12308
29
    case bfd_mach_arm_8A:
12309
29
  {
12310
    /* Add bits for extensions that Armv8.6-A recognizes.  */
12311
29
    arm_feature_set armv8_6_ext_fset
12312
29
      = ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST);
12313
29
    ARM_SET_FEATURES (ARM_ARCH_V8_6A);
12314
29
    ARM_MERGE_FEATURE_SETS (arch_fset, arch_fset, armv8_6_ext_fset);
12315
29
    break;
12316
0
  }
12317
59
    case bfd_mach_arm_8R:  ARM_SET_FEATURES (ARM_ARCH_V8R_CRC); break;
12318
89
    case bfd_mach_arm_8M_BASE:  ARM_SET_FEATURES (ARM_ARCH_V8M_BASE); break;
12319
37
    case bfd_mach_arm_8M_MAIN:  ARM_SET_FEATURES (ARM_ARCH_V8M_MAIN); break;
12320
10.1k
    case bfd_mach_arm_8_1M_MAIN:
12321
10.1k
      ARM_SET_FEATURES (ARM_ARCH_V8_1M_MAIN);
12322
10.1k
      arm_feature_set mve_all
12323
10.1k
  = ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE | ARM_EXT2_MVE_FP);
12324
10.1k
      ARM_MERGE_FEATURE_SETS (arch_fset, arch_fset, mve_all);
12325
10.1k
      force_thumb = 1;
12326
10.1k
      break;
12327
74
    case bfd_mach_arm_9A:         ARM_SET_FEATURES (ARM_ARCH_V9A); break;
12328
      /* If the machine type is unknown allow all architecture types and all
12329
   extensions, with the exception of MVE as that clashes with NEON.  */
12330
3.70k
    case bfd_mach_arm_unknown:
12331
3.70k
      ARM_SET_FEATURES (ARM_ARCH_UNKNOWN);
12332
3.70k
      break;
12333
0
    default:
12334
0
      abort ();
12335
18.1k
    }
12336
18.1k
#undef ARM_SET_FEATURES
12337
12338
  /* None of the feature bits related to -mfpu have an impact on Tag_CPU_arch
12339
     and thus on bfd_mach_arm_XXX value.  Therefore for a given
12340
     bfd_mach_arm_XXX value all coprocessor feature bits should be allowed.  */
12341
18.1k
  ARM_MERGE_FEATURE_SETS (*features, arch_fset, fpu_any);
12342
18.1k
}
12343
12344
12345
/* NOTE: There are no checks in these routines that
12346
   the relevant number of data bytes exist.  */
12347
12348
static int
12349
print_insn (bfd_vma pc, struct disassemble_info *info, bool little)
12350
7.80M
{
12351
7.80M
  unsigned char b[4];
12352
7.80M
  unsigned long given;
12353
7.80M
  int status;
12354
7.80M
  int is_thumb = false;
12355
7.80M
  int is_data = false;
12356
7.80M
  int little_code;
12357
7.80M
  unsigned int  size = 4;
12358
7.80M
  void (*printer) (bfd_vma, struct disassemble_info *, long);
12359
7.80M
  bool found = false;
12360
7.80M
  struct arm_private_data *private_data;
12361
12362
  /* Clear instruction information field.  */
12363
7.80M
  info->insn_info_valid = 0;
12364
7.80M
  info->branch_delay_insns = 0;
12365
7.80M
  info->data_size = 0;
12366
7.80M
  info->insn_type = dis_noninsn;
12367
7.80M
  info->target = 0;
12368
7.80M
  info->target2 = 0;
12369
12370
7.80M
  if (info->disassembler_options)
12371
14.2k
    {
12372
14.2k
      force_thumb = false;
12373
14.2k
      for_each_disassembler_option (info, arm_parse_option, NULL);
12374
12375
      /* To avoid repeated parsing of these options, we remove them here.  */
12376
14.2k
      info->disassembler_options = NULL;
12377
14.2k
    }
12378
12379
  /* PR 10288: Control which instructions will be disassembled.  */
12380
7.80M
  if (info->private_data == NULL)
12381
18.1k
    {
12382
18.1k
      static struct arm_private_data private;
12383
12384
18.1k
      if (info->flavour != bfd_target_elf_flavour
12385
17.5k
    && (info->flags & USER_SPECIFIED_MACHINE_TYPE) == 0)
12386
  /* If the user did not use the -m command line switch then default to
12387
     disassembling all types of ARM instruction.
12388
12389
     If this is an arm elf target, build attributes will be used to
12390
     determine info->mach, which enable us to be more accurate when
12391
     disassembling since we know what the target architecture version is.
12392
     For any other target see the comment below:
12393
12394
     The info->mach value has to be ignored as this will be based on
12395
     the default archictecture for the target and/or hints in the notes
12396
     section, but it will never be greater than the current largest arm
12397
     machine value (iWMMXt2), which is only equivalent to the V5TE
12398
     architecture.  ARM architectures have advanced beyond the machine
12399
     value encoding, and these newer architectures would be ignored if
12400
     the machine value was used.
12401
12402
     Ie the -m switch is used to restrict which instructions will be
12403
     disassembled.  If it is necessary to use the -m switch to tell
12404
     objdump that an ARM binary is being disassembled, eg because the
12405
     input is a raw binary file, but it is also desired to disassemble
12406
     all ARM instructions then use "-marm".  This will select the
12407
     "unknown" arm architecture which is compatible with any ARM
12408
     instruction.  */
12409
145
    info->mach = bfd_mach_arm_unknown;
12410
12411
      /* Compute the architecture bitmask from the machine number.
12412
   Note: This assumes that the machine number will not change
12413
   during disassembly....  */
12414
18.1k
      select_arm_features (info->mach, & private.features);
12415
12416
18.1k
      private.last_mapping_sym = -1;
12417
18.1k
      private.last_mapping_addr = 0;
12418
18.1k
      private.last_stop_offset = 0;
12419
12420
18.1k
      info->private_data = & private;
12421
18.1k
    }
12422
12423
7.80M
  private_data = info->private_data;
12424
12425
  /* Decide if our code is going to be little-endian, despite what the
12426
     function argument might say.  */
12427
7.80M
  little_code = ((info->endian_code == BFD_ENDIAN_LITTLE) || little);
12428
12429
  /* For ELF, consult the symbol table to determine what kind of code
12430
     or data we have.  */
12431
7.80M
  if (info->symtab_size != 0
12432
35.2k
      && bfd_asymbol_flavour (*info->symtab) == bfd_target_elf_flavour)
12433
32.6k
    {
12434
32.6k
      bfd_vma addr;
12435
32.6k
      int n;
12436
32.6k
      int last_sym = -1;
12437
32.6k
      enum map_type type = MAP_ARM;
12438
12439
32.6k
      found = mapping_symbol_for_insn (pc, info, &type);
12440
32.6k
      last_sym = private_data->last_mapping_sym;
12441
12442
32.6k
      is_thumb = (private_data->last_type == MAP_THUMB);
12443
32.6k
      is_data = (private_data->last_type == MAP_DATA);
12444
12445
      /* Look a little bit ahead to see if we should print out
12446
   two or four bytes of data.  If there's a symbol,
12447
   mapping or otherwise, after two bytes then don't
12448
   print more.  */
12449
32.6k
      if (is_data)
12450
989
  {
12451
989
    size = 4 - (pc & 3);
12452
2.32k
    for (n = last_sym + 1; n < info->symtab_size; n++)
12453
1.33k
      {
12454
1.33k
        addr = bfd_asymbol_value (info->symtab[n]);
12455
1.33k
        if (addr > pc
12456
102
      && (info->section == NULL
12457
102
          || info->section == info->symtab[n]->section))
12458
0
    {
12459
0
      if (addr - pc < size)
12460
0
        size = addr - pc;
12461
0
      break;
12462
0
    }
12463
1.33k
      }
12464
    /* If the next symbol is after three bytes, we need to
12465
       print only part of the data, so that we can use either
12466
       .byte or .short.  */
12467
989
    if (size == 3)
12468
0
      size = (pc & 1) ? 1 : 2;
12469
989
  }
12470
32.6k
    }
12471
12472
7.80M
  if (info->symbols != NULL)
12473
31.5k
    {
12474
31.5k
      if (bfd_asymbol_flavour (*info->symbols) == bfd_target_coff_flavour)
12475
0
  {
12476
0
    coff_symbol_type * cs;
12477
12478
0
    cs = coffsymbol (*info->symbols);
12479
0
    is_thumb = (   cs->native->u.syment.n_sclass == C_THUMBEXT
12480
0
          || cs->native->u.syment.n_sclass == C_THUMBSTAT
12481
0
          || cs->native->u.syment.n_sclass == C_THUMBLABEL
12482
0
          || cs->native->u.syment.n_sclass == C_THUMBEXTFUNC
12483
0
          || cs->native->u.syment.n_sclass == C_THUMBSTATFUNC);
12484
0
  }
12485
31.5k
      else if (bfd_asymbol_flavour (*info->symbols) == bfd_target_elf_flavour
12486
31.5k
         && !found)
12487
0
  {
12488
    /* If no mapping symbol has been found then fall back to the type
12489
       of the function symbol.  */
12490
0
    elf_symbol_type *  es;
12491
0
    unsigned int       type;
12492
12493
0
    es = *(elf_symbol_type **)(info->symbols);
12494
0
    type = ELF_ST_TYPE (es->internal_elf_sym.st_info);
12495
12496
0
    is_thumb =
12497
0
      ((ARM_GET_SYM_BRANCH_TYPE (es->internal_elf_sym.st_target_internal)
12498
0
        == ST_BRANCH_TO_THUMB) || type == STT_ARM_16BIT);
12499
0
  }
12500
31.5k
      else if (bfd_asymbol_flavour (*info->symbols)
12501
31.5k
         == bfd_target_mach_o_flavour)
12502
0
  {
12503
0
    bfd_mach_o_asymbol *asym = (bfd_mach_o_asymbol *)*info->symbols;
12504
12505
0
    is_thumb = (asym->n_desc & BFD_MACH_O_N_ARM_THUMB_DEF);
12506
0
  }
12507
31.5k
    }
12508
12509
7.80M
  if (force_thumb)
12510
3.90M
    is_thumb = true;
12511
12512
7.80M
  if (is_data)
12513
989
    info->display_endian = little ? BFD_ENDIAN_LITTLE : BFD_ENDIAN_BIG;
12514
7.80M
  else
12515
7.80M
    info->display_endian = little_code ? BFD_ENDIAN_LITTLE : BFD_ENDIAN_BIG;
12516
12517
7.80M
  info->bytes_per_line = 4;
12518
12519
  /* PR 10263: Disassemble data if requested to do so by the user.  */
12520
7.80M
  if (is_data && ((info->flags & DISASSEMBLE_DATA) == 0))
12521
0
    {
12522
0
      int i;
12523
12524
      /* Size was already set above.  */
12525
0
      info->bytes_per_chunk = size;
12526
0
      printer = print_insn_data;
12527
12528
0
      status = info->read_memory_func (pc, (bfd_byte *) b, size, info);
12529
0
      given = 0;
12530
0
      if (little)
12531
0
  for (i = size - 1; i >= 0; i--)
12532
0
    given = b[i] | (given << 8);
12533
0
      else
12534
0
  for (i = 0; i < (int) size; i++)
12535
0
    given = b[i] | (given << 8);
12536
0
    }
12537
7.80M
  else if (!is_thumb)
12538
3.87M
    {
12539
      /* In ARM mode endianness is a straightforward issue: the instruction
12540
   is four bytes long and is either ordered 0123 or 3210.  */
12541
3.87M
      printer = print_insn_arm;
12542
3.87M
      info->bytes_per_chunk = 4;
12543
3.87M
      size = 4;
12544
12545
3.87M
      status = info->read_memory_func (pc, (bfd_byte *) b, 4, info);
12546
3.87M
      if (little_code)
12547
2.78M
  given = (b[0]) | (b[1] << 8) | (b[2] << 16) | ((unsigned) b[3] << 24);
12548
1.09M
      else
12549
1.09M
  given = (b[3]) | (b[2] << 8) | (b[1] << 16) | ((unsigned) b[0] << 24);
12550
3.87M
    }
12551
3.93M
  else
12552
3.93M
    {
12553
      /* In Thumb mode we have the additional wrinkle of two
12554
   instruction lengths.  Fortunately, the bits that determine
12555
   the length of the current instruction are always to be found
12556
   in the first two bytes.  */
12557
3.93M
      printer = print_insn_thumb16;
12558
3.93M
      info->bytes_per_chunk = 2;
12559
3.93M
      size = 2;
12560
12561
3.93M
      status = info->read_memory_func (pc, (bfd_byte *) b, 2, info);
12562
3.93M
      if (little_code)
12563
3.68M
  given = (b[0]) | (b[1] << 8);
12564
251k
      else
12565
251k
  given = (b[1]) | (b[0] << 8);
12566
12567
3.93M
      if (!status)
12568
3.93M
  {
12569
    /* These bit patterns signal a four-byte Thumb
12570
       instruction.  */
12571
3.93M
    if ((given & 0xF800) == 0xF800
12572
3.41M
        || (given & 0xF800) == 0xF000
12573
3.28M
        || (given & 0xF800) == 0xE800)
12574
881k
      {
12575
881k
        status = info->read_memory_func (pc + 2, (bfd_byte *) b, 2, info);
12576
881k
        if (little_code)
12577
772k
    given = (b[0]) | (b[1] << 8) | (given << 16);
12578
109k
        else
12579
109k
    given = (b[1]) | (b[0] << 8) | (given << 16);
12580
12581
881k
        printer = print_insn_thumb32;
12582
881k
        size = 4;
12583
881k
      }
12584
3.93M
  }
12585
12586
3.93M
      if (ifthen_address != pc)
12587
14.7k
  find_ifthen_state (pc, info, little_code);
12588
12589
3.93M
      if (ifthen_state)
12590
129k
  {
12591
129k
    if ((ifthen_state & 0xf) == 0x8)
12592
26.6k
      ifthen_next_state = 0;
12593
102k
    else
12594
102k
      ifthen_next_state = (ifthen_state & 0xe0)
12595
102k
        | ((ifthen_state & 0xf) << 1);
12596
129k
  }
12597
3.93M
    }
12598
12599
7.80M
  if (status)
12600
8.15k
    {
12601
8.15k
      info->memory_error_func (status, pc, info);
12602
8.15k
      return -1;
12603
8.15k
    }
12604
7.80M
  if (info->flags & INSN_HAS_RELOC)
12605
    /* If the instruction has a reloc associated with it, then
12606
       the offset field in the instruction will actually be the
12607
       addend for the reloc.  (We are using REL type relocs).
12608
       In such cases, we can ignore the pc when computing
12609
       addresses, since the addend is not currently pc-relative.  */
12610
4
    pc = 0;
12611
12612
7.80M
  printer (pc, info, given);
12613
12614
7.80M
  if (is_thumb)
12615
3.92M
    {
12616
3.92M
      ifthen_state = ifthen_next_state;
12617
3.92M
      ifthen_address += size;
12618
3.92M
    }
12619
7.80M
  return size;
12620
7.80M
}
12621
12622
int
12623
print_insn_big_arm (bfd_vma pc, struct disassemble_info *info)
12624
1.43M
{
12625
  /* Detect BE8-ness and record it in the disassembler info.  */
12626
1.43M
  if (info->flavour == bfd_target_elf_flavour
12627
1.15M
      && info->section != NULL
12628
1.15M
      && (elf_elfheader (info->section->owner)->e_flags & EF_ARM_BE8))
12629
91.9k
    info->endian_code = BFD_ENDIAN_LITTLE;
12630
12631
1.43M
  return print_insn (pc, info, false);
12632
1.43M
}
12633
12634
int
12635
print_insn_little_arm (bfd_vma pc, struct disassemble_info *info)
12636
6.37M
{
12637
6.37M
  return print_insn (pc, info, true);
12638
6.37M
}
12639
12640
const disasm_options_and_args_t *
12641
disassembler_options_arm (void)
12642
0
{
12643
0
  static disasm_options_and_args_t *opts_and_args;
12644
12645
0
  if (opts_and_args == NULL)
12646
0
    {
12647
0
      disasm_options_t *opts;
12648
0
      unsigned int i;
12649
12650
0
      opts_and_args = XNEW (disasm_options_and_args_t);
12651
0
      opts_and_args->args = NULL;
12652
12653
0
      opts = &opts_and_args->options;
12654
0
      opts->name = XNEWVEC (const char *, NUM_ARM_OPTIONS + 1);
12655
0
      opts->description = XNEWVEC (const char *, NUM_ARM_OPTIONS + 1);
12656
0
      opts->arg = NULL;
12657
0
      for (i = 0; i < NUM_ARM_OPTIONS; i++)
12658
0
  {
12659
0
    opts->name[i] = regnames[i].name;
12660
0
    if (regnames[i].description != NULL)
12661
0
      opts->description[i] = _(regnames[i].description);
12662
0
    else
12663
0
      opts->description[i] = NULL;
12664
0
  }
12665
      /* The array we return must be NULL terminated.  */
12666
0
      opts->name[i] = NULL;
12667
0
      opts->description[i] = NULL;
12668
0
    }
12669
12670
0
  return opts_and_args;
12671
0
}
12672
12673
void
12674
print_arm_disassembler_options (FILE *stream)
12675
0
{
12676
0
  unsigned int i, max_len = 0;
12677
0
  fprintf (stream, _("\n\
12678
0
The following ARM specific disassembler options are supported for use with\n\
12679
0
the -M switch:\n"));
12680
12681
0
  for (i = 0; i < NUM_ARM_OPTIONS; i++)
12682
0
    {
12683
0
      unsigned int len = strlen (regnames[i].name);
12684
0
      if (max_len < len)
12685
0
  max_len = len;
12686
0
    }
12687
12688
0
  for (i = 0, max_len++; i < NUM_ARM_OPTIONS; i++)
12689
0
    fprintf (stream, "  %s%*c %s\n",
12690
0
       regnames[i].name,
12691
0
       (int)(max_len - strlen (regnames[i].name)), ' ',
12692
       _(regnames[i].description));
12693
0
}