Coverage Report

Created: 2026-11-21 09:00

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.24k
#define UNKNOWN_INSTRUCTION_32BIT  "\t\t@ <UNDEFINED> instruction: %08x"
456
0
#define UNKNOWN_INSTRUCTION_16BIT  "\t\t@ <UNDEFINED> instruction: %04x"
457
143k
#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.82k
#define NUM_ARM_OPTIONS   ARRAY_SIZE (regnames)
5029
13.6M
#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
5.47M
#define IFTHEN_COND ((ifthen_state >> 4) & 0xf)
5042
/* Indicates that the current Conditional state is unconditional or outside
5043
   an IT block.  */
5044
391M
#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
23.3k
{
5054
23.3k
  return ((given & 0x00400000) >> 19) | ((given & 0xe000) >> 13);
5055
23.3k
}
5056
5057
/* Return the number of instructions in a MVE predicate block.  */
5058
static long
5059
num_instructions_vpt_block (long given)
5060
5.41k
{
5061
5.41k
  long mask = mve_extract_pred_mask (given);
5062
5.41k
  if (mask == 0)
5063
0
    return 0;
5064
5065
5.41k
  if (mask == 8)
5066
1.33k
    return 1;
5067
5068
4.07k
  if ((mask & 7) == 4)
5069
1.24k
    return 2;
5070
5071
2.83k
  if ((mask & 3) == 2)
5072
799
    return 3;
5073
5074
2.03k
  if ((mask & 1) == 1)
5075
2.03k
    return 4;
5076
5077
0
  return 0;
5078
2.03k
}
5079
5080
static void
5081
mark_outside_vpt_block (void)
5082
5.41k
{
5083
5.41k
  vpt_block_state.in_vpt_block = false;
5084
5.41k
  vpt_block_state.next_pred_state = PRED_NONE;
5085
5.41k
  vpt_block_state.predicate_mask = 0;
5086
5.41k
  vpt_block_state.current_insn_num = 0;
5087
5.41k
  vpt_block_state.num_pred_insn = 0;
5088
5.41k
}
5089
5090
static void
5091
mark_inside_vpt_block (long given)
5092
5.41k
{
5093
5.41k
  vpt_block_state.in_vpt_block = true;
5094
5.41k
  vpt_block_state.next_pred_state = PRED_THEN;
5095
5.41k
  vpt_block_state.predicate_mask = mve_extract_pred_mask (given);
5096
5.41k
  vpt_block_state.current_insn_num = 0;
5097
5.41k
  vpt_block_state.num_pred_insn = num_instructions_vpt_block (given);
5098
5.41k
  assert (vpt_block_state.num_pred_insn >= 1);
5099
5.41k
}
5100
5101
static enum vpt_pred_state
5102
invert_next_predicate_state (enum vpt_pred_state astate)
5103
5.30k
{
5104
5.30k
  if (astate == PRED_THEN)
5105
3.32k
    return PRED_ELSE;
5106
1.98k
  else if (astate == PRED_ELSE)
5107
1.98k
    return PRED_THEN;
5108
0
  else
5109
0
    return PRED_NONE;
5110
5.30k
}
5111
5112
static enum vpt_pred_state
5113
update_next_predicate_state (void)
5114
8.95k
{
5115
8.95k
  long pred_mask = vpt_block_state.predicate_mask;
5116
8.95k
  long mask_for_insn = 0;
5117
5118
8.95k
  switch (vpt_block_state.current_insn_num)
5119
8.95k
    {
5120
4.07k
    case 1:
5121
4.07k
      mask_for_insn = 8;
5122
4.07k
      break;
5123
5124
2.83k
    case 2:
5125
2.83k
      mask_for_insn = 4;
5126
2.83k
      break;
5127
5128
2.03k
    case 3:
5129
2.03k
      mask_for_insn = 2;
5130
2.03k
      break;
5131
5132
0
    case 4:
5133
0
      return PRED_NONE;
5134
8.95k
    }
5135
5136
8.95k
  if (pred_mask & mask_for_insn)
5137
5.30k
    return invert_next_predicate_state (vpt_block_state.next_pred_state);
5138
3.64k
  else
5139
3.64k
    return vpt_block_state.next_pred_state;
5140
8.95k
}
5141
5142
static void
5143
update_vpt_block_state (void)
5144
14.3k
{
5145
14.3k
  vpt_block_state.current_insn_num++;
5146
14.3k
  if (vpt_block_state.current_insn_num == vpt_block_state.num_pred_insn)
5147
5.41k
    {
5148
      /* No more instructions to process in vpt block.  */
5149
5.41k
      mark_outside_vpt_block ();
5150
5.41k
      return;
5151
5.41k
    }
5152
5153
8.95k
  vpt_block_state.next_pred_state = update_next_predicate_state ();
5154
8.95k
}
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
10.3M
{
5167
10.3M
  unsigned long value = 0;
5168
10.3M
  int width = 0;
5169
5170
10.3M
  do
5171
10.7M
    {
5172
10.7M
      int start, end;
5173
10.7M
      int bits;
5174
5175
30.0M
      for (start = 0; *ptr >= '0' && *ptr <= '9'; ptr++)
5176
19.3M
  start = start * 10 + *ptr - '0';
5177
10.7M
      if (*ptr == '-')
5178
20.7M
  for (end = 0, ptr++; *ptr >= '0' && *ptr <= '9'; ptr++)
5179
13.6M
    end = end * 10 + *ptr - '0';
5180
3.64M
      else
5181
3.64M
  end = start;
5182
10.7M
      bits = end - start;
5183
10.7M
      if (bits < 0)
5184
0
  abort ();
5185
10.7M
      value |= ((insn >> start) & ((2ul << bits) - 1)) << width;
5186
10.7M
      width += bits + 1;
5187
10.7M
    }
5188
10.7M
  while (*ptr++ == ',');
5189
10.3M
  *valuep = value;
5190
10.3M
  if (widthp)
5191
10.3M
    *widthp = width;
5192
10.3M
  return ptr - 1;
5193
10.3M
}
5194
5195
static void
5196
arm_decode_shift (long given, fprintf_styled_ftype func, void *stream,
5197
      bool print_shift)
5198
1.43M
{
5199
1.43M
  func (stream, dis_style_register, "%s", arm_regnames[given & 0xf]);
5200
5201
1.43M
  if ((given & 0xff0) != 0)
5202
800k
    {
5203
800k
      if ((given & 0x10) == 0)
5204
605k
  {
5205
605k
    int amount = (given & 0xf80) >> 7;
5206
605k
    int shift = (given & 0x60) >> 5;
5207
5208
605k
    if (amount == 0)
5209
56.6k
      {
5210
56.6k
        if (shift == 3)
5211
9.75k
    {
5212
9.75k
      func (stream, dis_style_text, ", ");
5213
9.75k
      func (stream, dis_style_sub_mnemonic, "rrx");
5214
9.75k
      return;
5215
9.75k
    }
5216
5217
46.8k
        amount = 32;
5218
46.8k
      }
5219
5220
595k
    if (print_shift)
5221
594k
      {
5222
594k
        func (stream, dis_style_text, ", ");
5223
594k
        func (stream, dis_style_sub_mnemonic, "%s ", arm_shift[shift]);
5224
594k
        func (stream, dis_style_immediate, "#%d", amount);
5225
594k
      }
5226
809
    else
5227
809
      {
5228
809
        func (stream, dis_style_text, ", ");
5229
809
        func (stream, dis_style_immediate, "#%d", amount);
5230
809
      }
5231
595k
  }
5232
195k
      else if ((given & 0x80) == 0x80)
5233
1.35k
  func (stream, dis_style_comment_start,
5234
1.35k
        "\t@ <illegal shifter operand>");
5235
193k
      else if (print_shift)
5236
193k
  {
5237
193k
    func (stream, dis_style_text, ", ");
5238
193k
    func (stream, dis_style_sub_mnemonic, "%s ",
5239
193k
    arm_shift[(given & 0x60) >> 5]);
5240
193k
    func (stream, dis_style_register, "%s",
5241
193k
    arm_regnames[(given & 0xf00) >> 8]);
5242
193k
  }
5243
242
      else
5244
242
  {
5245
242
    func (stream, dis_style_text, ", ");
5246
242
    func (stream, dis_style_register, "%s",
5247
242
    arm_regnames[(given & 0xf00) >> 8]);
5248
242
  }
5249
800k
    }
5250
1.43M
}
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
10.1k
{
5257
10.1k
  switch (matched_insn)
5258
10.1k
    {
5259
291
    case MVE_VMOV_GP_TO_VEC_LANE:
5260
962
    case MVE_VMOV2_VEC_LANE_TO_GP:
5261
1.54k
    case MVE_VMOV2_GP_TO_VEC_LANE:
5262
2.08k
    case MVE_VMOV_VEC_LANE_TO_GP:
5263
2.47k
    case MVE_LSLL:
5264
3.03k
    case MVE_LSLLI:
5265
3.61k
    case MVE_LSRL:
5266
3.97k
    case MVE_ASRL:
5267
4.19k
    case MVE_ASRLI:
5268
4.53k
    case MVE_SQRSHRL:
5269
4.80k
    case MVE_SQRSHR:
5270
5.11k
    case MVE_UQRSHL:
5271
5.69k
    case MVE_UQRSHLL:
5272
6.05k
    case MVE_UQSHL:
5273
6.37k
    case MVE_UQSHLL:
5274
6.73k
    case MVE_URSHRL:
5275
6.97k
    case MVE_URSHR:
5276
7.33k
    case MVE_SRSHRL:
5277
7.60k
    case MVE_SRSHR:
5278
7.89k
    case MVE_SQSHLL:
5279
8.24k
    case MVE_SQSHL:
5280
8.24k
      return true;
5281
1.94k
    default:
5282
1.94k
      return false;
5283
10.1k
    }
5284
10.1k
}
5285
5286
static bool
5287
is_v81m_architecture (struct disassemble_info *info)
5288
857k
{
5289
857k
  struct arm_private_data *private_data = info->private_data;
5290
857k
  arm_feature_set allowed_arches = private_data->features;
5291
5292
857k
  arm_feature_set arm_ext_v8_1m_main
5293
857k
    = ARM_FEATURE_CORE_HIGH (ARM_EXT2_V8_1M_MAIN);
5294
5295
857k
  if (ARM_CPU_HAS_FEATURE (arm_ext_v8_1m_main, allowed_arches)
5296
728k
      && !ARM_CPU_IS_ANY (allowed_arches))
5297
609k
    return true;
5298
247k
  else
5299
247k
    return false;
5300
857k
}
5301
5302
static bool
5303
is_vpt_instruction (long given)
5304
142k
{
5305
5306
  /* If mkh:mkl is '0000' then its not a vpt/vpst instruction.  */
5307
142k
  if ((given & 0x0040e000) == 0)
5308
13.1k
    return false;
5309
5310
  /* VPT floating point T1 variant.  */
5311
129k
  if (((given & 0xefb10f50) == 0xee310f00 && ((given & 0x1001) != 0x1))
5312
  /* VPT floating point T2 variant.  */
5313
128k
      || ((given & 0xefb10f50) == 0xee310f40)
5314
  /* VPT vector T1 variant.  */
5315
127k
      || ((given & 0xff811f51) == 0xfe010f00)
5316
  /* VPT vector T2 variant.  */
5317
126k
      || ((given & 0xff811f51) == 0xfe010f01
5318
867
    && ((given & 0x300000) != 0x300000))
5319
  /* VPT vector T3 variant.  */
5320
126k
      || ((given & 0xff811f50) == 0xfe011f00)
5321
  /* VPT vector T4 variant.  */
5322
125k
      || ((given & 0xff811f70) == 0xfe010f40)
5323
  /* VPT vector T5 variant.  */
5324
125k
      || ((given & 0xff811f70) == 0xfe010f60)
5325
  /* VPT vector T6 variant.  */
5326
124k
      || ((given & 0xff811f50) == 0xfe011f40)
5327
  /* VPST vector T variant.  */
5328
123k
      || ((given & 0xffbf1fff) == 0xfe310f4d))
5329
5.41k
    return true;
5330
123k
  else
5331
123k
    return false;
5332
129k
}
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
602k
{
5340
602k
  int bits = end - start;
5341
5342
602k
  if (bits < 0)
5343
0
    abort ();
5344
5345
602k
  return ((given >> start) & ((2ul << bits) - 1));
5346
602k
}
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.8k
{
5357
66.8k
  int bits = end - start;
5358
66.8k
  int bits2 = end2 - start2;
5359
66.8k
  unsigned long value = 0;
5360
66.8k
  int width = 0;
5361
5362
66.8k
  if (bits2 < 0)
5363
0
    abort ();
5364
5365
66.8k
  value = arm_decode_field (given, start, end);
5366
66.8k
  width += bits + 1;
5367
5368
66.8k
  value |= ((given >> start2) & ((2ul << bits2) - 1)) << width;
5369
66.8k
  return value;
5370
66.8k
}
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
210k
{
5380
210k
  switch (matched_insn)
5381
210k
    {
5382
686
    case MVE_VPST:
5383
686
      if (arm_decode_field_multiple (given, 13, 15, 22, 22) == 0)
5384
428
  return true;
5385
258
      else
5386
258
  return false;
5387
5388
3.79k
    case MVE_VPT_FP_T1:
5389
3.79k
      if (arm_decode_field_multiple (given, 13, 15, 22, 22) == 0)
5390
811
  return true;
5391
2.98k
      if ((arm_decode_field (given, 12, 12) == 0)
5392
1.51k
    && (arm_decode_field (given, 0, 0) == 1))
5393
761
  return true;
5394
2.22k
      return false;
5395
5396
4.15k
    case MVE_VPT_FP_T2:
5397
4.15k
      if (arm_decode_field_multiple (given, 13, 15, 22, 22) == 0)
5398
1.03k
  return true;
5399
3.12k
      if (arm_decode_field (given, 0, 3) == 0xd)
5400
311
  return true;
5401
2.80k
      return false;
5402
5403
1.66k
    case MVE_VPT_VEC_T1:
5404
3.81k
    case MVE_VPT_VEC_T2:
5405
5.31k
    case MVE_VPT_VEC_T3:
5406
7.48k
    case MVE_VPT_VEC_T4:
5407
9.37k
    case MVE_VPT_VEC_T5:
5408
11.1k
    case MVE_VPT_VEC_T6:
5409
11.1k
      if (arm_decode_field_multiple (given, 13, 15, 22, 22) == 0)
5410
3.08k
  return true;
5411
8.03k
      if (arm_decode_field (given, 20, 21) == 3)
5412
791
  return true;
5413
7.24k
      return false;
5414
5415
811
    case MVE_VCMP_FP_T1:
5416
811
      if ((arm_decode_field (given, 12, 12) == 0)
5417
597
    && (arm_decode_field (given, 0, 0) == 1))
5418
317
  return true;
5419
494
      else
5420
494
  return false;
5421
5422
1.03k
    case MVE_VCMP_FP_T2:
5423
1.03k
      if (arm_decode_field (given, 0, 3) == 0xd)
5424
564
  return true;
5425
467
      else
5426
467
  return false;
5427
5428
1.63k
    case MVE_VQADD_T2:
5429
2.22k
    case MVE_VQSUB_T2:
5430
3.45k
    case MVE_VMUL_VEC_T2:
5431
4.62k
    case MVE_VMULH:
5432
6.49k
    case MVE_VRMULH:
5433
7.19k
    case MVE_VMLA:
5434
7.67k
    case MVE_VMAX:
5435
8.29k
    case MVE_VMIN:
5436
9.76k
    case MVE_VBRSR:
5437
10.2k
    case MVE_VADD_VEC_T2:
5438
10.6k
    case MVE_VSUB_VEC_T2:
5439
11.3k
    case MVE_VABAV:
5440
11.8k
    case MVE_VQRSHL_T1:
5441
12.1k
    case MVE_VQSHL_T4:
5442
12.6k
    case MVE_VRSHL_T1:
5443
13.1k
    case MVE_VSHL_T3:
5444
14.7k
    case MVE_VCADD_VEC:
5445
16.4k
    case MVE_VHCADD:
5446
17.4k
    case MVE_VDDUP:
5447
18.0k
    case MVE_VIDUP:
5448
18.7k
    case MVE_VQRDMLADH:
5449
19.7k
    case MVE_VQDMLAH:
5450
20.0k
    case MVE_VQRDMLAH:
5451
20.4k
    case MVE_VQDMLASH:
5452
21.1k
    case MVE_VQRDMLASH:
5453
21.4k
    case MVE_VQDMLSDH:
5454
22.6k
    case MVE_VQRDMLSDH:
5455
23.3k
    case MVE_VQDMULH_T3:
5456
24.1k
    case MVE_VQRDMULH_T4:
5457
24.7k
    case MVE_VQDMLADH:
5458
25.1k
    case MVE_VMLAS:
5459
28.3k
    case MVE_VMULL_INT:
5460
29.0k
    case MVE_VHADD_T2:
5461
29.9k
    case MVE_VHSUB_T2:
5462
30.2k
    case MVE_VCMP_VEC_T1:
5463
30.6k
    case MVE_VCMP_VEC_T2:
5464
30.9k
    case MVE_VCMP_VEC_T3:
5465
31.8k
    case MVE_VCMP_VEC_T4:
5466
32.2k
    case MVE_VCMP_VEC_T5:
5467
32.5k
    case MVE_VCMP_VEC_T6:
5468
32.5k
      if (arm_decode_field (given, 20, 21) == 3)
5469
7.13k
  return true;
5470
25.3k
      else
5471
25.3k
  return false;
5472
5473
1.23k
    case MVE_VLD2:
5474
1.63k
    case MVE_VLD4:
5475
3.03k
    case MVE_VST2:
5476
3.83k
    case MVE_VST4:
5477
3.83k
      if (arm_decode_field (given, 7, 8) == 3)
5478
429
  return true;
5479
3.40k
      else
5480
3.40k
  return false;
5481
5482
1.76k
    case MVE_VSTRB_T1:
5483
2.83k
    case MVE_VSTRH_T2:
5484
2.83k
      if ((arm_decode_field (given, 24, 24) == 0)
5485
2.27k
    && (arm_decode_field (given, 21, 21) == 0))
5486
1.21k
  {
5487
1.21k
      return true;
5488
1.21k
  }
5489
1.61k
      else if ((arm_decode_field (given, 7, 8) == 3))
5490
0
  return true;
5491
1.61k
      else
5492
1.61k
  return false;
5493
5494
1.48k
    case MVE_VLDRB_T1:
5495
2.85k
    case MVE_VLDRH_T2:
5496
3.73k
    case MVE_VLDRW_T7:
5497
4.92k
    case MVE_VSTRB_T5:
5498
6.02k
    case MVE_VSTRH_T6:
5499
6.97k
    case MVE_VSTRW_T7:
5500
6.97k
      if ((arm_decode_field (given, 24, 24) == 0)
5501
4.62k
    && (arm_decode_field (given, 21, 21) == 0))
5502
1.86k
  {
5503
1.86k
      return true;
5504
1.86k
  }
5505
5.10k
      else
5506
5.10k
  return false;
5507
5508
6.39k
    case MVE_VCVT_FP_FIX_VEC:
5509
6.39k
      return (arm_decode_field (given, 16, 21) & 0x38) == 0;
5510
5511
8.59k
    case MVE_VBIC_IMM:
5512
11.9k
    case MVE_VORR_IMM:
5513
11.9k
      {
5514
11.9k
  unsigned long cmode = arm_decode_field (given, 8, 11);
5515
5516
11.9k
  if ((cmode & 1) == 0)
5517
7.26k
    return true;
5518
4.70k
  else if ((cmode & 0xc) == 0xc)
5519
1.45k
    return true;
5520
3.24k
  else
5521
3.24k
    return false;
5522
11.9k
      }
5523
5524
4.33k
    case MVE_VMVN_IMM:
5525
4.33k
      {
5526
4.33k
  unsigned long cmode = arm_decode_field (given, 8, 11);
5527
5528
4.33k
  if (cmode == 0xe)
5529
0
    return true;
5530
4.33k
  else if ((cmode & 0x9) == 1)
5531
0
    return true;
5532
4.33k
  else if ((cmode & 0xd) == 9)
5533
0
    return true;
5534
4.33k
  else
5535
4.33k
    return false;
5536
4.33k
      }
5537
5538
8.14k
    case MVE_VMOV_IMM_TO_VEC:
5539
8.14k
      if ((arm_decode_field (given, 5, 5) == 1)
5540
5.14k
    && (arm_decode_field (given, 8, 11) != 0xe))
5541
4.21k
  return true;
5542
3.92k
      else
5543
3.92k
  return false;
5544
5545
1.18k
    case MVE_VMOVL:
5546
1.18k
      {
5547
1.18k
  unsigned long size = arm_decode_field (given, 19, 20);
5548
1.18k
  if ((size == 0) || (size == 3))
5549
0
    return true;
5550
1.18k
  else
5551
1.18k
    return false;
5552
1.18k
      }
5553
5554
761
    case MVE_VMAXA:
5555
1.53k
    case MVE_VMINA:
5556
2.36k
    case MVE_VMAXV:
5557
2.75k
    case MVE_VMAXAV:
5558
3.17k
    case MVE_VMINV:
5559
3.58k
    case MVE_VMINAV:
5560
3.88k
    case MVE_VQRSHL_T2:
5561
4.13k
    case MVE_VQSHL_T1:
5562
4.35k
    case MVE_VRSHL_T2:
5563
4.78k
    case MVE_VSHL_T2:
5564
5.16k
    case MVE_VSHLL_T2:
5565
5.49k
    case MVE_VADDV:
5566
5.99k
    case MVE_VMOVN:
5567
6.48k
    case MVE_VQMOVUN:
5568
6.91k
    case MVE_VQMOVN:
5569
6.91k
      if (arm_decode_field (given, 18, 19) == 3)
5570
1.02k
  return true;
5571
5.89k
      else
5572
5.89k
  return false;
5573
5574
1.17k
    case MVE_VMLSLDAV:
5575
1.76k
    case MVE_VRMLSLDAVH:
5576
3.57k
    case MVE_VMLALDAV:
5577
4.03k
    case MVE_VADDLV:
5578
4.03k
      if (arm_decode_field (given, 20, 22) == 7)
5579
1.27k
  return true;
5580
2.75k
      else
5581
2.75k
  return false;
5582
5583
1.74k
    case MVE_VRMLALDAVH:
5584
1.74k
      if ((arm_decode_field (given, 20, 22) & 6) == 6)
5585
214
  return true;
5586
1.53k
      else
5587
1.53k
  return false;
5588
5589
1.17k
    case MVE_VDWDUP:
5590
2.62k
    case MVE_VIWDUP:
5591
2.62k
      if ((arm_decode_field (given, 20, 21) == 3)
5592
2.34k
    || (arm_decode_field (given, 1, 3) == 7))
5593
785
  return true;
5594
1.83k
      else
5595
1.83k
  return false;
5596
5597
5598
2.41k
    case MVE_VSHLL_T1:
5599
2.41k
      if (arm_decode_field (given, 16, 18) == 0)
5600
1.57k
  {
5601
1.57k
    unsigned long sz = arm_decode_field (given, 19, 20);
5602
5603
1.57k
    if ((sz == 1) || (sz == 2))
5604
1.18k
      return true;
5605
392
    else
5606
392
      return false;
5607
1.57k
  }
5608
837
      else
5609
837
  return false;
5610
5611
589
    case MVE_VQSHL_T2:
5612
1.64k
    case MVE_VQSHLU_T3:
5613
2.70k
    case MVE_VRSHR:
5614
3.71k
    case MVE_VSHL_T1:
5615
5.01k
    case MVE_VSHR:
5616
5.27k
    case MVE_VSLI:
5617
5.84k
    case MVE_VSRI:
5618
5.84k
      if (arm_decode_field (given, 19, 21) == 0)
5619
899
  return true;
5620
4.94k
      else
5621
4.94k
  return false;
5622
5623
629
    case MVE_VCTP:
5624
629
    if (arm_decode_field (given, 16, 19) == 0xf)
5625
217
      return true;
5626
412
    else
5627
412
      return false;
5628
5629
642
    case MVE_ASRLI:
5630
1.16k
    case MVE_ASRL:
5631
2.35k
    case MVE_LSLLI:
5632
2.96k
    case MVE_LSLL:
5633
3.98k
    case MVE_LSRL:
5634
4.97k
    case MVE_SQRSHRL:
5635
5.84k
    case MVE_SQSHLL:
5636
6.63k
    case MVE_SRSHRL:
5637
7.75k
    case MVE_UQRSHLL:
5638
8.28k
    case MVE_UQSHLL:
5639
9.14k
    case MVE_URSHRL:
5640
9.14k
      if (arm_decode_field (given, 9, 11) == 0x7)
5641
2.68k
  return true;
5642
6.46k
      else
5643
6.46k
  return false;
5644
5645
665
    case MVE_CSINC:
5646
1.75k
    case MVE_CSINV:
5647
1.75k
      {
5648
1.75k
  unsigned long rm, rn;
5649
1.75k
  rm = arm_decode_field (given, 0, 3);
5650
1.75k
  rn = arm_decode_field (given, 16, 19);
5651
  /* CSET/CSETM.  */
5652
1.75k
  if (rm == 0xf && rn == 0xf)
5653
239
    return true;
5654
  /* CINC/CINV.  */
5655
1.52k
  else if (rn == rm && rn != 0xf)
5656
505
    return true;
5657
1.75k
      }
5658
    /* Fall through.  */
5659
1.67k
    case MVE_CSEL:
5660
2.63k
    case MVE_CSNEG:
5661
2.63k
      if (arm_decode_field (given, 0, 3) == 0xd)
5662
403
  return true;
5663
      /* CNEG.  */
5664
2.22k
      else if (matched_insn == MVE_CSNEG)
5665
760
  if (arm_decode_field (given, 0, 3) == arm_decode_field (given, 16, 19))
5666
406
    return true;
5667
1.82k
      return false;
5668
5669
72.8k
    default:
5670
73.1k
    case MVE_VADD_FP_T1:
5671
73.5k
    case MVE_VADD_FP_T2:
5672
73.9k
    case MVE_VADD_VEC_T1:
5673
73.9k
      return false;
5674
5675
210k
    }
5676
210k
}
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
8.57k
{
5683
8.57k
  void *stream = info->stream;
5684
8.57k
  fprintf_styled_ftype func = info->fprintf_styled_func;
5685
5686
8.57k
  unsigned long p, w, gpr, imm, add, mod_imm;
5687
5688
8.57k
  imm = arm_decode_field (given, 0, 6);
5689
8.57k
  mod_imm = imm;
5690
5691
8.57k
  switch (matched_insn)
5692
8.57k
    {
5693
786
    case MVE_VLDRB_T1:
5694
1.56k
    case MVE_VSTRB_T1:
5695
1.56k
      gpr = arm_decode_field (given, 16, 18);
5696
1.56k
      break;
5697
5698
727
    case MVE_VLDRH_T2:
5699
1.56k
    case MVE_VSTRH_T2:
5700
1.56k
      gpr = arm_decode_field (given, 16, 18);
5701
1.56k
      mod_imm = imm << 1;
5702
1.56k
      break;
5703
5704
1.49k
    case MVE_VLDRH_T6:
5705
2.32k
    case MVE_VSTRH_T6:
5706
2.32k
      gpr = arm_decode_field (given, 16, 19);
5707
2.32k
      mod_imm = imm << 1;
5708
2.32k
      break;
5709
5710
847
    case MVE_VLDRW_T7:
5711
1.58k
    case MVE_VSTRW_T7:
5712
1.58k
      gpr = arm_decode_field (given, 16, 19);
5713
1.58k
      mod_imm = imm << 2;
5714
1.58k
      break;
5715
5716
360
    case MVE_VLDRB_T5:
5717
1.53k
    case MVE_VSTRB_T5:
5718
1.53k
      gpr = arm_decode_field (given, 16, 19);
5719
1.53k
      break;
5720
5721
0
    default:
5722
0
      return;
5723
8.57k
    }
5724
5725
8.57k
  p = arm_decode_field (given, 24, 24);
5726
8.57k
  w = arm_decode_field (given, 21, 21);
5727
5728
8.57k
  add = arm_decode_field (given, 23, 23);
5729
5730
8.57k
  char * add_sub;
5731
5732
  /* Don't print anything for '+' as it is implied.  */
5733
8.57k
  if (add == 1)
5734
5.52k
    add_sub = "";
5735
3.04k
  else
5736
3.04k
    add_sub = "-";
5737
5738
8.57k
  func (stream, dis_style_text, "[");
5739
8.57k
  func (stream, dis_style_register, "%s", arm_regnames[gpr]);
5740
8.57k
  if (p == 1)
5741
3.93k
    {
5742
3.93k
      func (stream, dis_style_text, ", ");
5743
3.93k
      func (stream, dis_style_immediate, "#%s%lu", add_sub, mod_imm);
5744
      /* Offset mode.  */
5745
3.93k
      if (w == 0)
5746
1.60k
  func (stream, dis_style_text, "]");
5747
      /* Pre-indexed mode.  */
5748
2.33k
      else
5749
2.33k
  func (stream, dis_style_text, "]!");
5750
3.93k
    }
5751
4.63k
  else if ((p == 0) && (w == 1))
5752
4.11k
    {
5753
      /* Post-index mode.  */
5754
4.11k
      func (stream, dis_style_text, "], ");
5755
4.11k
      func (stream, dis_style_immediate, "#%s%lu", add_sub, mod_imm);
5756
4.11k
    }
5757
8.57k
}
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
167k
{
5767
167k
  *undefined_code = UNDEF_NONE;
5768
5769
167k
  switch (matched_insn)
5770
167k
    {
5771
1.40k
    case MVE_VDUP:
5772
1.40k
      if (arm_decode_field_multiple (given, 5, 5, 22, 22) == 3)
5773
240
  {
5774
240
    *undefined_code = UNDEF_SIZE_3;
5775
240
    return true;
5776
240
  }
5777
1.16k
      else
5778
1.16k
  return false;
5779
5780
1.23k
    case MVE_VQADD_T1:
5781
1.47k
    case MVE_VQSUB_T1:
5782
1.79k
    case MVE_VMUL_VEC_T1:
5783
2.26k
    case MVE_VABD_VEC:
5784
2.62k
    case MVE_VADD_VEC_T1:
5785
2.92k
    case MVE_VSUB_VEC_T1:
5786
3.14k
    case MVE_VQDMULH_T1:
5787
3.55k
    case MVE_VQRDMULH_T2:
5788
4.83k
    case MVE_VRHADD:
5789
5.71k
    case MVE_VHADD_T1:
5790
6.24k
    case MVE_VHSUB_T1:
5791
6.24k
      if (arm_decode_field (given, 20, 21) == 3)
5792
703
  {
5793
703
    *undefined_code = UNDEF_SIZE_3;
5794
703
    return true;
5795
703
  }
5796
5.54k
      else
5797
5.54k
  return false;
5798
5799
786
    case MVE_VLDRB_T1:
5800
786
      if (arm_decode_field (given, 7, 8) == 3)
5801
247
  {
5802
247
    *undefined_code = UNDEF_SIZE_3;
5803
247
    return true;
5804
247
  }
5805
539
      else
5806
539
  return false;
5807
5808
727
    case MVE_VLDRH_T2:
5809
727
      if (arm_decode_field (given, 7, 8) <= 1)
5810
322
  {
5811
322
    *undefined_code = UNDEF_SIZE_LE_1;
5812
322
    return true;
5813
322
  }
5814
405
      else
5815
405
  return false;
5816
5817
775
    case MVE_VSTRB_T1:
5818
775
      if ((arm_decode_field (given, 7, 8) == 0))
5819
298
  {
5820
298
    *undefined_code = UNDEF_SIZE_0;
5821
298
    return true;
5822
298
  }
5823
477
      else
5824
477
  return false;
5825
5826
839
    case MVE_VSTRH_T2:
5827
839
      if ((arm_decode_field (given, 7, 8) <= 1))
5828
477
  {
5829
477
    *undefined_code = UNDEF_SIZE_LE_1;
5830
477
    return true;
5831
477
  }
5832
362
      else
5833
362
  return false;
5834
5835
1.37k
    case MVE_VLDRB_GATHER_T1:
5836
1.37k
      if (arm_decode_field (given, 7, 8) == 3)
5837
374
  {
5838
374
    *undefined_code = UNDEF_SIZE_3;
5839
374
    return true;
5840
374
  }
5841
1.00k
      else if ((arm_decode_field (given, 28, 28) == 0)
5842
774
         && (arm_decode_field (given, 7, 8) == 0))
5843
305
  {
5844
305
    *undefined_code = UNDEF_NOT_UNS_SIZE_0;
5845
305
    return true;
5846
305
  }
5847
698
      else
5848
698
  return false;
5849
5850
2.06k
    case MVE_VLDRH_GATHER_T2:
5851
2.06k
      if (arm_decode_field (given, 7, 8) == 3)
5852
1.02k
  {
5853
1.02k
    *undefined_code = UNDEF_SIZE_3;
5854
1.02k
    return true;
5855
1.02k
  }
5856
1.04k
      else if ((arm_decode_field (given, 28, 28) == 0)
5857
810
         && (arm_decode_field (given, 7, 8) == 1))
5858
326
  {
5859
326
    *undefined_code = UNDEF_NOT_UNS_SIZE_1;
5860
326
    return true;
5861
326
  }
5862
718
      else if (arm_decode_field (given, 7, 8) == 0)
5863
477
  {
5864
477
    *undefined_code = UNDEF_SIZE_0;
5865
477
    return true;
5866
477
  }
5867
241
      else
5868
241
  return false;
5869
5870
349
    case MVE_VLDRW_GATHER_T3:
5871
349
      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
349
      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
349
      else
5882
349
  return false;
5883
5884
600
    case MVE_VLDRD_GATHER_T4:
5885
600
      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
600
      else if (arm_decode_field (given, 28, 28) == 0)
5891
307
  {
5892
307
    *undefined_code = UNDEF_NOT_UNSIGNED;
5893
307
    return true;
5894
307
  }
5895
293
      else
5896
293
  return false;
5897
5898
1.88k
    case MVE_VSTRB_SCATTER_T1:
5899
1.88k
      if (arm_decode_field (given, 7, 8) == 3)
5900
566
  {
5901
566
    *undefined_code = UNDEF_SIZE_3;
5902
566
    return true;
5903
566
  }
5904
1.31k
      else
5905
1.31k
  return false;
5906
5907
999
    case MVE_VSTRH_SCATTER_T2:
5908
999
      {
5909
999
  unsigned long size = arm_decode_field (given, 7, 8);
5910
999
  if (size == 3)
5911
344
    {
5912
344
      *undefined_code = UNDEF_SIZE_3;
5913
344
      return true;
5914
344
    }
5915
655
  else if (size == 0)
5916
262
    {
5917
262
      *undefined_code = UNDEF_SIZE_0;
5918
262
      return true;
5919
262
    }
5920
393
  else
5921
393
    return false;
5922
999
      }
5923
5924
1.33k
    case MVE_VSTRW_SCATTER_T3:
5925
1.33k
      if (arm_decode_field (given, 7, 8) != 2)
5926
1.03k
  {
5927
1.03k
    *undefined_code = UNDEF_SIZE_NOT_2;
5928
1.03k
    return true;
5929
1.03k
  }
5930
301
      else
5931
301
  return false;
5932
5933
283
    case MVE_VSTRD_SCATTER_T4:
5934
283
      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
283
      else
5940
283
  return false;
5941
5942
4.91k
    case MVE_VCVT_FP_FIX_VEC:
5943
4.91k
      {
5944
4.91k
  unsigned long imm6 = arm_decode_field (given, 16, 21);
5945
4.91k
  if ((imm6 & 0x20) == 0)
5946
409
    {
5947
409
      *undefined_code = UNDEF_VCVT_IMM6;
5948
409
      return true;
5949
409
    }
5950
5951
4.50k
  if ((arm_decode_field (given, 9, 9) == 0)
5952
1.47k
      && ((imm6 & 0x30) == 0x20))
5953
1.10k
    {
5954
1.10k
      *undefined_code = UNDEF_VCVT_FSI_IMM6;
5955
1.10k
      return true;
5956
1.10k
    }
5957
5958
3.39k
  return false;
5959
4.50k
      }
5960
5961
326
    case MVE_VNEG_FP:
5962
562
    case MVE_VABS_FP:
5963
4.22k
    case MVE_VCVT_BETWEEN_FP_INT:
5964
8.47k
    case MVE_VCVT_FROM_FP_TO_INT:
5965
8.47k
      {
5966
8.47k
  unsigned long size = arm_decode_field (given, 18, 19);
5967
8.47k
  if (size == 0)
5968
691
    {
5969
691
      *undefined_code = UNDEF_SIZE_0;
5970
691
      return true;
5971
691
    }
5972
7.78k
  else if (size == 3)
5973
2.06k
    {
5974
2.06k
      *undefined_code = UNDEF_SIZE_3;
5975
2.06k
      return true;
5976
2.06k
    }
5977
5.72k
  else
5978
5.72k
    return false;
5979
8.47k
      }
5980
5981
1.33k
    case MVE_VMOV_VEC_LANE_TO_GP:
5982
1.33k
      {
5983
1.33k
  unsigned long op1 = arm_decode_field (given, 21, 22);
5984
1.33k
  unsigned long op2 = arm_decode_field (given, 5, 6);
5985
1.33k
  unsigned long u = arm_decode_field (given, 23, 23);
5986
5987
1.33k
  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.33k
  else if (op2 == 2)
5998
1.33k
    {
5999
1.33k
      if ((op1 == 0) || (op1 == 1))
6000
1.33k
        {
6001
1.33k
    *undefined_code = UNDEF_BAD_OP1_OP2;
6002
1.33k
    return true;
6003
1.33k
        }
6004
0
      else
6005
0
        return false;
6006
1.33k
    }
6007
6008
0
  return false;
6009
1.33k
      }
6010
6011
934
    case MVE_VMOV_GP_TO_VEC_LANE:
6012
934
      if (arm_decode_field (given, 5, 6) == 2)
6013
934
  {
6014
934
    unsigned long op1 = arm_decode_field (given, 21, 22);
6015
934
    if ((op1 == 0) || (op1 == 1))
6016
934
      {
6017
934
        *undefined_code = UNDEF_BAD_OP1_OP2;
6018
934
        return true;
6019
934
      }
6020
0
    else
6021
0
      return false;
6022
934
  }
6023
0
      else
6024
0
  return false;
6025
6026
828
    case MVE_VMOV_VEC_TO_VEC:
6027
828
      if ((arm_decode_field (given, 5, 5) == 1)
6028
415
    || (arm_decode_field (given, 22, 22) == 1))
6029
634
    return true;
6030
194
      return false;
6031
6032
3.92k
    case MVE_VMOV_IMM_TO_VEC:
6033
3.92k
      if (arm_decode_field (given, 5, 5) == 0)
6034
2.99k
      {
6035
2.99k
  unsigned long cmode = arm_decode_field (given, 8, 11);
6036
6037
2.99k
  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
2.99k
  else
6043
2.99k
    return false;
6044
2.99k
      }
6045
928
      else
6046
928
  return false;
6047
6048
389
    case MVE_VSHLL_T2:
6049
891
    case MVE_VMOVN:
6050
891
      if (arm_decode_field (given, 18, 19) == 2)
6051
505
  {
6052
505
    *undefined_code = UNDEF_SIZE_2;
6053
505
    return true;
6054
505
  }
6055
386
      else
6056
386
  return false;
6057
6058
1.53k
    case MVE_VRMLALDAVH:
6059
2.22k
    case MVE_VMLADAV_T1:
6060
2.66k
    case MVE_VMLADAV_T2:
6061
3.77k
    case MVE_VMLALDAV:
6062
3.77k
      if ((arm_decode_field (given, 28, 28) == 1)
6063
1.49k
    && (arm_decode_field (given, 12, 12) == 1))
6064
1.03k
  {
6065
1.03k
    *undefined_code = UNDEF_XCHG_UNS;
6066
1.03k
    return true;
6067
1.03k
  }
6068
2.74k
      else
6069
2.74k
  return false;
6070
6071
370
    case MVE_VQSHRN:
6072
854
    case MVE_VQSHRUN:
6073
2.08k
    case MVE_VSHLL_T1:
6074
2.47k
    case MVE_VSHRN:
6075
2.47k
      {
6076
2.47k
  unsigned long sz = arm_decode_field (given, 19, 20);
6077
2.47k
  if (sz == 1)
6078
776
    return false;
6079
1.69k
  else if ((sz & 2) == 2)
6080
878
    return false;
6081
816
  else
6082
816
    {
6083
816
      *undefined_code = UNDEF_SIZE;
6084
816
      return true;
6085
816
    }
6086
2.47k
      }
6087
0
      break;
6088
6089
589
    case MVE_VQSHL_T2:
6090
1.44k
    case MVE_VQSHLU_T3:
6091
2.06k
    case MVE_VRSHR:
6092
3.07k
    case MVE_VSHL_T1:
6093
4.31k
    case MVE_VSHR:
6094
4.57k
    case MVE_VSLI:
6095
4.94k
    case MVE_VSRI:
6096
4.94k
      {
6097
4.94k
  unsigned long sz = arm_decode_field (given, 19, 21);
6098
4.94k
  if ((sz & 7) == 1)
6099
642
    return false;
6100
4.30k
  else if ((sz & 6) == 2)
6101
1.11k
    return false;
6102
3.19k
  else if ((sz & 4) == 4)
6103
3.19k
    return false;
6104
0
  else
6105
0
    {
6106
0
      *undefined_code = UNDEF_SIZE;
6107
0
      return true;
6108
0
    }
6109
4.94k
      }
6110
6111
420
    case MVE_VQRSHRN:
6112
958
    case MVE_VQRSHRUN:
6113
958
      if (arm_decode_field (given, 19, 20) == 0)
6114
316
  {
6115
316
    *undefined_code = UNDEF_SIZE_0;
6116
316
    return true;
6117
316
  }
6118
642
      else
6119
642
  return false;
6120
6121
645
    case MVE_VABS_VEC:
6122
645
  if (arm_decode_field (given, 18, 19) == 3)
6123
326
  {
6124
326
    *undefined_code = UNDEF_SIZE_3;
6125
326
    return true;
6126
326
  }
6127
319
  else
6128
319
    return false;
6129
6130
253
    case MVE_VQNEG:
6131
649
    case MVE_VQABS:
6132
1.22k
    case MVE_VNEG_VEC:
6133
1.51k
    case MVE_VCLS:
6134
1.74k
    case MVE_VCLZ:
6135
1.74k
      if (arm_decode_field (given, 18, 19) == 3)
6136
645
  {
6137
645
    *undefined_code = UNDEF_SIZE_3;
6138
645
    return true;
6139
645
  }
6140
1.09k
      else
6141
1.09k
  return false;
6142
6143
940
    case MVE_VREV16:
6144
940
      if (arm_decode_field (given, 18, 19) == 0)
6145
640
  return false;
6146
300
      else
6147
300
  {
6148
300
    *undefined_code = UNDEF_SIZE_NOT_0;
6149
300
    return true;
6150
300
  }
6151
6152
618
    case MVE_VREV32:
6153
618
      {
6154
618
  unsigned long size = arm_decode_field (given, 18, 19);
6155
618
  if ((size & 2) == 2)
6156
301
    {
6157
301
      *undefined_code = UNDEF_SIZE_2;
6158
301
      return true;
6159
301
    }
6160
317
  else
6161
317
    return false;
6162
618
      }
6163
6164
647
    case MVE_VREV64:
6165
647
      if (arm_decode_field (given, 18, 19) != 3)
6166
240
  return false;
6167
407
      else
6168
407
  {
6169
407
    *undefined_code = UNDEF_SIZE_3;
6170
407
    return true;
6171
407
  }
6172
6173
109k
    default:
6174
109k
      return false;
6175
167k
    }
6176
167k
}
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
165k
{
6186
165k
  *unpredictable_code = UNPRED_NONE;
6187
6188
165k
  switch (matched_insn)
6189
165k
    {
6190
467
    case MVE_VCMP_FP_T2:
6191
3.27k
    case MVE_VPT_FP_T2:
6192
3.27k
      if ((arm_decode_field (given, 12, 12) == 0)
6193
884
    && (arm_decode_field (given, 5, 5) == 1))
6194
492
  {
6195
492
    *unpredictable_code = UNPRED_FCA_0_FCB_1;
6196
492
    return true;
6197
492
  }
6198
2.78k
      else
6199
2.78k
  return false;
6200
6201
1.18k
    case MVE_VPT_VEC_T4:
6202
2.51k
    case MVE_VPT_VEC_T5:
6203
3.96k
    case MVE_VPT_VEC_T6:
6204
4.33k
    case MVE_VCMP_VEC_T4:
6205
4.72k
    case MVE_VCMP_VEC_T5:
6206
4.99k
    case MVE_VCMP_VEC_T6:
6207
4.99k
      if (arm_decode_field (given, 0, 3) == 0xd)
6208
675
  {
6209
675
    *unpredictable_code = UNPRED_R13;
6210
675
    return true;
6211
675
  }
6212
4.31k
      else
6213
4.31k
  return false;
6214
6215
1.40k
    case MVE_VDUP:
6216
1.40k
      {
6217
1.40k
  unsigned long gpr = arm_decode_field (given, 12, 15);
6218
1.40k
  if (gpr == 0xd)
6219
286
    {
6220
286
      *unpredictable_code = UNPRED_R13;
6221
286
      return true;
6222
286
    }
6223
1.12k
  else if (gpr == 0xf)
6224
501
    {
6225
501
      *unpredictable_code = UNPRED_R15;
6226
501
      return true;
6227
501
    }
6228
6229
620
  return false;
6230
1.40k
      }
6231
6232
711
    case MVE_VQADD_T2:
6233
1.29k
    case MVE_VQSUB_T2:
6234
1.59k
    case MVE_VMUL_FP_T2:
6235
2.22k
    case MVE_VMUL_VEC_T2:
6236
2.93k
    case MVE_VMLA:
6237
3.78k
    case MVE_VBRSR:
6238
4.22k
    case MVE_VADD_FP_T2:
6239
4.56k
    case MVE_VSUB_FP_T2:
6240
5.03k
    case MVE_VADD_VEC_T2:
6241
5.38k
    case MVE_VSUB_VEC_T2:
6242
5.65k
    case MVE_VQRSHL_T2:
6243
5.90k
    case MVE_VQSHL_T1:
6244
6.11k
    case MVE_VRSHL_T2:
6245
6.54k
    case MVE_VSHL_T2:
6246
7.21k
    case MVE_VSHLC:
6247
8.13k
    case MVE_VQDMLAH:
6248
8.46k
    case MVE_VQRDMLAH:
6249
8.83k
    case MVE_VQDMLASH:
6250
9.54k
    case MVE_VQRDMLASH:
6251
10.2k
    case MVE_VQDMULH_T3:
6252
11.0k
    case MVE_VQRDMULH_T4:
6253
11.5k
    case MVE_VMLAS:
6254
11.8k
    case MVE_VFMA_FP_SCALAR:
6255
12.4k
    case MVE_VFMAS_FP_SCALAR:
6256
13.1k
    case MVE_VHADD_T2:
6257
13.7k
    case MVE_VHSUB_T2:
6258
13.7k
      {
6259
13.7k
  unsigned long gpr = arm_decode_field (given, 0, 3);
6260
13.7k
  if (gpr == 0xd)
6261
1.21k
    {
6262
1.21k
      *unpredictable_code = UNPRED_R13;
6263
1.21k
      return true;
6264
1.21k
    }
6265
12.5k
  else if (gpr == 0xf)
6266
2.18k
    {
6267
2.18k
      *unpredictable_code = UNPRED_R15;
6268
2.18k
      return true;
6269
2.18k
    }
6270
6271
10.3k
  return false;
6272
13.7k
      }
6273
6274
891
    case MVE_VLD2:
6275
2.21k
    case MVE_VST2:
6276
2.21k
      {
6277
2.21k
  unsigned long rn = arm_decode_field (given, 16, 19);
6278
6279
2.21k
  if ((rn == 0xd) && (arm_decode_field (given, 21, 21) == 1))
6280
578
    {
6281
578
      *unpredictable_code = UNPRED_R13_AND_WB;
6282
578
      return true;
6283
578
    }
6284
6285
1.63k
  if (rn == 0xf)
6286
672
    {
6287
672
      *unpredictable_code = UNPRED_R15;
6288
672
      return true;
6289
672
    }
6290
6291
966
  if (arm_decode_field_multiple (given, 13, 15, 22, 22) > 6)
6292
542
    {
6293
542
      *unpredictable_code = UNPRED_Q_GT_6;
6294
542
      return true;
6295
542
    }
6296
424
  else
6297
424
    return false;
6298
966
      }
6299
6300
396
    case MVE_VLD4:
6301
1.18k
    case MVE_VST4:
6302
1.18k
      {
6303
1.18k
  unsigned long rn = arm_decode_field (given, 16, 19);
6304
6305
1.18k
  if ((rn == 0xd) && (arm_decode_field (given, 21, 21) == 1))
6306
291
    {
6307
291
      *unpredictable_code = UNPRED_R13_AND_WB;
6308
291
      return true;
6309
291
    }
6310
6311
894
  if (rn == 0xf)
6312
295
    {
6313
295
      *unpredictable_code = UNPRED_R15;
6314
295
      return true;
6315
295
    }
6316
6317
599
  if (arm_decode_field_multiple (given, 13, 15, 22, 22) > 4)
6318
309
    {
6319
309
      *unpredictable_code = UNPRED_Q_GT_4;
6320
309
      return true;
6321
309
    }
6322
290
  else
6323
290
    return false;
6324
599
      }
6325
6326
360
    case MVE_VLDRB_T5:
6327
1.85k
    case MVE_VLDRH_T6:
6328
2.69k
    case MVE_VLDRW_T7:
6329
3.87k
    case MVE_VSTRB_T5:
6330
4.70k
    case MVE_VSTRH_T6:
6331
5.43k
    case MVE_VSTRW_T7:
6332
5.43k
      {
6333
5.43k
  unsigned long rn = arm_decode_field (given, 16, 19);
6334
6335
5.43k
  if ((rn == 0xd) && (arm_decode_field (given, 21, 21) == 1))
6336
390
    {
6337
390
      *unpredictable_code = UNPRED_R13_AND_WB;
6338
390
      return true;
6339
390
    }
6340
5.04k
  else if (rn == 0xf)
6341
790
    {
6342
790
      *unpredictable_code = UNPRED_R15;
6343
790
      return true;
6344
790
    }
6345
4.25k
  else
6346
4.25k
    return false;
6347
5.43k
      }
6348
6349
1.37k
    case MVE_VLDRB_GATHER_T1:
6350
1.37k
      if (arm_decode_field (given, 0, 0) == 1)
6351
549
  {
6352
549
    *unpredictable_code = UNPRED_OS;
6353
549
    return true;
6354
549
  }
6355
6356
      /*  fall through.  */
6357
      /* To handle common code with T2-T4 variants.  */
6358
2.89k
    case MVE_VLDRH_GATHER_T2:
6359
3.23k
    case MVE_VLDRW_GATHER_T3:
6360
3.83k
    case MVE_VLDRD_GATHER_T4:
6361
3.83k
      {
6362
3.83k
  unsigned long qd = arm_decode_field_multiple (given, 13, 15, 22, 22);
6363
3.83k
  unsigned long qm = arm_decode_field_multiple (given, 1, 3, 5, 5);
6364
6365
3.83k
  if (qd == qm)
6366
484
    {
6367
484
      *unpredictable_code = UNPRED_Q_REGS_EQUAL;
6368
484
      return true;
6369
484
    }
6370
6371
3.35k
  if (arm_decode_field (given, 16, 19) == 0xf)
6372
788
    {
6373
788
      *unpredictable_code = UNPRED_R15;
6374
788
      return true;
6375
788
    }
6376
6377
2.56k
  return false;
6378
3.35k
      }
6379
6380
587
    case MVE_VLDRW_GATHER_T5:
6381
1.12k
    case MVE_VLDRD_GATHER_T6:
6382
1.12k
      {
6383
1.12k
  unsigned long qd = arm_decode_field_multiple (given, 13, 15, 22, 22);
6384
1.12k
  unsigned long qm = arm_decode_field_multiple (given, 17, 19, 7, 7);
6385
6386
1.12k
  if (qd == qm)
6387
343
    {
6388
343
      *unpredictable_code = UNPRED_Q_REGS_EQUAL;
6389
343
      return true;
6390
343
    }
6391
786
  else
6392
786
    return false;
6393
1.12k
      }
6394
6395
1.88k
    case MVE_VSTRB_SCATTER_T1:
6396
1.88k
      if (arm_decode_field (given, 16, 19) == 0xf)
6397
667
  {
6398
667
    *unpredictable_code = UNPRED_R15;
6399
667
    return true;
6400
667
  }
6401
1.21k
      else if (arm_decode_field (given, 0, 0) == 1)
6402
669
  {
6403
669
    *unpredictable_code = UNPRED_OS;
6404
669
    return true;
6405
669
  }
6406
544
      else
6407
544
  return false;
6408
6409
973
    case MVE_VSTRH_SCATTER_T2:
6410
2.30k
    case MVE_VSTRW_SCATTER_T3:
6411
2.56k
    case MVE_VSTRD_SCATTER_T4:
6412
2.56k
      if (arm_decode_field (given, 16, 19) == 0xf)
6413
594
  {
6414
594
    *unpredictable_code = UNPRED_R15;
6415
594
    return true;
6416
594
  }
6417
1.96k
      else
6418
1.96k
  return false;
6419
6420
1.63k
    case MVE_VMOV2_VEC_LANE_TO_GP:
6421
3.10k
    case MVE_VMOV2_GP_TO_VEC_LANE:
6422
6.76k
    case MVE_VCVT_BETWEEN_FP_INT:
6423
11.0k
    case MVE_VCVT_FROM_FP_TO_INT:
6424
11.0k
      {
6425
11.0k
  unsigned long rt = arm_decode_field (given, 0, 3);
6426
11.0k
  unsigned long rt2 = arm_decode_field (given, 16, 19);
6427
6428
11.0k
  if ((rt == 0xd) || (rt2 == 0xd))
6429
1.13k
    {
6430
1.13k
      *unpredictable_code = UNPRED_R13;
6431
1.13k
      return true;
6432
1.13k
    }
6433
9.87k
  else if ((rt == 0xf) || (rt2 == 0xf))
6434
2.83k
    {
6435
2.83k
      *unpredictable_code = UNPRED_R15;
6436
2.83k
      return true;
6437
2.83k
    }
6438
7.04k
  else if (rt == rt2 && matched_insn != MVE_VMOV2_GP_TO_VEC_LANE)
6439
284
    {
6440
284
      *unpredictable_code = UNPRED_GP_REGS_EQUAL;
6441
284
      return true;
6442
284
    }
6443
6444
6.75k
  return false;
6445
11.0k
      }
6446
6447
830
    case MVE_VMAXV:
6448
1.22k
    case MVE_VMAXAV:
6449
1.49k
    case MVE_VMAXNMV_FP:
6450
1.89k
    case MVE_VMAXNMAV_FP:
6451
2.33k
    case MVE_VMINNMV_FP:
6452
2.63k
    case MVE_VMINNMAV_FP:
6453
3.04k
    case MVE_VMINV:
6454
3.46k
    case MVE_VMINAV:
6455
4.14k
    case MVE_VABAV:
6456
4.14k
    case MVE_VMOV_HFP_TO_GP:
6457
5.08k
    case MVE_VMOV_GP_TO_VEC_LANE:
6458
6.41k
    case MVE_VMOV_VEC_LANE_TO_GP:
6459
6.41k
      {
6460
6.41k
  unsigned long rda = arm_decode_field (given, 12, 15);
6461
6.41k
  if (rda == 0xd)
6462
266
    {
6463
266
      *unpredictable_code = UNPRED_R13;
6464
266
      return true;
6465
266
    }
6466
6.14k
  else if (rda == 0xf)
6467
1.50k
    {
6468
1.50k
      *unpredictable_code = UNPRED_R15;
6469
1.50k
      return true;
6470
1.50k
    }
6471
6472
4.64k
  return false;
6473
6.41k
      }
6474
6475
1.46k
    case MVE_VMULL_INT:
6476
1.46k
      {
6477
1.46k
  unsigned long Qd;
6478
1.46k
  unsigned long Qm;
6479
1.46k
  unsigned long Qn;
6480
6481
1.46k
  if (arm_decode_field (given, 20, 21) == 2)
6482
820
    {
6483
820
      Qd = arm_decode_field_multiple (given, 13, 15, 22, 22);
6484
820
      Qm = arm_decode_field_multiple (given, 1, 3, 5, 5);
6485
820
      Qn = arm_decode_field_multiple (given, 17, 19, 7, 7);
6486
6487
820
      if ((Qd == Qn) || (Qd == Qm))
6488
488
        {
6489
488
    *unpredictable_code = UNPRED_Q_REGS_EQ_AND_SIZE_2;
6490
488
    return true;
6491
488
        }
6492
332
      else
6493
332
        return false;
6494
820
    }
6495
641
  else
6496
641
    return false;
6497
1.46k
      }
6498
6499
1.53k
    case MVE_VCMUL_FP:
6500
2.40k
    case MVE_VQDMULL_T1:
6501
2.40k
      {
6502
2.40k
  unsigned long Qd;
6503
2.40k
  unsigned long Qm;
6504
2.40k
  unsigned long Qn;
6505
6506
2.40k
  if (arm_decode_field (given, 28, 28) == 1)
6507
1.84k
    {
6508
1.84k
      Qd = arm_decode_field_multiple (given, 13, 15, 22, 22);
6509
1.84k
      Qm = arm_decode_field_multiple (given, 1, 3, 5, 5);
6510
1.84k
      Qn = arm_decode_field_multiple (given, 17, 19, 7, 7);
6511
6512
1.84k
      if ((Qd == Qn) || (Qd == Qm))
6513
495
        {
6514
495
    *unpredictable_code = UNPRED_Q_REGS_EQ_AND_SIZE_1;
6515
495
    return true;
6516
495
        }
6517
1.34k
      else
6518
1.34k
        return false;
6519
1.84k
    }
6520
562
  else
6521
562
    return false;
6522
2.40k
      }
6523
6524
2.12k
    case MVE_VQDMULL_T2:
6525
2.12k
      {
6526
2.12k
  unsigned long gpr = arm_decode_field (given, 0, 3);
6527
2.12k
  if (gpr == 0xd)
6528
500
    {
6529
500
      *unpredictable_code = UNPRED_R13;
6530
500
      return true;
6531
500
    }
6532
1.62k
  else if (gpr == 0xf)
6533
285
    {
6534
285
      *unpredictable_code = UNPRED_R15;
6535
285
      return true;
6536
285
    }
6537
6538
1.34k
  if (arm_decode_field (given, 28, 28) == 1)
6539
694
    {
6540
694
      unsigned long Qd
6541
694
        = arm_decode_field_multiple (given, 13, 15, 22, 22);
6542
694
      unsigned long Qn = arm_decode_field_multiple (given, 17, 19, 7, 7);
6543
6544
694
      if (Qd == Qn)
6545
351
        {
6546
351
    *unpredictable_code = UNPRED_Q_REGS_EQ_AND_SIZE_1;
6547
351
    return true;
6548
351
        }
6549
343
      else
6550
343
        return false;
6551
694
    }
6552
6553
647
  return false;
6554
1.34k
      }
6555
6556
800
    case MVE_VMLSLDAV:
6557
1.37k
    case MVE_VRMLSLDAVH:
6558
2.49k
    case MVE_VMLALDAV:
6559
2.75k
    case MVE_VADDLV:
6560
2.75k
      if (arm_decode_field (given, 20, 22) == 6)
6561
1.52k
  {
6562
1.52k
    *unpredictable_code = UNPRED_R13;
6563
1.52k
    return true;
6564
1.52k
  }
6565
1.23k
      else
6566
1.23k
  return false;
6567
6568
976
    case MVE_VDWDUP:
6569
1.83k
    case MVE_VIWDUP:
6570
1.83k
      if (arm_decode_field (given, 1, 3) == 6)
6571
642
  {
6572
642
    *unpredictable_code = UNPRED_R13;
6573
642
    return true;
6574
642
  }
6575
1.19k
      else
6576
1.19k
  return false;
6577
6578
933
    case MVE_VCADD_VEC:
6579
2.62k
    case MVE_VHCADD:
6580
2.62k
      {
6581
2.62k
  unsigned long Qd = arm_decode_field_multiple (given, 13, 15, 22, 22);
6582
2.62k
  unsigned long Qm = arm_decode_field_multiple (given, 1, 3, 5, 5);
6583
2.62k
  if ((Qd == Qm) && arm_decode_field (given, 20, 21) == 2)
6584
309
    {
6585
309
      *unpredictable_code = UNPRED_Q_REGS_EQ_AND_SIZE_2;
6586
309
      return true;
6587
309
    }
6588
2.31k
  else
6589
2.31k
    return false;
6590
2.62k
      }
6591
6592
842
    case MVE_VCADD_FP:
6593
842
      {
6594
842
  unsigned long Qd = arm_decode_field_multiple (given, 13, 15, 22, 22);
6595
842
  unsigned long Qm = arm_decode_field_multiple (given, 1, 3, 5, 5);
6596
842
  if ((Qd == Qm) && arm_decode_field (given, 20, 20) == 1)
6597
347
    {
6598
347
      *unpredictable_code = UNPRED_Q_REGS_EQ_AND_SIZE_1;
6599
347
      return true;
6600
347
    }
6601
495
  else
6602
495
    return false;
6603
842
      }
6604
6605
2.29k
    case MVE_VCMLA_FP:
6606
2.29k
      {
6607
2.29k
  unsigned long Qda;
6608
2.29k
  unsigned long Qm;
6609
2.29k
  unsigned long Qn;
6610
6611
2.29k
  if (arm_decode_field (given, 20, 20) == 1)
6612
1.65k
    {
6613
1.65k
      Qda = arm_decode_field_multiple (given, 13, 15, 22, 22);
6614
1.65k
      Qm = arm_decode_field_multiple (given, 1, 3, 5, 5);
6615
1.65k
      Qn = arm_decode_field_multiple (given, 17, 19, 7, 7);
6616
6617
1.65k
      if ((Qda == Qn) || (Qda == Qm))
6618
919
        {
6619
919
    *unpredictable_code = UNPRED_Q_REGS_EQ_AND_SIZE_1;
6620
919
    return true;
6621
919
        }
6622
734
      else
6623
734
        return false;
6624
1.65k
    }
6625
645
  else
6626
645
    return false;
6627
6628
2.29k
      }
6629
6630
409
    case MVE_VCTP:
6631
409
      if (arm_decode_field (given, 16, 19) == 0xd)
6632
194
  {
6633
194
    *unpredictable_code = UNPRED_R13;
6634
194
    return true;
6635
194
  }
6636
215
      else
6637
215
  return false;
6638
6639
647
    case MVE_VREV64:
6640
647
      {
6641
647
  unsigned long qd = arm_decode_field_multiple (given, 13, 15, 22, 22);
6642
647
  unsigned long qm = arm_decode_field_multiple (given, 1, 3, 6, 6);
6643
6644
647
  if (qd == qm)
6645
276
    {
6646
276
      *unpredictable_code = UNPRED_Q_REGS_EQUAL;
6647
276
      return true;
6648
276
    }
6649
371
  else
6650
371
    return false;
6651
647
      }
6652
6653
422
    case MVE_LSLL:
6654
1.07k
    case MVE_LSLLI:
6655
1.86k
    case MVE_LSRL:
6656
2.32k
    case MVE_ASRL:
6657
2.89k
    case MVE_ASRLI:
6658
3.35k
    case MVE_UQSHLL:
6659
4.03k
    case MVE_UQRSHLL:
6660
4.67k
    case MVE_URSHRL:
6661
5.26k
    case MVE_SRSHRL:
6662
5.87k
    case MVE_SQSHLL:
6663
6.46k
    case MVE_SQRSHRL:
6664
6.46k
      {
6665
6.46k
  unsigned long gpr = arm_decode_field (given, 9, 11);
6666
6.46k
  gpr = ((gpr << 1) | 1);
6667
6.46k
  if (gpr == 0xd)
6668
2.57k
    {
6669
2.57k
      *unpredictable_code = UNPRED_R13;
6670
2.57k
      return true;
6671
2.57k
    }
6672
3.88k
  else if (gpr == 0xf)
6673
0
    {
6674
0
      *unpredictable_code = UNPRED_R15;
6675
0
      return true;
6676
0
    }
6677
6678
3.88k
  return false;
6679
6.46k
      }
6680
6681
82.0k
    default:
6682
82.0k
      return false;
6683
165k
    }
6684
165k
}
6685
6686
static void
6687
print_mve_vmov_index (struct disassemble_info *info, unsigned long given)
6688
2.26k
{
6689
2.26k
  unsigned long op1 = arm_decode_field (given, 21, 22);
6690
2.26k
  unsigned long op2 = arm_decode_field (given, 5, 6);
6691
2.26k
  unsigned long h = arm_decode_field (given, 16, 16);
6692
2.26k
  unsigned long index_operand, esize, targetBeat, idx;
6693
2.26k
  void *stream = info->stream;
6694
2.26k
  fprintf_styled_ftype func = info->fprintf_styled_func;
6695
6696
2.26k
  if ((op1 & 0x2) == 0x2)
6697
0
    {
6698
0
      index_operand = op2;
6699
0
      esize = 8;
6700
0
    }
6701
2.26k
  else if (((op1 & 0x2) == 0x0) && ((op2 & 0x1) == 0x1))
6702
0
    {
6703
0
      index_operand = op2  >> 1;
6704
0
      esize = 16;
6705
0
    }
6706
2.26k
  else if (((op1 & 0x2) == 0) && ((op2 & 0x3) == 0))
6707
0
    {
6708
0
      index_operand = 0;
6709
0
      esize = 32;
6710
0
    }
6711
2.26k
  else
6712
2.26k
    {
6713
2.26k
      func (stream, dis_style_text, "<undefined index>");
6714
2.26k
      return;
6715
2.26k
    }
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
10.9k
{
6729
10.9k
  int bits = 0;
6730
10.9k
  int cmode = (given >> 8) & 0xf;
6731
10.9k
  int op = (given >> 5) & 0x1;
6732
10.9k
  unsigned long value = 0, hival = 0;
6733
10.9k
  unsigned shift;
6734
10.9k
  int size = 0;
6735
10.9k
  int isfloat = 0;
6736
10.9k
  void *stream = info->stream;
6737
10.9k
  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
10.9k
  bits |= ((given >> ibit_loc) & 1) << 7;
6742
10.9k
  bits |= ((given >> 16) & 7) << 4;
6743
10.9k
  bits |= ((given >> 0) & 15) << 0;
6744
6745
10.9k
  if (cmode < 8)
6746
6.02k
    {
6747
6.02k
      shift = (cmode >> 1) & 3;
6748
6.02k
      value = (unsigned long) bits << (8 * shift);
6749
6.02k
      size = 32;
6750
6.02k
    }
6751
4.96k
  else if (cmode < 12)
6752
2.10k
    {
6753
2.10k
      shift = (cmode >> 1) & 1;
6754
2.10k
      value = (unsigned long) bits << (8 * shift);
6755
2.10k
      size = 16;
6756
2.10k
    }
6757
2.85k
  else if (cmode < 14)
6758
1.20k
    {
6759
1.20k
      shift = (cmode & 1) + 1;
6760
1.20k
      value = (unsigned long) bits << (8 * shift);
6761
1.20k
      value |= (1ul << (8 * shift)) - 1;
6762
1.20k
      size = 32;
6763
1.20k
    }
6764
1.65k
  else if (cmode == 14)
6765
1.34k
    {
6766
1.34k
      if (op)
6767
928
  {
6768
    /* Bit replication into bytes.  */
6769
928
    int ix;
6770
928
    unsigned long mask;
6771
6772
928
    value = 0;
6773
928
    hival = 0;
6774
8.35k
    for (ix = 7; ix >= 0; ix--)
6775
7.42k
      {
6776
7.42k
        mask = ((bits >> ix) & 1) ? 0xff : 0;
6777
7.42k
        if (ix <= 3)
6778
3.71k
    value = (value << 8) | mask;
6779
3.71k
        else
6780
3.71k
    hival = (hival << 8) | mask;
6781
7.42k
      }
6782
928
    size = 64;
6783
928
  }
6784
416
      else
6785
416
  {
6786
    /* Byte replication.  */
6787
416
    value = (unsigned long) bits;
6788
416
    size = 8;
6789
416
  }
6790
1.34k
    }
6791
313
  else if (!op)
6792
313
    {
6793
      /* Floating point encoding.  */
6794
313
      int tmp;
6795
6796
313
      value = (unsigned long)  (bits & 0x7f) << 19;
6797
313
      value |= (unsigned long) (bits & 0x80) << 24;
6798
313
      tmp = bits & 0x40 ? 0x3c : 0x40;
6799
313
      value |= (unsigned long) tmp << 24;
6800
313
      size = 32;
6801
313
      isfloat = 1;
6802
313
    }
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
10.9k
  unsigned printU = 0;
6814
10.9k
  switch (insn->mve_op)
6815
10.9k
    {
6816
0
    default:
6817
0
      break;
6818
    /* We want this for instructions that don't have a 'signed' type.  */
6819
2.86k
    case MVE_VBIC_IMM:
6820
3.24k
    case MVE_VORR_IMM:
6821
7.06k
    case MVE_VMVN_IMM:
6822
10.9k
    case MVE_VMOV_IMM_TO_VEC:
6823
10.9k
      printU = 1;
6824
10.9k
      break;
6825
10.9k
    }
6826
10.9k
  switch (size)
6827
10.9k
    {
6828
416
    case 8:
6829
416
      func (stream, dis_style_immediate, "#%ld", value);
6830
416
      func (stream, dis_style_comment_start, "\t@ 0x%.2lx", value);
6831
416
      break;
6832
6833
2.10k
    case 16:
6834
2.10k
      func (stream, dis_style_immediate, printU ? "#%lu" : "#%ld", value);
6835
2.10k
      func (stream, dis_style_comment_start, "\t@ 0x%.4lx", value);
6836
2.10k
      break;
6837
6838
7.54k
    case 32:
6839
7.54k
      if (isfloat)
6840
313
  {
6841
313
    unsigned char valbytes[4];
6842
313
    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
313
    valbytes[0] = value & 0xff;
6847
313
    valbytes[1] = (value >> 8) & 0xff;
6848
313
    valbytes[2] = (value >> 16) & 0xff;
6849
313
    valbytes[3] = (value >> 24) & 0xff;
6850
6851
313
    floatformat_to_double
6852
313
      (& floatformat_ieee_single_little, valbytes,
6853
313
       & fvalue);
6854
6855
313
    func (stream, dis_style_immediate, "#%.7g", fvalue);
6856
313
    func (stream, dis_style_comment_start, "\t@ 0x%.8lx", value);
6857
313
  }
6858
7.23k
      else
6859
7.23k
  {
6860
7.23k
    func (stream, dis_style_immediate,
6861
7.23k
    printU ? "#%lu" : "#%ld",
6862
7.23k
    (long) (((value & 0x80000000L) != 0)
6863
1.43k
      && !printU
6864
7.23k
      ? value | ~0xffffffffL : value));
6865
7.23k
    func (stream, dis_style_comment_start, "\t@ 0x%.8lx", value);
6866
7.23k
  }
6867
7.54k
      break;
6868
6869
928
    case 64:
6870
928
      func (stream, dis_style_immediate, "#0x%.8lx%.8lx", hival, value);
6871
928
      break;
6872
6873
0
    default:
6874
0
      abort ();
6875
10.9k
    }
6876
6877
10.9k
}
6878
6879
static void
6880
print_mve_undefined (struct disassemble_info *info,
6881
         enum mve_undefined undefined_code)
6882
20.2k
{
6883
20.2k
  void *stream = info->stream;
6884
20.2k
  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
20.2k
  const char *reason = "??";
6888
6889
20.2k
  switch (undefined_code)
6890
20.2k
    {
6891
816
    case UNDEF_SIZE:
6892
816
      reason = "illegal size";
6893
816
      break;
6894
6895
3.19k
    case UNDEF_SIZE_0:
6896
3.19k
      reason = "size equals zero";
6897
3.19k
      break;
6898
6899
806
    case UNDEF_SIZE_2:
6900
806
      reason = "size equals two";
6901
806
      break;
6902
6903
6.93k
    case UNDEF_SIZE_3:
6904
6.93k
      reason = "size equals three";
6905
6.93k
      break;
6906
6907
799
    case UNDEF_SIZE_LE_1:
6908
799
      reason = "size <= 1";
6909
799
      break;
6910
6911
300
    case UNDEF_SIZE_NOT_0:
6912
300
      reason = "size not equal to 0";
6913
300
      break;
6914
6915
1.03k
    case UNDEF_SIZE_NOT_2:
6916
1.03k
      reason = "size not equal to 2";
6917
1.03k
      break;
6918
6919
0
    case UNDEF_SIZE_NOT_3:
6920
0
      reason = "size not equal to 3";
6921
0
      break;
6922
6923
305
    case UNDEF_NOT_UNS_SIZE_0:
6924
305
      reason = "not unsigned and size = zero";
6925
305
      break;
6926
6927
326
    case UNDEF_NOT_UNS_SIZE_1:
6928
326
      reason = "not unsigned and size = one";
6929
326
      break;
6930
6931
307
    case UNDEF_NOT_UNSIGNED:
6932
307
      reason = "not unsigned";
6933
307
      break;
6934
6935
409
    case UNDEF_VCVT_IMM6:
6936
409
      reason = "invalid imm6";
6937
409
      break;
6938
6939
1.10k
    case UNDEF_VCVT_FSI_IMM6:
6940
1.10k
      reason = "fsi = 0 and invalid imm6";
6941
1.10k
      break;
6942
6943
2.26k
    case UNDEF_BAD_OP1_OP2:
6944
2.26k
      reason = "bad size with op2 = 2 and op1 = 0 or 1";
6945
2.26k
      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.03k
    case UNDEF_XCHG_UNS:
6956
1.03k
      reason = "exchange and unsigned together";
6957
1.03k
      break;
6958
6959
634
    case UNDEF_NONE:
6960
634
      reason = "";
6961
634
      break;
6962
20.2k
    }
6963
6964
20.2k
  func (stream, dis_style_text, "\t\tundefined instruction: %s", reason);
6965
20.2k
}
6966
6967
static void
6968
print_mve_unpredictable (struct disassemble_info *info,
6969
       enum mve_unpredictable unpredict_code)
6970
33.2k
{
6971
33.2k
  void *stream = info->stream;
6972
33.2k
  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
33.2k
  const char *reason = "??";
6976
6977
33.2k
  switch (unpredict_code)
6978
33.2k
    {
6979
1.93k
    case UNPRED_IT_BLOCK:
6980
1.93k
      reason = "mve instruction in it block";
6981
1.93k
      break;
6982
6983
492
    case UNPRED_FCA_0_FCB_1:
6984
492
      reason = "condition bits, fca = 0 and fcb = 1";
6985
492
      break;
6986
6987
9.01k
    case UNPRED_R13:
6988
9.01k
      reason = "use of r13 (sp)";
6989
9.01k
      break;
6990
6991
11.1k
    case UNPRED_R15:
6992
11.1k
      reason = "use of r15 (pc)";
6993
11.1k
      break;
6994
6995
309
    case UNPRED_Q_GT_4:
6996
309
      reason = "start register block > r4";
6997
309
      break;
6998
6999
542
    case UNPRED_Q_GT_6:
7000
542
      reason = "start register block > r6";
7001
542
      break;
7002
7003
1.25k
    case UNPRED_R13_AND_WB:
7004
1.25k
      reason = "use of r13 and write back";
7005
1.25k
      break;
7006
7007
1.10k
    case UNPRED_Q_REGS_EQUAL:
7008
1.10k
      reason = "same vector register used for destination and other operand";
7009
1.10k
      break;
7010
7011
1.21k
    case UNPRED_OS:
7012
1.21k
      reason = "use of offset scaled";
7013
1.21k
      break;
7014
7015
284
    case UNPRED_GP_REGS_EQUAL:
7016
284
      reason = "same general-purpose register used for both operands";
7017
284
      break;
7018
7019
2.11k
    case UNPRED_Q_REGS_EQ_AND_SIZE_1:
7020
2.11k
      reason = "use of identical q registers and size = 1";
7021
2.11k
      break;
7022
7023
797
    case UNPRED_Q_REGS_EQ_AND_SIZE_2:
7024
797
      reason = "use of identical q registers and size = 1";
7025
797
      break;
7026
7027
3.07k
    case UNPRED_NONE:
7028
3.07k
      reason = "";
7029
3.07k
      break;
7030
33.2k
    }
7031
7032
33.2k
  func (stream, dis_style_comment_start, "%s: %s",
7033
33.2k
  UNPREDICTABLE_INSTRUCTION, reason);
7034
33.2k
}
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.40k
{
7043
3.40k
  void *stream = info->stream;
7044
3.40k
  fprintf_styled_ftype func = info->fprintf_styled_func;
7045
7046
3.40k
  unsigned long q_reg_start = arm_decode_field_multiple (given,
7047
3.40k
               13, 15,
7048
3.40k
               22, 22);
7049
3.40k
  switch (matched_insn)
7050
3.40k
    {
7051
892
    case MVE_VLD2:
7052
2.21k
    case MVE_VST2:
7053
2.21k
      if (q_reg_start <= 6)
7054
873
  {
7055
873
    func (stream, dis_style_text, "{");
7056
873
    func (stream, dis_style_register, "q%ld", q_reg_start);
7057
873
    func (stream, dis_style_text, ", ");
7058
873
    func (stream, dis_style_register, "q%ld", q_reg_start + 1);
7059
873
    func (stream, dis_style_text, "}");
7060
873
  }
7061
1.34k
      else
7062
1.34k
  func (stream, dis_style_text, "<illegal reg q%ld>", q_reg_start);
7063
2.21k
      break;
7064
7065
396
    case MVE_VLD4:
7066
1.18k
    case MVE_VST4:
7067
1.18k
      if (q_reg_start <= 4)
7068
499
  {
7069
499
    func (stream, dis_style_text, "{");
7070
499
    func (stream, dis_style_register, "q%ld", q_reg_start);
7071
499
    func (stream, dis_style_text, ", ");
7072
499
    func (stream, dis_style_register, "q%ld", q_reg_start + 1);
7073
499
    func (stream, dis_style_text, ", ");
7074
499
    func (stream, dis_style_register, "q%ld", q_reg_start + 2);
7075
499
    func (stream, dis_style_text, ", ");
7076
499
    func (stream, dis_style_register, "q%ld", q_reg_start + 3);
7077
499
    func (stream, dis_style_text, "}");
7078
499
  }
7079
686
      else
7080
686
  func (stream, dis_style_text, "<illegal reg q%ld>", q_reg_start);
7081
1.18k
      break;
7082
7083
0
    default:
7084
0
      break;
7085
3.40k
    }
7086
3.40k
}
7087
7088
static void
7089
print_mve_rounding_mode (struct disassemble_info *info,
7090
       unsigned long given,
7091
       enum mve_instructions matched_insn)
7092
6.95k
{
7093
6.95k
  void *stream = info->stream;
7094
6.95k
  fprintf_styled_ftype func = info->fprintf_styled_func;
7095
7096
6.95k
  switch (matched_insn)
7097
6.95k
    {
7098
4.25k
    case MVE_VCVT_FROM_FP_TO_INT:
7099
4.25k
      {
7100
4.25k
  switch (arm_decode_field (given, 8, 9))
7101
4.25k
    {
7102
1.28k
    case 0:
7103
1.28k
      func (stream, dis_style_mnemonic, "a");
7104
1.28k
      break;
7105
7106
1.11k
    case 1:
7107
1.11k
      func (stream, dis_style_mnemonic, "n");
7108
1.11k
      break;
7109
7110
1.35k
    case 2:
7111
1.35k
      func (stream, dis_style_mnemonic, "p");
7112
1.35k
      break;
7113
7114
496
    case 3:
7115
496
      func (stream, dis_style_mnemonic, "m");
7116
496
      break;
7117
7118
0
    default:
7119
0
      break;
7120
4.25k
    }
7121
4.25k
      }
7122
4.25k
      break;
7123
7124
4.25k
    case MVE_VRINT_FP:
7125
2.70k
      {
7126
2.70k
  switch (arm_decode_field (given, 7, 9))
7127
2.70k
    {
7128
307
    case 0:
7129
307
      func (stream, dis_style_mnemonic, "n");
7130
307
      break;
7131
7132
863
    case 1:
7133
863
      func (stream, dis_style_mnemonic, "x");
7134
863
      break;
7135
7136
216
    case 2:
7137
216
      func (stream, dis_style_mnemonic, "a");
7138
216
      break;
7139
7140
467
    case 3:
7141
467
      func (stream, dis_style_mnemonic, "z");
7142
467
      break;
7143
7144
257
    case 5:
7145
257
      func (stream, dis_style_mnemonic, "m");
7146
257
      break;
7147
7148
294
    case 7:
7149
294
      func (stream, dis_style_mnemonic, "p");
7150
7151
398
    case 4:
7152
591
    case 6:
7153
591
    default:
7154
591
      break;
7155
2.70k
    }
7156
2.70k
      }
7157
2.70k
      break;
7158
7159
2.70k
    default:
7160
0
      break;
7161
6.95k
    }
7162
6.95k
}
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.0k
{
7169
14.0k
  unsigned long mode = 0;
7170
14.0k
  void *stream = info->stream;
7171
14.0k
  fprintf_styled_ftype func = info->fprintf_styled_func;
7172
7173
14.0k
  switch (matched_insn)
7174
14.0k
    {
7175
4.91k
    case MVE_VCVT_FP_FIX_VEC:
7176
4.91k
      {
7177
4.91k
  mode = (((given & 0x200) >> 7)
7178
4.91k
    | ((given & 0x10000000) >> 27)
7179
4.91k
    | ((given & 0x100) >> 8));
7180
7181
4.91k
  switch (mode)
7182
4.91k
    {
7183
298
    case 0:
7184
298
      func (stream, dis_style_mnemonic, "f16.s16");
7185
298
      break;
7186
7187
236
    case 1:
7188
236
      func (stream, dis_style_mnemonic, "s16.f16");
7189
236
      break;
7190
7191
277
    case 2:
7192
277
      func (stream, dis_style_mnemonic, "f16.u16");
7193
277
      break;
7194
7195
675
    case 3:
7196
675
      func (stream, dis_style_mnemonic, "u16.f16");
7197
675
      break;
7198
7199
817
    case 4:
7200
817
      func (stream, dis_style_mnemonic, "f32.s32");
7201
817
      break;
7202
7203
309
    case 5:
7204
309
      func (stream, dis_style_mnemonic, "s32.f32");
7205
309
      break;
7206
7207
307
    case 6:
7208
307
      func (stream, dis_style_mnemonic, "f32.u32");
7209
307
      break;
7210
7211
1.99k
    case 7:
7212
1.99k
      func (stream, dis_style_mnemonic, "u32.f32");
7213
1.99k
      break;
7214
7215
0
    default:
7216
0
      break;
7217
4.91k
    }
7218
4.91k
  break;
7219
4.91k
      }
7220
4.91k
    case MVE_VCVT_BETWEEN_FP_INT:
7221
3.66k
      {
7222
3.66k
  unsigned long size = arm_decode_field (given, 18, 19);
7223
3.66k
  unsigned long op = arm_decode_field (given, 7, 8);
7224
7225
3.66k
  if (size == 1)
7226
1.41k
    {
7227
1.41k
      switch (op)
7228
1.41k
        {
7229
549
        case 0:
7230
549
    func (stream, dis_style_mnemonic, "f16.s16");
7231
549
    break;
7232
7233
308
        case 1:
7234
308
    func (stream, dis_style_mnemonic, "f16.u16");
7235
308
    break;
7236
7237
226
        case 2:
7238
226
    func (stream, dis_style_mnemonic, "s16.f16");
7239
226
    break;
7240
7241
333
        case 3:
7242
333
    func (stream, dis_style_mnemonic, "u16.f16");
7243
333
    break;
7244
7245
0
        default:
7246
0
    break;
7247
1.41k
        }
7248
1.41k
    }
7249
2.24k
  else if (size == 2)
7250
1.66k
    {
7251
1.66k
      switch (op)
7252
1.66k
        {
7253
228
        case 0:
7254
228
    func (stream, dis_style_mnemonic, "f32.s32");
7255
228
    break;
7256
7257
235
        case 1:
7258
235
    func (stream, dis_style_mnemonic, "f32.u32");
7259
235
    break;
7260
7261
284
        case 2:
7262
284
    func (stream, dis_style_mnemonic, "s32.f32");
7263
284
    break;
7264
7265
916
        case 3:
7266
916
    func (stream, dis_style_mnemonic, "u32.f32");
7267
916
    break;
7268
1.66k
        }
7269
1.66k
    }
7270
3.66k
      }
7271
3.66k
      break;
7272
7273
3.66k
    case MVE_VCVT_FP_HALF_FP:
7274
1.19k
      {
7275
1.19k
  unsigned long op = arm_decode_field (given, 28, 28);
7276
1.19k
  if (op == 0)
7277
608
    func (stream, dis_style_mnemonic, "f16.f32");
7278
591
  else if (op == 1)
7279
591
    func (stream, dis_style_mnemonic, "f32.f16");
7280
1.19k
      }
7281
1.19k
      break;
7282
7283
4.25k
    case MVE_VCVT_FROM_FP_TO_INT:
7284
4.25k
      {
7285
4.25k
  unsigned long size = arm_decode_field_multiple (given, 7, 7, 18, 19);
7286
7287
4.25k
  switch (size)
7288
4.25k
    {
7289
568
    case 2:
7290
568
      func (stream, dis_style_mnemonic, "s16.f16");
7291
568
      break;
7292
7293
655
    case 3:
7294
655
      func (stream, dis_style_mnemonic, "u16.f16");
7295
655
      break;
7296
7297
969
    case 4:
7298
969
      func (stream, dis_style_mnemonic, "s32.f32");
7299
969
      break;
7300
7301
251
    case 5:
7302
251
      func (stream, dis_style_mnemonic, "u32.f32");
7303
251
      break;
7304
7305
1.80k
    default:
7306
1.80k
      break;
7307
4.25k
    }
7308
4.25k
      }
7309
4.25k
      break;
7310
7311
4.25k
    default:
7312
0
      break;
7313
14.0k
    }
7314
14.0k
}
7315
7316
static void
7317
print_mve_rotate (struct disassemble_info *info, unsigned long rot,
7318
      unsigned long rot_width)
7319
7.31k
{
7320
7.31k
  void *stream = info->stream;
7321
7.31k
  fprintf_styled_ftype func = info->fprintf_styled_func;
7322
7323
7.31k
  if (rot_width == 1)
7324
3.47k
    {
7325
3.47k
      switch (rot)
7326
3.47k
  {
7327
2.10k
  case 0:
7328
2.10k
    func (stream, dis_style_immediate, "90");
7329
2.10k
    break;
7330
1.36k
  case 1:
7331
1.36k
    func (stream, dis_style_immediate, "270");
7332
1.36k
    break;
7333
0
  default:
7334
0
    break;
7335
3.47k
  }
7336
3.47k
    }
7337
3.84k
  else if (rot_width == 2)
7338
3.84k
    {
7339
3.84k
      switch (rot)
7340
3.84k
  {
7341
445
  case 0:
7342
445
    func (stream, dis_style_immediate, "0");
7343
445
    break;
7344
1.87k
  case 1:
7345
1.87k
    func (stream, dis_style_immediate, "90");
7346
1.87k
    break;
7347
496
  case 2:
7348
496
    func (stream, dis_style_immediate, "180");
7349
496
    break;
7350
1.02k
  case 3:
7351
1.02k
    func (stream, dis_style_immediate, "270");
7352
1.02k
    break;
7353
0
  default:
7354
0
    break;
7355
3.84k
  }
7356
3.84k
    }
7357
7.31k
}
7358
7359
static void
7360
print_instruction_predicate (struct disassemble_info *info)
7361
132k
{
7362
132k
  void *stream = info->stream;
7363
132k
  fprintf_styled_ftype func = info->fprintf_styled_func;
7364
7365
132k
  if (vpt_block_state.next_pred_state == PRED_THEN)
7366
4.45k
    func (stream, dis_style_mnemonic, "t");
7367
127k
  else if (vpt_block_state.next_pred_state == PRED_ELSE)
7368
2.54k
    func (stream, dis_style_mnemonic, "e");
7369
132k
}
7370
7371
static void
7372
print_mve_size (struct disassemble_info *info,
7373
    unsigned long size,
7374
    enum mve_instructions matched_insn)
7375
118k
{
7376
118k
  void *stream = info->stream;
7377
118k
  fprintf_styled_ftype func = info->fprintf_styled_func;
7378
7379
118k
  switch (matched_insn)
7380
118k
    {
7381
696
    case MVE_VABAV:
7382
1.17k
    case MVE_VABD_VEC:
7383
1.40k
    case MVE_VABS_FP:
7384
2.05k
    case MVE_VABS_VEC:
7385
2.40k
    case MVE_VADD_VEC_T1:
7386
2.93k
    case MVE_VADD_VEC_T2:
7387
3.19k
    case MVE_VADDV:
7388
4.05k
    case MVE_VBRSR:
7389
4.99k
    case MVE_VCADD_VEC:
7390
5.27k
    case MVE_VCLS:
7391
5.50k
    case MVE_VCLZ:
7392
5.81k
    case MVE_VCMP_VEC_T1:
7393
6.13k
    case MVE_VCMP_VEC_T2:
7394
6.36k
    case MVE_VCMP_VEC_T3:
7395
6.73k
    case MVE_VCMP_VEC_T4:
7396
7.12k
    case MVE_VCMP_VEC_T5:
7397
7.39k
    case MVE_VCMP_VEC_T6:
7398
7.80k
    case MVE_VCTP:
7399
8.86k
    case MVE_VDDUP:
7400
9.84k
    case MVE_VDWDUP:
7401
10.7k
    case MVE_VHADD_T1:
7402
11.4k
    case MVE_VHADD_T2:
7403
13.1k
    case MVE_VHCADD:
7404
13.6k
    case MVE_VHSUB_T1:
7405
14.2k
    case MVE_VHSUB_T2:
7406
14.7k
    case MVE_VIDUP:
7407
15.6k
    case MVE_VIWDUP:
7408
16.5k
    case MVE_VLD2:
7409
16.9k
    case MVE_VLD4:
7410
18.2k
    case MVE_VLDRB_GATHER_T1:
7411
20.3k
    case MVE_VLDRH_GATHER_T2:
7412
20.3k
    case MVE_VLDRW_GATHER_T3:
7413
20.3k
    case MVE_VLDRD_GATHER_T4:
7414
21.1k
    case MVE_VLDRB_T1:
7415
21.8k
    case MVE_VLDRH_T2:
7416
22.3k
    case MVE_VMAX:
7417
22.6k
    case MVE_VMAXA:
7418
23.4k
    case MVE_VMAXV:
7419
23.8k
    case MVE_VMAXAV:
7420
24.3k
    case MVE_VMIN:
7421
24.6k
    case MVE_VMINA:
7422
25.0k
    case MVE_VMINV:
7423
25.4k
    case MVE_VMINAV:
7424
26.1k
    case MVE_VMLA:
7425
26.6k
    case MVE_VMLAS:
7426
26.9k
    case MVE_VMUL_VEC_T1:
7427
27.5k
    case MVE_VMUL_VEC_T2:
7428
28.2k
    case MVE_VMULH:
7429
29.3k
    case MVE_VRMULH:
7430
30.7k
    case MVE_VMULL_INT:
7431
31.0k
    case MVE_VNEG_FP:
7432
31.6k
    case MVE_VNEG_VEC:
7433
32.7k
    case MVE_VPT_VEC_T1:
7434
33.7k
    case MVE_VPT_VEC_T2:
7435
34.9k
    case MVE_VPT_VEC_T3:
7436
36.1k
    case MVE_VPT_VEC_T4:
7437
37.4k
    case MVE_VPT_VEC_T5:
7438
38.9k
    case MVE_VPT_VEC_T6:
7439
39.3k
    case MVE_VQABS:
7440
40.5k
    case MVE_VQADD_T1:
7441
41.2k
    case MVE_VQADD_T2:
7442
41.8k
    case MVE_VQDMLADH:
7443
42.5k
    case MVE_VQRDMLADH:
7444
43.4k
    case MVE_VQDMLAH:
7445
43.8k
    case MVE_VQRDMLAH:
7446
44.1k
    case MVE_VQDMLASH:
7447
44.8k
    case MVE_VQRDMLASH:
7448
45.1k
    case MVE_VQDMLSDH:
7449
46.3k
    case MVE_VQRDMLSDH:
7450
46.6k
    case MVE_VQDMULH_T1:
7451
47.0k
    case MVE_VQRDMULH_T2:
7452
47.7k
    case MVE_VQDMULH_T3:
7453
48.5k
    case MVE_VQRDMULH_T4:
7454
48.8k
    case MVE_VQNEG:
7455
49.2k
    case MVE_VQRSHL_T1:
7456
49.5k
    case MVE_VQRSHL_T2:
7457
49.7k
    case MVE_VQSHL_T1:
7458
50.1k
    case MVE_VQSHL_T4:
7459
50.3k
    case MVE_VQSUB_T1:
7460
50.9k
    case MVE_VQSUB_T2:
7461
51.5k
    case MVE_VREV32:
7462
52.1k
    case MVE_VREV64:
7463
53.4k
    case MVE_VRHADD:
7464
56.1k
    case MVE_VRINT_FP:
7465
56.5k
    case MVE_VRSHL_T1:
7466
56.7k
    case MVE_VRSHL_T2:
7467
57.1k
    case MVE_VSHL_T2:
7468
57.7k
    case MVE_VSHL_T3:
7469
58.0k
    case MVE_VSHLL_T2:
7470
59.4k
    case MVE_VST2:
7471
60.2k
    case MVE_VST4:
7472
62.0k
    case MVE_VSTRB_SCATTER_T1:
7473
63.0k
    case MVE_VSTRH_SCATTER_T2:
7474
64.4k
    case MVE_VSTRW_SCATTER_T3:
7475
65.2k
    case MVE_VSTRB_T1:
7476
66.0k
    case MVE_VSTRH_T2:
7477
66.3k
    case MVE_VSUB_VEC_T1:
7478
66.6k
    case MVE_VSUB_VEC_T2:
7479
66.6k
      if (size <= 3)
7480
66.6k
  func (stream, dis_style_mnemonic, "%s", mve_vec_sizename[size]);
7481
0
      else
7482
0
  func (stream, dis_style_text, "<undef size>");
7483
66.6k
      break;
7484
7485
304
    case MVE_VABD_FP:
7486
631
    case MVE_VADD_FP_T1:
7487
1.06k
    case MVE_VADD_FP_T2:
7488
1.34k
    case MVE_VSUB_FP_T1:
7489
1.68k
    case MVE_VSUB_FP_T2:
7490
2.17k
    case MVE_VCMP_FP_T1:
7491
2.64k
    case MVE_VCMP_FP_T2:
7492
3.03k
    case MVE_VFMA_FP_SCALAR:
7493
3.38k
    case MVE_VFMA_FP:
7494
3.66k
    case MVE_VFMS_FP:
7495
4.20k
    case MVE_VFMAS_FP_SCALAR:
7496
4.91k
    case MVE_VMAXNM_FP:
7497
5.56k
    case MVE_VMAXNMA_FP:
7498
5.83k
    case MVE_VMAXNMV_FP:
7499
6.23k
    case MVE_VMAXNMAV_FP:
7500
6.55k
    case MVE_VMINNM_FP:
7501
7.02k
    case MVE_VMINNMA_FP:
7502
7.46k
    case MVE_VMINNMV_FP:
7503
7.76k
    case MVE_VMINNMAV_FP:
7504
8.01k
    case MVE_VMUL_FP_T1:
7505
8.31k
    case MVE_VMUL_FP_T2:
7506
10.5k
    case MVE_VPT_FP_T1:
7507
13.3k
    case MVE_VPT_FP_T2:
7508
13.3k
      if (size == 0)
7509
8.37k
  func (stream, dis_style_mnemonic, "32");
7510
4.97k
      else if (size == 1)
7511
4.97k
  func (stream, dis_style_mnemonic, "16");
7512
13.3k
      break;
7513
7514
842
    case MVE_VCADD_FP:
7515
3.14k
    case MVE_VCMLA_FP:
7516
4.68k
    case MVE_VCMUL_FP:
7517
5.37k
    case MVE_VMLADAV_T1:
7518
6.48k
    case MVE_VMLALDAV:
7519
6.86k
    case MVE_VMLSDAV_T1:
7520
7.66k
    case MVE_VMLSLDAV:
7521
8.16k
    case MVE_VMOVN:
7522
9.06k
    case MVE_VQDMULL_T1:
7523
11.1k
    case MVE_VQDMULL_T2:
7524
11.6k
    case MVE_VQMOVN:
7525
12.1k
    case MVE_VQMOVUN:
7526
12.1k
      if (size == 0)
7527
4.62k
  func (stream, dis_style_mnemonic, "16");
7528
7.47k
      else if (size == 1)
7529
6.72k
  func (stream, dis_style_mnemonic, "32");
7530
12.1k
      break;
7531
7532
1.18k
    case MVE_VMOVL:
7533
1.18k
      if (size == 1)
7534
285
  func (stream, dis_style_mnemonic, "8");
7535
897
      else if (size == 2)
7536
897
  func (stream, dis_style_mnemonic, "16");
7537
1.18k
      break;
7538
7539
1.40k
    case MVE_VDUP:
7540
1.40k
      switch (size)
7541
1.40k
  {
7542
214
  case 0:
7543
214
    func (stream, dis_style_mnemonic, "32");
7544
214
    break;
7545
236
  case 1:
7546
236
    func (stream, dis_style_mnemonic, "16");
7547
236
    break;
7548
719
  case 2:
7549
719
    func (stream, dis_style_mnemonic, "8");
7550
719
    break;
7551
240
  default:
7552
240
    break;
7553
1.40k
  }
7554
1.40k
      break;
7555
7556
1.40k
    case MVE_VMOV_GP_TO_VEC_LANE:
7557
2.26k
    case MVE_VMOV_VEC_LANE_TO_GP:
7558
2.26k
      switch (size)
7559
2.26k
  {
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
2.26k
  default:
7575
2.26k
    break;
7576
2.26k
  }
7577
2.26k
      break;
7578
7579
3.92k
    case MVE_VMOV_IMM_TO_VEC:
7580
3.92k
      switch (size)
7581
3.92k
  {
7582
1.00k
  case 0: case 4: case 8:
7583
1.80k
  case 12: case 24: case 26:
7584
1.80k
    func (stream, dis_style_mnemonic, "i32");
7585
1.80k
    break;
7586
467
  case 16: case 20:
7587
467
    func (stream, dis_style_mnemonic, "i16");
7588
467
    break;
7589
416
  case 28:
7590
416
    func (stream, dis_style_mnemonic, "i8");
7591
416
    break;
7592
928
  case 29:
7593
928
    func (stream, dis_style_mnemonic, "i64");
7594
928
    break;
7595
313
  case 30:
7596
313
    func (stream, dis_style_mnemonic, "f32");
7597
313
    break;
7598
0
  default:
7599
0
    break;
7600
3.92k
  }
7601
3.92k
      break;
7602
7603
3.92k
    case MVE_VMULL_POLY:
7604
1.71k
      if (size == 0)
7605
757
  func (stream, dis_style_mnemonic, "p8");
7606
956
      else if (size == 1)
7607
956
  func (stream, dis_style_mnemonic, "p16");
7608
1.71k
      break;
7609
7610
3.82k
    case MVE_VMVN_IMM:
7611
3.82k
      switch (size)
7612
3.82k
  {
7613
2.32k
  case 0: case 2: case 4:
7614
3.26k
  case 6: case 12: case 13:
7615
3.26k
    func (stream, dis_style_mnemonic, "32");
7616
3.26k
    break;
7617
7618
559
  case 8: case 10:
7619
559
    func (stream, dis_style_mnemonic, "16");
7620
559
    break;
7621
7622
0
  default:
7623
0
    break;
7624
3.82k
  }
7625
3.82k
      break;
7626
7627
3.82k
    case MVE_VBIC_IMM:
7628
3.24k
    case MVE_VORR_IMM:
7629
3.24k
      switch (size)
7630
3.24k
  {
7631
898
  case 1: case 3:
7632
2.16k
  case 5: case 7:
7633
2.16k
    func (stream, dis_style_mnemonic, "32");
7634
2.16k
    break;
7635
7636
1.08k
  case 9: case 11:
7637
1.08k
    func (stream, dis_style_mnemonic, "16");
7638
1.08k
    break;
7639
7640
0
  default:
7641
0
    break;
7642
3.24k
  }
7643
3.24k
      break;
7644
7645
3.24k
    case MVE_VQSHRN:
7646
854
    case MVE_VQSHRUN:
7647
1.27k
    case MVE_VQRSHRN:
7648
1.81k
    case MVE_VQRSHRUN:
7649
2.17k
    case MVE_VRSHRN:
7650
2.56k
    case MVE_VSHRN:
7651
2.56k
      {
7652
2.56k
  switch (size)
7653
2.56k
  {
7654
1.01k
  case 1:
7655
1.01k
    func (stream, dis_style_mnemonic, "16");
7656
1.01k
    break;
7657
7658
1.06k
  case 2: case 3:
7659
1.06k
    func (stream, dis_style_mnemonic, "32");
7660
1.06k
    break;
7661
7662
481
  default:
7663
481
    break;
7664
2.56k
  }
7665
2.56k
      }
7666
2.56k
      break;
7667
7668
2.56k
    case MVE_VQSHL_T2:
7669
1.44k
    case MVE_VQSHLU_T3:
7670
2.06k
    case MVE_VRSHR:
7671
3.07k
    case MVE_VSHL_T1:
7672
4.30k
    case MVE_VSHLL_T1:
7673
5.54k
    case MVE_VSHR:
7674
5.80k
    case MVE_VSLI:
7675
6.17k
    case MVE_VSRI:
7676
6.17k
      {
7677
6.17k
  switch (size)
7678
6.17k
  {
7679
825
  case 1:
7680
825
    func (stream, dis_style_mnemonic, "8");
7681
825
    break;
7682
7683
1.49k
  case 2: case 3:
7684
1.49k
    func (stream, dis_style_mnemonic, "16");
7685
1.49k
    break;
7686
7687
3.19k
  case 4: case 5: case 6: case 7:
7688
3.19k
    func (stream, dis_style_mnemonic, "32");
7689
3.19k
    break;
7690
7691
667
  default:
7692
667
    break;
7693
6.17k
  }
7694
6.17k
      }
7695
6.17k
      break;
7696
7697
6.17k
    default:
7698
0
      break;
7699
118k
    }
7700
118k
}
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
13.2k
{
7708
13.2k
  switch (insn)
7709
13.2k
    {
7710
589
    case MVE_VQSHL_T2:
7711
1.44k
    case MVE_VQSHLU_T3:
7712
1.81k
    case MVE_VQSHRN:
7713
2.29k
    case MVE_VQSHRUN:
7714
2.71k
    case MVE_VQRSHRN:
7715
3.25k
    case MVE_VQRSHRUN:
7716
3.88k
    case MVE_VRSHR:
7717
4.24k
    case MVE_VRSHRN:
7718
5.25k
    case MVE_VSHL_T1:
7719
6.48k
    case MVE_VSHLL_T1:
7720
7.71k
    case MVE_VSHR:
7721
8.10k
    case MVE_VSHRN:
7722
8.36k
    case MVE_VSLI:
7723
8.73k
    case MVE_VSRI:
7724
8.73k
      return true;
7725
4.46k
    default:
7726
4.46k
      return false;
7727
13.2k
    }
7728
13.2k
}
7729
7730
static void
7731
print_mve_shift_n (struct disassemble_info *info, long given,
7732
       enum mve_instructions matched_insn)
7733
8.73k
{
7734
8.73k
  void *stream = info->stream;
7735
8.73k
  fprintf_styled_ftype func = info->fprintf_styled_func;
7736
7737
8.73k
  int startAt0
7738
8.73k
    = matched_insn == MVE_VQSHL_T2
7739
8.15k
      || matched_insn == MVE_VQSHLU_T3
7740
7.29k
      || matched_insn == MVE_VSHL_T1
7741
6.29k
      || matched_insn == MVE_VSHLL_T1
7742
5.06k
      || matched_insn == MVE_VSLI;
7743
7744
8.73k
  unsigned imm6 = (given & 0x3f0000) >> 16;
7745
7746
8.73k
  if (matched_insn == MVE_VSHLL_T1)
7747
1.22k
    imm6 &= 0x1f;
7748
7749
8.73k
  unsigned shiftAmount = 0;
7750
8.73k
  if ((imm6 & 0x20) != 0)
7751
3.19k
    shiftAmount = startAt0 ? imm6 - 32 : 64 - imm6;
7752
5.54k
  else if ((imm6 & 0x10) != 0)
7753
2.55k
    shiftAmount = startAt0 ? imm6 - 16 : 32 - imm6;
7754
2.98k
  else if ((imm6 & 0x08) != 0)
7755
1.84k
    shiftAmount = startAt0 ? imm6 - 8 : 16 - imm6;
7756
1.14k
  else
7757
1.14k
    print_mve_undefined (info, UNDEF_SIZE_0);
7758
7759
8.73k
  func (stream, dis_style_immediate, "%u", shiftAmount);
7760
8.73k
}
7761
7762
static void
7763
print_vec_condition (struct disassemble_info *info, long given,
7764
         enum mve_instructions matched_insn)
7765
15.1k
{
7766
15.1k
  void *stream = info->stream;
7767
15.1k
  fprintf_styled_ftype func = info->fprintf_styled_func;
7768
15.1k
  long vec_cond = 0;
7769
7770
15.1k
  switch (matched_insn)
7771
15.1k
    {
7772
2.22k
    case MVE_VPT_FP_T1:
7773
2.72k
    case MVE_VCMP_FP_T1:
7774
2.72k
      vec_cond = (((given & 0x1000) >> 10)
7775
2.72k
      | ((given & 1) << 1)
7776
2.72k
      | ((given & 0x0080) >> 7));
7777
2.72k
      func (stream, dis_style_sub_mnemonic, "%s", vec_condnames[vec_cond]);
7778
2.72k
      break;
7779
7780
2.80k
    case MVE_VPT_FP_T2:
7781
3.27k
    case MVE_VCMP_FP_T2:
7782
3.27k
      vec_cond = (((given & 0x1000) >> 10)
7783
3.27k
      | ((given & 0x0020) >> 4)
7784
3.27k
      | ((given & 0x0080) >> 7));
7785
3.27k
      func (stream, dis_style_sub_mnemonic, "%s", vec_condnames[vec_cond]);
7786
3.27k
      break;
7787
7788
1.07k
    case MVE_VPT_VEC_T1:
7789
1.38k
    case MVE_VCMP_VEC_T1:
7790
1.38k
      vec_cond = (given & 0x0080) >> 7;
7791
1.38k
      func (stream, dis_style_sub_mnemonic, "%s", vec_condnames[vec_cond]);
7792
1.38k
      break;
7793
7794
951
    case MVE_VPT_VEC_T2:
7795
1.27k
    case MVE_VCMP_VEC_T2:
7796
1.27k
      vec_cond = 2 | ((given & 0x0080) >> 7);
7797
1.27k
      func (stream, dis_style_sub_mnemonic, "%s", vec_condnames[vec_cond]);
7798
1.27k
      break;
7799
7800
1.25k
    case MVE_VPT_VEC_T3:
7801
1.48k
    case MVE_VCMP_VEC_T3:
7802
1.48k
      vec_cond = 4 | ((given & 1) << 1) | ((given & 0x0080) >> 7);
7803
1.48k
      func (stream, dis_style_sub_mnemonic, "%s", vec_condnames[vec_cond]);
7804
1.48k
      break;
7805
7806
1.18k
    case MVE_VPT_VEC_T4:
7807
1.56k
    case MVE_VCMP_VEC_T4:
7808
1.56k
      vec_cond = (given & 0x0080) >> 7;
7809
1.56k
      func (stream, dis_style_sub_mnemonic, "%s", vec_condnames[vec_cond]);
7810
1.56k
      break;
7811
7812
1.32k
    case MVE_VPT_VEC_T5:
7813
1.70k
    case MVE_VCMP_VEC_T5:
7814
1.70k
      vec_cond = 2 | ((given & 0x0080) >> 7);
7815
1.70k
      func (stream, dis_style_sub_mnemonic, "%s", vec_condnames[vec_cond]);
7816
1.70k
      break;
7817
7818
1.45k
    case MVE_VPT_VEC_T6:
7819
1.72k
    case MVE_VCMP_VEC_T6:
7820
1.72k
      vec_cond = 4 | ((given & 0x0020) >> 4) | ((given & 0x0080) >> 7);
7821
1.72k
      func (stream, dis_style_sub_mnemonic, "%s", vec_condnames[vec_cond]);
7822
1.72k
      break;
7823
7824
0
    case MVE_NONE:
7825
0
    case MVE_VPST:
7826
0
    default:
7827
0
      break;
7828
15.1k
    }
7829
15.1k
}
7830
7831
619k
#define W_BIT 21
7832
104k
#define I_BIT 22
7833
1.16M
#define U_BIT 23
7834
889k
#define P_BIT 24
7835
7836
774k
#define WRITEBACK_BIT_SET (given & (1 << W_BIT))
7837
145k
#define IMMEDIATE_BIT_SET (given & (1 << I_BIT))
7838
1.32M
#define NEGATIVE_BIT_SET  ((given & (1 << U_BIT)) == 0)
7839
1.12M
#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.24M
{
7851
3.24M
  switch (x)
7852
3.24M
    {
7853
0
    case 'A': return dis_style_address;
7854
4.83k
    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.28M
    case 'I': return dis_style_immediate;
7858
0
    case 'M': return dis_style_mnemonic;
7859
0
    case 'O': return dis_style_address_offset;
7860
960k
    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.24M
    }
7866
3.24M
}
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
8.23M
{
7879
8.23M
  const struct sopcode32 *insn;
7880
8.23M
  void *stream = info->stream;
7881
8.23M
  fprintf_styled_ftype func = info->fprintf_styled_func;
7882
8.23M
  unsigned long mask;
7883
8.23M
  unsigned long value = 0;
7884
8.23M
  int cond;
7885
8.23M
  int cp_num;
7886
8.23M
  struct arm_private_data *private_data = info->private_data;
7887
8.23M
  arm_feature_set allowed_arches = ARM_ARCH_NONE;
7888
8.23M
  arm_feature_set arm_ext_v8_1m_main =
7889
8.23M
    ARM_FEATURE_CORE_HIGH (ARM_EXT2_V8_1M_MAIN);
7890
8.23M
  enum disassembler_style base_style = dis_style_mnemonic;
7891
8.23M
  enum disassembler_style old_base_style = base_style;
7892
7893
8.23M
  allowed_arches = private_data->features;
7894
7895
928M
  for (insn = opcodes; insn->assembler; insn++)
7896
920M
    {
7897
920M
      unsigned long u_reg = 16;
7898
920M
      bool is_unpredictable = false;
7899
920M
      signed long value_in_comment = 0;
7900
920M
      const char *c;
7901
7902
920M
      if (ARM_FEATURE_ZERO (insn->arch))
7903
8.55M
  switch (insn->value)
7904
8.55M
    {
7905
4.26M
    case SENTINEL_IWMMXT_START:
7906
4.26M
      if (info->mach != bfd_mach_arm_XScale
7907
4.24M
    && info->mach != bfd_mach_arm_iWMMXt
7908
4.22M
    && info->mach != bfd_mach_arm_iWMMXt2)
7909
4.19M
        do
7910
319M
    insn++;
7911
319M
        while ((! ARM_FEATURE_ZERO (insn->arch))
7912
314M
         && insn->value != SENTINEL_IWMMXT_END);
7913
4.26M
      continue;
7914
7915
58.2k
    case SENTINEL_IWMMXT_END:
7916
58.2k
      continue;
7917
7918
4.22M
    case SENTINEL_GENERIC_START:
7919
4.22M
      allowed_arches = private_data->features;
7920
4.22M
      continue;
7921
7922
0
    default:
7923
0
      abort ();
7924
8.55M
    }
7925
7926
912M
      mask = insn->mask;
7927
912M
      value = insn->value;
7928
912M
      cp_num = (given >> 8) & 0xf;
7929
7930
912M
      if (thumb)
7931
172M
  {
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
172M
    mask |= 0xf0000000;
7936
172M
    value |= 0xe0000000;
7937
172M
    if (ifthen_state)
7938
5.15M
      cond = IFTHEN_COND;
7939
167M
    else
7940
167M
      cond = COND_UNCOND;
7941
172M
  }
7942
739M
      else
7943
739M
  {
7944
    /* Only match unconditional instuctions against unconditional
7945
       patterns.  */
7946
739M
    if ((given & 0xf0000000) == 0xf0000000)
7947
58.7M
      {
7948
58.7M
        mask |= 0xf0000000;
7949
58.7M
        cond = COND_UNCOND;
7950
58.7M
      }
7951
680M
    else
7952
680M
      {
7953
680M
        cond = (given >> 28) & 0xf;
7954
680M
        if (cond == 0xe)
7955
24.7M
    cond = COND_UNCOND;
7956
680M
      }
7957
739M
  }
7958
7959
912M
      if ((insn->isa == T32 && !thumb)
7960
905M
    || (insn->isa == ARM && thumb))
7961
6.89M
  continue;
7962
7963
905M
      if ((given & mask) != value)
7964
904M
  continue;
7965
7966
544k
      if (! ARM_CPU_HAS_FEATURE (insn->arch, allowed_arches))
7967
72.4k
  continue;
7968
7969
472k
      if (insn->value == 0xfe000010     /* mcr2  */
7970
463k
    || insn->value == 0xfe100010  /* mrc2  */
7971
448k
    || insn->value == 0xfc100000  /* ldc2  */
7972
421k
    || insn->value == 0xfc000000) /* stc2  */
7973
72.0k
  {
7974
72.0k
    if (cp_num == 9 || cp_num == 10 || cp_num == 11)
7975
8.98k
      is_unpredictable = true;
7976
7977
    /* Armv8.1-M Mainline FP & MVE instructions.  */
7978
72.0k
    if (ARM_CPU_HAS_FEATURE (arm_ext_v8_1m_main, allowed_arches)
7979
63.1k
        && !ARM_CPU_IS_ANY (allowed_arches)
7980
42.6k
        && (cp_num == 8 || cp_num == 14 || cp_num == 15))
7981
16.6k
      continue;
7982
7983
72.0k
  }
7984
400k
      else if (insn->value == 0x0e000000     /* cdp  */
7985
306k
         || insn->value == 0xfe000000  /* cdp2  */
7986
285k
         || insn->value == 0x0e000010  /* mcr  */
7987
262k
         || insn->value == 0x0e100010  /* mrc  */
7988
244k
         || insn->value == 0x0c100000  /* ldc  */
7989
173k
         || insn->value == 0x0c000000) /* stc  */
7990
340k
  {
7991
    /* Floating-point instructions.  */
7992
340k
    if (cp_num == 9 || cp_num == 10 || cp_num == 11)
7993
19.6k
      continue;
7994
7995
    /* Armv8.1-M Mainline FP & MVE instructions.  */
7996
320k
    if (ARM_CPU_HAS_FEATURE (arm_ext_v8_1m_main, allowed_arches)
7997
184k
        && !ARM_CPU_IS_ANY (allowed_arches)
7998
10.4k
        && (cp_num == 8 || cp_num == 14 || cp_num == 15))
7999
3.33k
      continue;
8000
320k
  }
8001
59.7k
      else if ((insn->value == 0xec100f80      /* vldr (system register) */
8002
57.3k
    || insn->value == 0xec000f80)  /* vstr (system register) */
8003
8.52k
         && arm_decode_field (given, 24, 24) == 0
8004
6.81k
         && 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.56k
  continue;
8009
8010
11.8M
      for (c = insn->assembler; *c; c++)
8011
11.3M
  {
8012
11.3M
    if (*c == '%')
8013
5.12M
      {
8014
5.12M
        const char mod = *++c;
8015
8016
5.12M
        switch (mod)
8017
5.12M
    {
8018
1.36M
    case '{':
8019
1.36M
      ++c;
8020
1.36M
      if (*c == '\0')
8021
0
        abort ();
8022
1.36M
      old_base_style = base_style;
8023
1.36M
      base_style = decode_base_style (*c);
8024
1.36M
      ++c;
8025
1.36M
      if (*c != ':')
8026
0
        abort ();
8027
1.36M
      break;
8028
8029
1.36M
    case '}':
8030
1.36M
      base_style = old_base_style;
8031
1.36M
      break;
8032
8033
0
    case '%':
8034
0
      func (stream, base_style, "%%");
8035
0
      break;
8036
8037
213k
    case 'A':
8038
217k
    case 'K':
8039
217k
      {
8040
217k
        int rn = (given >> 16) & 0xf;
8041
217k
        bfd_vma offset = given & 0xff;
8042
8043
217k
        if (mod == 'K')
8044
3.96k
          offset = given & 0x7f;
8045
8046
217k
        func (stream, dis_style_text, "[");
8047
217k
        func (stream, dis_style_register, "%s",
8048
217k
        arm_regnames [(given >> 16) & 0xf]);
8049
8050
217k
        if (PRE_BIT_SET || WRITEBACK_BIT_SET)
8051
161k
          {
8052
      /* Not unindexed.  The offset is scaled.  */
8053
161k
      if (cp_num == 9)
8054
        /* vldr.16/vstr.16 will shift the address
8055
           left by 1 bit only.  */
8056
3.26k
        offset = offset * 2;
8057
157k
      else
8058
157k
        offset = offset * 4;
8059
8060
161k
      if (NEGATIVE_BIT_SET)
8061
92.7k
        offset = - offset;
8062
161k
      if (rn != 15)
8063
149k
        value_in_comment = offset;
8064
161k
          }
8065
8066
217k
        if (PRE_BIT_SET)
8067
117k
          {
8068
117k
      if (offset)
8069
88.4k
        {
8070
88.4k
          func (stream, dis_style_text, ", ");
8071
88.4k
          func (stream, dis_style_immediate, "#%d",
8072
88.4k
          (int) offset);
8073
88.4k
          func (stream, dis_style_text, "]%s",
8074
88.4k
          WRITEBACK_BIT_SET ? "!" : "");
8075
88.4k
        }
8076
28.8k
      else if (NEGATIVE_BIT_SET)
8077
23.4k
        {
8078
23.4k
          func (stream, dis_style_text, ", ");
8079
23.4k
          func (stream, dis_style_immediate, "#-0");
8080
23.4k
          func (stream, dis_style_text, "]");
8081
23.4k
        }
8082
5.38k
      else
8083
5.38k
        func (stream, dis_style_text, "]");
8084
117k
          }
8085
99.6k
        else
8086
99.6k
          {
8087
99.6k
      func (stream, dis_style_text, "]");
8088
8089
99.6k
      if (WRITEBACK_BIT_SET)
8090
43.8k
        {
8091
43.8k
          if (offset)
8092
39.4k
            {
8093
39.4k
        func (stream, dis_style_text, ", ");
8094
39.4k
        func (stream, dis_style_immediate,
8095
39.4k
              "#%d", (int) offset);
8096
39.4k
            }
8097
4.42k
          else if (NEGATIVE_BIT_SET)
8098
1.18k
            {
8099
1.18k
        func (stream, dis_style_text, ", ");
8100
1.18k
        func (stream, dis_style_immediate, "#-0");
8101
1.18k
            }
8102
43.8k
        }
8103
55.8k
      else
8104
55.8k
        {
8105
55.8k
          func (stream, dis_style_text, ", {");
8106
55.8k
          func (stream, dis_style_immediate, "%s%d",
8107
55.8k
          (NEGATIVE_BIT_SET && !offset) ? "-" : "",
8108
55.8k
          (int) offset);
8109
55.8k
          func (stream, dis_style_text, "}");
8110
55.8k
          value_in_comment = offset;
8111
55.8k
        }
8112
99.6k
          }
8113
217k
        if (rn == 15 && (PRE_BIT_SET || WRITEBACK_BIT_SET))
8114
11.5k
          {
8115
11.5k
      func (stream, dis_style_comment_start, "\t@ ");
8116
      /* For unaligned PCs, apply off-by-alignment
8117
         correction.  */
8118
11.5k
      info->print_address_func (offset + pc
8119
11.5k
              + info->bytes_per_chunk * 2
8120
11.5k
              - (pc & 3),
8121
11.5k
              info);
8122
11.5k
          }
8123
217k
      }
8124
217k
      break;
8125
8126
2.52k
    case 'B':
8127
2.52k
      {
8128
2.52k
        int regno = ((given >> 12) & 0xf) | ((given >> (22 - 4)) & 0x10);
8129
2.52k
        int offset = (given >> 1) & 0x3f;
8130
8131
2.52k
        func (stream, dis_style_text, "{");
8132
2.52k
        if (offset == 1)
8133
438
          func (stream, dis_style_register, "d%d", regno);
8134
2.08k
        else if (regno + offset > 32)
8135
1.59k
          {
8136
1.59k
      func (stream, dis_style_register, "d%d", regno);
8137
1.59k
      func (stream, dis_style_text, "-<overflow reg d%d>",
8138
1.59k
            regno + offset - 1);
8139
1.59k
          }
8140
488
        else
8141
488
          {
8142
488
      func (stream, dis_style_register, "d%d", regno);
8143
488
      func (stream, dis_style_text, "-");
8144
488
      func (stream, dis_style_register, "d%d",
8145
488
            regno + offset - 1);
8146
488
          }
8147
2.52k
        func (stream, dis_style_text, "}");
8148
2.52k
      }
8149
2.52k
      break;
8150
8151
2.85k
    case 'C':
8152
2.85k
      {
8153
2.85k
        bool single = ((given >> 8) & 1) == 0;
8154
2.85k
        char reg_prefix = single ? 's' : 'd';
8155
2.85k
        int Dreg = (given >> 22) & 0x1;
8156
2.85k
        int Vdreg = (given >> 12) & 0xf;
8157
2.85k
        int reg = single ? ((Vdreg << 1) | Dreg)
8158
2.85k
             : ((Dreg << 4) | Vdreg);
8159
2.85k
        int num = (given >> (single ? 0 : 1)) & 0x7f;
8160
2.85k
        int maxreg = single ? 31 : 15;
8161
2.85k
        int topreg = reg + num - 1;
8162
8163
2.85k
        func (stream, dis_style_text, "{");
8164
2.85k
        if (!num)
8165
560
          {
8166
      /* Nothing.  */
8167
560
          }
8168
2.29k
        else if (num == 1)
8169
322
          {
8170
322
      func (stream, dis_style_register,
8171
322
            "%c%d", reg_prefix, reg);
8172
322
      func (stream, dis_style_text, ", ");
8173
322
          }
8174
1.96k
        else if (topreg > maxreg)
8175
1.72k
          {
8176
1.72k
      func (stream, dis_style_register, "%c%d",
8177
1.72k
            reg_prefix, reg);
8178
1.72k
      func (stream, dis_style_text, "-<overflow reg d%d, ",
8179
1.72k
            single ? topreg >> 1 : topreg);
8180
1.72k
          }
8181
241
        else
8182
241
          {
8183
241
      func (stream, dis_style_register,
8184
241
            "%c%d", reg_prefix, reg);
8185
241
      func (stream, dis_style_text, "-");
8186
241
      func (stream, dis_style_register, "%c%d",
8187
241
            reg_prefix, topreg);
8188
241
      func (stream, dis_style_text, ", ");
8189
241
          }
8190
2.85k
        func (stream, dis_style_register, "VPR");
8191
2.85k
        func (stream, dis_style_text, "}");
8192
2.85k
      }
8193
2.85k
      break;
8194
8195
3.84k
    case 'u':
8196
3.84k
      if (cond != COND_UNCOND)
8197
794
        is_unpredictable = true;
8198
8199
      /* Fall through.  */
8200
419k
    case 'c':
8201
419k
      if (cond != COND_UNCOND && cp_num == 9)
8202
897
        is_unpredictable = true;
8203
8204
      /* Fall through.  */
8205
419k
    case 'b':
8206
419k
      func (stream, dis_style_mnemonic, "%s",
8207
419k
      arm_conditional[cond]);
8208
419k
      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
306
          case 0x1:
8218
306
      func (stream, dis_style_register, "FPSCR");
8219
306
      break;
8220
256
          case 0x2:
8221
256
      func (stream, dis_style_register, "FPSCR_nzcvqc");
8222
256
      break;
8223
546
          case 0xc:
8224
546
      func (stream, dis_style_register, "VPR");
8225
546
      break;
8226
310
          case 0xd:
8227
310
      func (stream, dis_style_register, "P0");
8228
310
      break;
8229
710
          case 0xe:
8230
710
      func (stream, dis_style_register, "FPCXTNS");
8231
710
      break;
8232
270
          case 0xf:
8233
270
      func (stream, dis_style_register, "FPCXTS");
8234
270
      break;
8235
1.56k
          default:
8236
1.56k
      func (stream, dis_style_text, "<invalid reg %lu>",
8237
1.56k
            regno);
8238
1.56k
      break;
8239
3.96k
          }
8240
3.96k
      }
8241
3.96k
      break;
8242
8243
1.15M
    case '0': case '1': case '2': case '3': case '4':
8244
1.69M
    case '5': case '6': case '7': case '8': case '9':
8245
1.69M
      {
8246
1.69M
        int width;
8247
8248
1.69M
        c = arm_decode_bitfield (c, given, &value, &width);
8249
8250
1.69M
        switch (*c)
8251
1.69M
          {
8252
37.0k
          case 'R':
8253
37.0k
      if (value == 15)
8254
4.74k
        is_unpredictable = true;
8255
      /* Fall through.  */
8256
80.8k
          case 'r':
8257
80.8k
      if (c[1] == 'u')
8258
7.74k
        {
8259
          /* Eat the 'u' character.  */
8260
7.74k
          ++ c;
8261
8262
7.74k
          if (u_reg == value)
8263
328
            is_unpredictable = true;
8264
7.74k
          u_reg = value;
8265
7.74k
        }
8266
80.8k
      func (stream, dis_style_register, "%s",
8267
80.8k
            arm_regnames[value]);
8268
80.8k
      break;
8269
6.70k
          case 'V':
8270
6.70k
      if (given & (1 << 6))
8271
2.67k
        goto Q;
8272
      /* FALLTHROUGH */
8273
10.1k
          case 'D':
8274
10.1k
      func (stream, dis_style_register, "d%ld", value);
8275
10.1k
      break;
8276
1.92k
          case 'Q':
8277
4.59k
          Q:
8278
4.59k
      if (value & 1)
8279
1.07k
        func (stream, dis_style_text,
8280
1.07k
        "<illegal reg q%ld.5>", value >> 1);
8281
3.51k
      else
8282
3.51k
        func (stream, dis_style_register,
8283
3.51k
        "q%ld", value >> 1);
8284
4.59k
      break;
8285
1.35M
          case 'd':
8286
1.35M
      func (stream, base_style, "%ld", value);
8287
1.35M
      value_in_comment = value;
8288
1.35M
      break;
8289
1.22k
          case 'E':
8290
1.22k
                        {
8291
        /* Converts immediate 8 bit back to float value.  */
8292
1.22k
        unsigned floatVal = (value & 0x80) << 24
8293
1.22k
          | (value & 0x3F) << 19
8294
1.22k
          | ((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.22k
        unsigned decVal =
8300
1.22k
          (78125 << (((floatVal >> 23) & 0xFF) - 124)) *
8301
1.22k
          (16 + (value & 0xF));
8302
8303
1.22k
        if (!(decVal % 1000000))
8304
558
          {
8305
558
            func (stream, dis_style_immediate, "%ld", value);
8306
558
            func (stream, dis_style_comment_start,
8307
558
            "\t@ 0x%08x %c%u.%01u",
8308
558
            floatVal, value & 0x80 ? '-' : ' ',
8309
558
            decVal / 10000000,
8310
558
            decVal % 10000000 / 1000000);
8311
558
          }
8312
662
        else if (!(decVal % 10000))
8313
280
          {
8314
280
            func (stream, dis_style_immediate, "%ld", value);
8315
280
            func (stream, dis_style_comment_start,
8316
280
            "\t@ 0x%08x %c%u.%03u",
8317
280
            floatVal, value & 0x80 ? '-' : ' ',
8318
280
            decVal / 10000000,
8319
280
            decVal % 10000000 / 10000);
8320
280
          }
8321
382
        else
8322
382
          {
8323
382
            func (stream, dis_style_immediate, "%ld", value);
8324
382
            func (stream, dis_style_comment_start,
8325
382
            "\t@ 0x%08x %c%u.%07u",
8326
382
            floatVal, value & 0x80 ? '-' : ' ',
8327
382
            decVal / 10000000, decVal % 10000000);
8328
382
          }
8329
1.22k
        break;
8330
1.92k
      }
8331
1.09k
          case 'k':
8332
1.09k
      {
8333
1.09k
        int from = (given & (1 << 7)) ? 32 : 16;
8334
1.09k
        func (stream, dis_style_immediate, "%ld",
8335
1.09k
        from - value);
8336
1.09k
      }
8337
1.09k
      break;
8338
8339
891
          case 'w':
8340
891
      if (width == 2)
8341
590
        func (stream, dis_style_mnemonic, "%s",
8342
590
        iwmmxt_wwnames[value]);
8343
301
      else
8344
301
        func (stream, dis_style_mnemonic, "%s",
8345
301
        iwmmxt_wwssnames[value]);
8346
891
      break;
8347
8348
11.2k
          case 'g':
8349
11.2k
      func (stream, dis_style_register, "%s",
8350
11.2k
            iwmmxt_regnames[value]);
8351
11.2k
      break;
8352
651
          case 'G':
8353
651
      func (stream, dis_style_register, "%s",
8354
651
            iwmmxt_cregnames[value]);
8355
651
      break;
8356
8357
200
          case 'x':
8358
200
      func (stream, dis_style_immediate, "0x%lx",
8359
200
            (value & 0xffffffffUL));
8360
200
      break;
8361
8362
2.88k
          case 'c':
8363
2.88k
      switch (value)
8364
2.88k
        {
8365
793
        case 0:
8366
793
          func (stream, dis_style_mnemonic, "eq");
8367
793
          break;
8368
8369
332
        case 1:
8370
332
          func (stream, dis_style_mnemonic, "vs");
8371
332
          break;
8372
8373
819
        case 2:
8374
819
          func (stream, dis_style_mnemonic, "ge");
8375
819
          break;
8376
8377
938
        case 3:
8378
938
          func (stream, dis_style_mnemonic, "gt");
8379
938
          break;
8380
8381
0
        default:
8382
0
          func (stream, dis_style_text, "??");
8383
0
          break;
8384
2.88k
        }
8385
2.88k
      break;
8386
8387
2.88k
          case '`':
8388
574
      c++;
8389
574
      if (value == 0)
8390
259
        func (stream, dis_style_mnemonic, "%c", *c);
8391
574
      break;
8392
216k
          case '\'':
8393
216k
      c++;
8394
216k
      if (value == ((1ul << width) - 1))
8395
99.7k
        func (stream, base_style, "%c", *c);
8396
216k
      break;
8397
13.1k
          case '?':
8398
13.1k
      func (stream, base_style, "%c",
8399
13.1k
            c[(1 << width) - (int) value]);
8400
13.1k
      c += 1 << width;
8401
13.1k
      break;
8402
0
          default:
8403
0
      abort ();
8404
1.69M
          }
8405
1.69M
      }
8406
1.69M
      break;
8407
8408
1.69M
    case 'y':
8409
43.0k
    case 'z':
8410
43.0k
      {
8411
43.0k
        int single = *c++ == 'y';
8412
43.0k
        int regno;
8413
8414
43.0k
        switch (*c)
8415
43.0k
          {
8416
589
          case '4': /* Sm pair */
8417
11.3k
          case '0': /* Sm, Dm */
8418
11.3k
      regno = given & 0x0000000f;
8419
11.3k
      if (single)
8420
7.41k
        {
8421
7.41k
          regno <<= 1;
8422
7.41k
          regno += (given >> 5) & 1;
8423
7.41k
        }
8424
3.89k
      else
8425
3.89k
        regno += ((given >> 5) & 1) << 4;
8426
11.3k
      break;
8427
8428
15.5k
          case '1': /* Sd, Dd */
8429
15.5k
      regno = (given >> 12) & 0x0000000f;
8430
15.5k
      if (single)
8431
10.6k
        {
8432
10.6k
          regno <<= 1;
8433
10.6k
          regno += (given >> 22) & 1;
8434
10.6k
        }
8435
4.85k
      else
8436
4.85k
        regno += ((given >> 22) & 1) << 4;
8437
15.5k
      break;
8438
8439
9.00k
          case '2': /* Sn, Dn */
8440
9.00k
      regno = (given >> 16) & 0x0000000f;
8441
9.00k
      if (single)
8442
5.85k
        {
8443
5.85k
          regno <<= 1;
8444
5.85k
          regno += (given >> 7) & 1;
8445
5.85k
        }
8446
3.15k
      else
8447
3.15k
        regno += ((given >> 7) & 1) << 4;
8448
9.00k
      break;
8449
8450
7.21k
          case '3': /* List */
8451
7.21k
      func (stream, dis_style_text, "{");
8452
7.21k
      regno = (given >> 12) & 0x0000000f;
8453
7.21k
      if (single)
8454
5.29k
        {
8455
5.29k
          regno <<= 1;
8456
5.29k
          regno += (given >> 22) & 1;
8457
5.29k
        }
8458
1.91k
      else
8459
1.91k
        regno += ((given >> 22) & 1) << 4;
8460
7.21k
      break;
8461
8462
0
          default:
8463
0
      abort ();
8464
43.0k
          }
8465
8466
43.0k
        func (stream, dis_style_register, "%c%d",
8467
43.0k
        single ? 's' : 'd', regno);
8468
8469
43.0k
        if (*c == '3')
8470
7.21k
          {
8471
7.21k
      int count = given & 0xff;
8472
8473
7.21k
      if (single == 0)
8474
1.91k
        count >>= 1;
8475
8476
7.21k
      if (--count)
8477
6.83k
        {
8478
6.83k
          func (stream, dis_style_text, "-");
8479
6.83k
          func (stream, dis_style_register, "%c%d",
8480
6.83k
          single ? 's' : 'd',
8481
6.83k
          regno + count);
8482
6.83k
        }
8483
8484
7.21k
      func (stream, dis_style_text, "}");
8485
7.21k
          }
8486
35.8k
        else if (*c == '4')
8487
589
          {
8488
589
      func (stream, dis_style_text, ", ");
8489
589
      func (stream, dis_style_register, "%c%d",
8490
589
            single ? 's' : 'd', regno + 1);
8491
589
          }
8492
43.0k
      }
8493
0
      break;
8494
8495
4.88k
    case 'L':
8496
4.88k
      switch (given & 0x00400100)
8497
4.88k
        {
8498
540
        case 0x00000000:
8499
540
          func (stream, dis_style_mnemonic, "b");
8500
540
          break;
8501
512
        case 0x00400000:
8502
512
          func (stream, dis_style_mnemonic, "h");
8503
512
          break;
8504
2.21k
        case 0x00000100:
8505
2.21k
          func (stream, dis_style_mnemonic, "w");
8506
2.21k
          break;
8507
1.62k
        case 0x00400100:
8508
1.62k
          func (stream, dis_style_mnemonic, "d");
8509
1.62k
          break;
8510
0
        default:
8511
0
          break;
8512
4.88k
        }
8513
4.88k
      break;
8514
8515
4.88k
    case 'Z':
8516
504
      {
8517
        /* given (20, 23) | given (0, 3) */
8518
504
        value = ((given >> 16) & 0xf0) | (given & 0xf);
8519
504
        func (stream, dis_style_immediate, "%d", (int) value);
8520
504
      }
8521
504
      break;
8522
8523
4.88k
    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
4.88k
      {
8528
4.88k
        int offset = given & 0xff;
8529
4.88k
        int multiplier = (given & 0x00000100) ? 4 : 1;
8530
8531
4.88k
        func (stream, dis_style_text, "[");
8532
4.88k
        func (stream, dis_style_register, "%s",
8533
4.88k
        arm_regnames [(given >> 16) & 0xf]);
8534
8535
4.88k
        if (multiplier > 1)
8536
3.83k
          {
8537
3.83k
      value_in_comment = offset * multiplier;
8538
3.83k
      if (NEGATIVE_BIT_SET)
8539
1.03k
        value_in_comment = - value_in_comment;
8540
3.83k
          }
8541
8542
4.88k
        if (offset)
8543
4.11k
          {
8544
4.11k
      if (PRE_BIT_SET)
8545
763
        {
8546
763
          func (stream, dis_style_text, ", ");
8547
763
          func (stream, dis_style_immediate, "#%s%d",
8548
763
          NEGATIVE_BIT_SET ? "-" : "",
8549
763
          offset * multiplier);
8550
763
          func (stream, dis_style_text, "]%s",
8551
763
          WRITEBACK_BIT_SET ? "!" : "");
8552
763
        }
8553
3.34k
      else
8554
3.34k
        {
8555
3.34k
          func (stream, dis_style_text, "], ");
8556
3.34k
          func (stream, dis_style_immediate, "#%s%d",
8557
3.34k
          NEGATIVE_BIT_SET ? "-" : "",
8558
3.34k
          offset * multiplier);
8559
3.34k
        }
8560
4.11k
          }
8561
778
        else
8562
778
          func (stream, dis_style_text, "]");
8563
4.88k
      }
8564
4.88k
      break;
8565
8566
2.88k
    case 'r':
8567
2.88k
      {
8568
2.88k
        int imm4 = (given >> 4) & 0xf;
8569
2.88k
        int puw_bits = ((given >> 22) & 6) | ((given >> W_BIT) & 1);
8570
2.88k
        int ubit = ! NEGATIVE_BIT_SET;
8571
2.88k
        const char *rm = arm_regnames [given & 0xf];
8572
2.88k
        const char *rn = arm_regnames [(given >> 16) & 0xf];
8573
8574
2.88k
        switch (puw_bits)
8575
2.88k
          {
8576
275
          case 1:
8577
940
          case 3:
8578
940
      func (stream, dis_style_text, "[");
8579
940
      func (stream, dis_style_register, "%s", rn);
8580
940
      func (stream, dis_style_text, "], ");
8581
940
      func (stream, dis_style_text, "%c", ubit ? '+' : '-');
8582
940
      func (stream, dis_style_register, "%s", rm);
8583
940
      if (imm4)
8584
395
        {
8585
395
          func (stream, dis_style_text, ", ");
8586
395
          func (stream, dis_style_sub_mnemonic, "lsl ");
8587
395
          func (stream, dis_style_immediate, "#%d", imm4);
8588
395
        }
8589
940
      break;
8590
8591
376
          case 4:
8592
842
          case 5:
8593
1.12k
          case 6:
8594
1.61k
          case 7:
8595
1.61k
      func (stream, dis_style_text, "[");
8596
1.61k
      func (stream, dis_style_register, "%s", rn);
8597
1.61k
      func (stream, dis_style_text, ", ");
8598
1.61k
      func (stream, dis_style_text, "%c", ubit ? '+' : '-');
8599
1.61k
      func (stream, dis_style_register, "%s", rm);
8600
1.61k
      if (imm4 > 0)
8601
1.22k
        {
8602
1.22k
          func (stream, dis_style_text, ", ");
8603
1.22k
          func (stream, dis_style_sub_mnemonic, "lsl ");
8604
1.22k
          func (stream, dis_style_immediate, "#%d", imm4);
8605
1.22k
        }
8606
1.61k
      func (stream, dis_style_text, "]");
8607
1.61k
      if (puw_bits == 5 || puw_bits == 7)
8608
960
        func (stream, dis_style_text, "!");
8609
1.61k
      break;
8610
8611
326
          default:
8612
326
      func (stream, dis_style_text, "INVALID");
8613
2.88k
          }
8614
2.88k
      }
8615
2.88k
      break;
8616
8617
2.88k
    case 'i':
8618
544
      {
8619
544
        long imm5;
8620
544
        imm5 = ((given & 0x100) >> 4) | (given & 0xf);
8621
544
        func (stream, dis_style_immediate, "%ld",
8622
544
        (imm5 == 0) ? 32 : imm5);
8623
544
      }
8624
544
      break;
8625
8626
0
    default:
8627
0
      abort ();
8628
5.12M
    }
8629
5.12M
      }
8630
6.27M
    else
8631
6.27M
      {
8632
6.27M
        if (*c == '@')
8633
1.91k
    base_style = dis_style_comment_start;
8634
8635
6.27M
        if (*c == '\t')
8636
429k
    base_style = dis_style_text;
8637
8638
6.27M
        func (stream, base_style, "%c", *c);
8639
6.27M
      }
8640
11.3M
  }
8641
8642
427k
      if (value_in_comment > 32 || value_in_comment < -16)
8643
157k
  func (stream, dis_style_comment_start, "\t@ 0x%lx",
8644
157k
        (value_in_comment & 0xffffffffUL));
8645
8646
427k
      if (is_unpredictable)
8647
14.7k
  func (stream, dis_style_comment_start, UNPREDICTABLE_INSTRUCTION);
8648
8649
427k
      return true;
8650
427k
    }
8651
7.80M
  return false;
8652
8.23M
}
8653
8654
static bool
8655
print_insn_coprocessor (bfd_vma pc,
8656
      struct disassemble_info *info,
8657
      long given,
8658
      bool thumb)
8659
4.26M
{
8660
4.26M
  return print_insn_coprocessor_1 (coprocessor_opcodes,
8661
4.26M
           pc, info, given, thumb);
8662
4.26M
}
8663
8664
static bool
8665
print_insn_generic_coprocessor (bfd_vma pc,
8666
        struct disassemble_info *info,
8667
        long given,
8668
        bool thumb)
8669
3.96M
{
8670
3.96M
  return print_insn_coprocessor_1 (generic_coprocessor_opcodes,
8671
3.96M
           pc, info, given, thumb);
8672
3.96M
}
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
361k
{
8682
361k
  void *stream = info->stream;
8683
361k
  fprintf_styled_ftype func = info->fprintf_styled_func;
8684
361k
  bfd_vma offset = 0;
8685
8686
361k
  if (((given & 0x000f0000) == 0x000f0000)
8687
18.5k
      && ((given & 0x02000000) == 0))
8688
11.6k
    {
8689
11.6k
      offset = given & 0xfff;
8690
8691
11.6k
      func (stream, dis_style_text, "[");
8692
11.6k
      func (stream, dis_style_register, "pc");
8693
8694
11.6k
      if (PRE_BIT_SET)
8695
5.17k
  {
8696
    /* Pre-indexed.  Elide offset of positive zero when
8697
       non-writeback.  */
8698
5.17k
    if (WRITEBACK_BIT_SET || NEGATIVE_BIT_SET || offset)
8699
4.96k
      {
8700
4.96k
        func (stream, dis_style_text, ", ");
8701
4.96k
        func (stream, dis_style_immediate, "#%s%d",
8702
4.96k
        NEGATIVE_BIT_SET ? "-" : "", (int) offset);
8703
4.96k
      }
8704
8705
5.17k
    if (NEGATIVE_BIT_SET)
8706
3.00k
      offset = -offset;
8707
8708
5.17k
    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.17k
    func (stream, dis_style_text, "]%s", WRITEBACK_BIT_SET ? "!" : "");
8715
5.17k
  }
8716
6.48k
      else  /* Post indexed.  */
8717
6.48k
  {
8718
6.48k
    func (stream, dis_style_text, "], ");
8719
6.48k
    func (stream, dis_style_immediate, "#%s%d",
8720
6.48k
    NEGATIVE_BIT_SET ? "-" : "", (int) offset);
8721
8722
    /* Ie ignore the offset.  */
8723
6.48k
    offset = pc + 8;
8724
6.48k
  }
8725
8726
11.6k
      func (stream, dis_style_comment_start, "\t@ ");
8727
11.6k
      info->print_address_func (offset, info);
8728
11.6k
      offset = 0;
8729
11.6k
    }
8730
349k
  else
8731
349k
    {
8732
349k
      func (stream, dis_style_text, "[");
8733
349k
      func (stream, dis_style_register, "%s",
8734
349k
      arm_regnames[(given >> 16) & 0xf]);
8735
8736
349k
      if (PRE_BIT_SET)
8737
143k
  {
8738
143k
    if ((given & 0x02000000) == 0)
8739
97.6k
      {
8740
        /* Elide offset of positive zero when non-writeback.  */
8741
97.6k
        offset = given & 0xfff;
8742
97.6k
        if (WRITEBACK_BIT_SET || NEGATIVE_BIT_SET || offset)
8743
95.9k
    {
8744
95.9k
      func (stream, dis_style_text, ", ");
8745
95.9k
      func (stream, dis_style_immediate, "#%s%d",
8746
95.9k
      NEGATIVE_BIT_SET ? "-" : "", (int) offset);
8747
95.9k
    }
8748
97.6k
      }
8749
45.9k
    else
8750
45.9k
      {
8751
45.9k
        func (stream, dis_style_text, ", %s",
8752
45.9k
        NEGATIVE_BIT_SET ? "-" : "");
8753
45.9k
        arm_decode_shift (given, func, stream, true);
8754
45.9k
      }
8755
8756
143k
    func (stream, dis_style_text, "]%s",
8757
143k
    WRITEBACK_BIT_SET ? "!" : "");
8758
143k
  }
8759
206k
      else
8760
206k
  {
8761
206k
    if ((given & 0x02000000) == 0)
8762
154k
      {
8763
        /* Always show offset.  */
8764
154k
        offset = given & 0xfff;
8765
154k
        func (stream, dis_style_text, "], ");
8766
154k
        func (stream, dis_style_immediate, "#%s%d",
8767
154k
        NEGATIVE_BIT_SET ? "-" : "", (int) offset);
8768
154k
      }
8769
51.4k
    else
8770
51.4k
      {
8771
51.4k
        func (stream, dis_style_text, "], %s",
8772
51.4k
        NEGATIVE_BIT_SET ? "-" : "");
8773
51.4k
        arm_decode_shift (given, func, stream, true);
8774
51.4k
      }
8775
206k
  }
8776
349k
      if (NEGATIVE_BIT_SET)
8777
245k
  offset = -offset;
8778
349k
    }
8779
8780
361k
  return (signed long) offset;
8781
361k
}
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
575k
{
8790
575k
  const struct cdeopcode32 *insn;
8791
575k
  void *stream = info->stream;
8792
575k
  fprintf_styled_ftype func = info->fprintf_styled_func;
8793
575k
  enum disassembler_style base_style = dis_style_mnemonic;
8794
575k
  enum disassembler_style old_base_style = base_style;
8795
8796
575k
  if (thumb)
8797
575k
  {
8798
    /* Manually extract the coprocessor code from a known point.
8799
       This position is the same across all CDE instructions.  */
8800
7.43M
    for (insn = cde_opcodes; insn->assembler; insn++)
8801
6.86M
    {
8802
6.86M
      uint16_t coproc = (given >> insn->coproc_shift) & insn->coproc_mask;
8803
6.86M
      uint16_t coproc_mask = 1 << coproc;
8804
6.86M
      if (! (coproc_mask & cde_coprocs))
8805
5.89M
  continue;
8806
8807
972k
      if ((given & insn->mask) == insn->value)
8808
9.17k
      {
8809
9.17k
  bool is_unpredictable = false;
8810
9.17k
  const char *c;
8811
8812
214k
  for (c = insn->assembler; *c; c++)
8813
205k
  {
8814
205k
    if (*c == '%')
8815
75.1k
    {
8816
75.1k
      switch (*++c)
8817
75.1k
      {
8818
9.17k
        case '{':
8819
9.17k
    ++c;
8820
9.17k
    if (*c == '\0')
8821
0
      abort ();
8822
9.17k
    old_base_style = base_style;
8823
9.17k
    base_style = decode_base_style (*c);
8824
9.17k
    ++c;
8825
9.17k
    if (*c != ':')
8826
0
      abort ();
8827
9.17k
    break;
8828
8829
9.17k
        case '}':
8830
9.17k
    base_style = old_base_style;
8831
9.17k
    break;
8832
8833
0
        case '%':
8834
0
    func (stream, base_style, "%%");
8835
0
    break;
8836
8837
38.4k
        case '0': case '1': case '2': case '3': case '4':
8838
38.4k
        case '5': case '6': case '7': case '8': case '9':
8839
38.4k
        {
8840
38.4k
    int width;
8841
38.4k
    unsigned long value;
8842
8843
38.4k
    c = arm_decode_bitfield (c, given, &value, &width);
8844
8845
38.4k
    switch (*c)
8846
38.4k
    {
8847
4.53k
      case 'S':
8848
4.53k
        if (value > 10)
8849
2.21k
          is_unpredictable = true;
8850
        /* Fall through.  */
8851
4.53k
      case 'R':
8852
4.53k
        if (value == 13)
8853
390
          is_unpredictable = true;
8854
        /* Fall through.  */
8855
4.53k
      case 'r':
8856
4.53k
        func (stream, dis_style_register, "%s",
8857
4.53k
        arm_regnames[value]);
8858
4.53k
        break;
8859
8860
11.0k
      case 'n':
8861
11.0k
        if (value == 15)
8862
1.23k
          func (stream, dis_style_register, "%s", "APSR_nzcv");
8863
9.78k
        else
8864
9.78k
          func (stream, dis_style_register, "%s",
8865
9.78k
          arm_regnames[value]);
8866
11.0k
        break;
8867
8868
4.53k
      case 'T':
8869
4.53k
        func (stream, dis_style_register, "%s",
8870
4.53k
        arm_regnames[(value + 1) & 15]);
8871
4.53k
        break;
8872
8873
9.17k
      case 'd':
8874
9.17k
        func (stream, dis_style_immediate, "%ld", value);
8875
9.17k
        break;
8876
8877
9.22k
      case 'V':
8878
9.22k
        if (given & (1 << 6))
8879
5.24k
          func (stream, dis_style_register, "q%ld", value >> 1);
8880
3.97k
        else if (given & (1 << 24))
8881
1.45k
          func (stream, dis_style_register, "d%ld", value);
8882
2.52k
        else
8883
2.52k
          {
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.52k
      uint8_t top_bit = (value >> 4) & 1;
8890
2.52k
      uint8_t tmp = (value << 1) & 0x1e;
8891
2.52k
      uint8_t res = tmp | top_bit;
8892
2.52k
      func (stream, dis_style_register, "s%u", res);
8893
2.52k
          }
8894
9.22k
        break;
8895
8896
0
    default:
8897
0
      abort ();
8898
38.4k
    }
8899
38.4k
        }
8900
38.4k
      break;
8901
8902
38.4k
      case 'p':
8903
9.17k
        {
8904
9.17k
    uint8_t proc_number = (given >> 8) & 0x7;
8905
9.17k
    func (stream, dis_style_register, "p%u", proc_number);
8906
9.17k
    break;
8907
38.4k
        }
8908
8909
9.17k
      case 'a':
8910
9.17k
        {
8911
9.17k
    uint8_t a_offset = 28;
8912
9.17k
    if (given & (1 << a_offset))
8913
4.66k
      func (stream, dis_style_mnemonic, "a");
8914
9.17k
    break;
8915
38.4k
        }
8916
0
    default:
8917
0
      abort ();
8918
75.1k
    }
8919
75.1k
  }
8920
130k
  else
8921
130k
    {
8922
130k
      if (*c == '@')
8923
0
        base_style = dis_style_comment_start;
8924
130k
      if (*c == '\t')
8925
9.17k
        base_style = dis_style_text;
8926
8927
130k
      func (stream, base_style, "%c", *c);
8928
130k
    }
8929
205k
      }
8930
8931
9.17k
      if (is_unpredictable)
8932
2.21k
  func (stream, dis_style_comment_start, UNPREDICTABLE_INSTRUCTION);
8933
8934
9.17k
      return true;
8935
9.17k
      }
8936
972k
    }
8937
566k
    return false;
8938
575k
  }
8939
0
  else
8940
0
    return false;
8941
575k
}
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
3.63M
{
8951
3.63M
  const struct opcode32 *insn;
8952
3.63M
  void *stream = info->stream;
8953
3.63M
  fprintf_styled_ftype func = info->fprintf_styled_func;
8954
3.63M
  enum disassembler_style base_style = dis_style_mnemonic;
8955
3.63M
  enum disassembler_style old_base_style = base_style;
8956
8957
3.63M
  if (thumb)
8958
207k
    {
8959
207k
      if ((given & 0xef000000) == 0xef000000)
8960
65.6k
  {
8961
    /* Move bit 28 to bit 24 to translate Thumb2 to ARM encoding.  */
8962
65.6k
    unsigned long bit28 = given & (1 << 28);
8963
8964
65.6k
    given &= 0x00ffffff;
8965
65.6k
    if (bit28)
8966
61.2k
            given |= 0xf3000000;
8967
4.45k
          else
8968
4.45k
      given |= 0xf2000000;
8969
65.6k
  }
8970
141k
      else if ((given & 0xff000000) == 0xf9000000)
8971
16.8k
  given ^= 0xf9000000 ^ 0xf4000000;
8972
      /* BFloat16 neon instructions without special top byte handling.  */
8973
124k
      else if ((given & 0xff000000) == 0xfe000000
8974
110k
         || (given & 0xff000000) == 0xfc000000)
8975
20.9k
  ;
8976
      /* vdup is also a valid neon instruction.  */
8977
103k
      else if ((given & 0xff900f5f) != 0xee800b10)
8978
103k
  return false;
8979
207k
    }
8980
8981
1.06G
  for (insn = neon_opcodes; insn->assembler; insn++)
8982
1.06G
    {
8983
1.06G
      unsigned long cond_mask = insn->mask;
8984
1.06G
      unsigned long cond_value = insn->value;
8985
1.06G
      int cond;
8986
8987
1.06G
      if (thumb)
8988
25.9M
        {
8989
25.9M
          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
622k
              cond_mask |= 0xf0000000;
8995
              /* Furthermore, the thumb encoding of a conditional instruction
8996
                 will have the high 4 bits equal to 0xe.  */
8997
622k
              cond_value |= 0xe0000000;
8998
622k
          }
8999
25.9M
          if (ifthen_state)
9000
225k
            cond = IFTHEN_COND;
9001
25.7M
          else
9002
25.7M
            cond = COND_UNCOND;
9003
25.9M
        }
9004
1.03G
      else
9005
1.03G
        {
9006
1.03G
          if ((given & 0xf0000000) == 0xf0000000)
9007
79.8M
            {
9008
              /* If the instruction is unconditional, update the mask to only
9009
                 match against unconditional opcode values.  */
9010
79.8M
              cond_mask |= 0xf0000000;
9011
79.8M
              cond = COND_UNCOND;
9012
79.8M
            }
9013
955M
          else
9014
955M
            {
9015
955M
              cond = (given >> 28) & 0xf;
9016
955M
              if (cond == 0xe)
9017
34.4M
                cond = COND_UNCOND;
9018
955M
            }
9019
1.03G
        }
9020
9021
1.06G
      if ((given & cond_mask) == cond_value)
9022
79.7k
  {
9023
79.7k
    signed long value_in_comment = 0;
9024
79.7k
    bool is_unpredictable = false;
9025
79.7k
    const char *c;
9026
9027
1.35M
    for (c = insn->assembler; *c; c++)
9028
1.27M
      {
9029
1.27M
        if (*c == '%')
9030
427k
    {
9031
427k
      switch (*++c)
9032
427k
        {
9033
20.5k
        case '{':
9034
20.5k
          ++c;
9035
20.5k
          if (*c == '\0')
9036
0
      abort ();
9037
20.5k
          old_base_style = base_style;
9038
20.5k
          base_style = decode_base_style (*c);
9039
20.5k
          ++c;
9040
20.5k
          if (*c != ':')
9041
0
      abort ();
9042
20.5k
          break;
9043
9044
20.5k
        case '}':
9045
20.5k
          base_style = old_base_style;
9046
20.5k
          break;
9047
9048
0
        case '%':
9049
0
          func (stream, base_style, "%%");
9050
0
          break;
9051
9052
5.93k
        case 'u':
9053
5.93k
          if (thumb && ifthen_state)
9054
294
      is_unpredictable = true;
9055
9056
          /* Fall through.  */
9057
78.9k
        case 'c':
9058
78.9k
          func (stream, dis_style_mnemonic, "%s",
9059
78.9k
          arm_conditional[cond]);
9060
78.9k
          break;
9061
9062
8.98k
        case 'A':
9063
8.98k
          {
9064
8.98k
      static const unsigned char enc[16] =
9065
8.98k
      {
9066
8.98k
        0x4, 0x14, /* st4 0,1 */
9067
8.98k
        0x4, /* st1 2 */
9068
8.98k
        0x4, /* st2 3 */
9069
8.98k
        0x3, /* st3 4 */
9070
8.98k
        0x13, /* st3 5 */
9071
8.98k
        0x3, /* st1 6 */
9072
8.98k
        0x1, /* st1 7 */
9073
8.98k
        0x2, /* st2 8 */
9074
8.98k
        0x12, /* st2 9 */
9075
8.98k
        0x2, /* st1 10 */
9076
8.98k
        0, 0, 0, 0, 0
9077
8.98k
      };
9078
8.98k
      int rd = ((given >> 12) & 0xf) | (((given >> 22) & 1) << 4);
9079
8.98k
      int rn = ((given >> 16) & 0xf);
9080
8.98k
      int rm = ((given >> 0) & 0xf);
9081
8.98k
      int align = ((given >> 4) & 0x3);
9082
8.98k
      int type = ((given >> 8) & 0xf);
9083
8.98k
      int n = enc[type] & 0xf;
9084
8.98k
      int stride = (enc[type] >> 4) + 1;
9085
8.98k
      int ix;
9086
9087
8.98k
      func (stream, dis_style_text, "{");
9088
8.98k
      if (stride > 1)
9089
10.7k
        for (ix = 0; ix != n; ix++)
9090
7.91k
          {
9091
7.91k
            if (ix > 0)
9092
5.04k
        func (stream, dis_style_text, ",");
9093
7.91k
            func (stream, dis_style_register, "d%d",
9094
7.91k
            rd + ix * stride);
9095
7.91k
          }
9096
6.11k
      else if (n == 1)
9097
593
        func (stream, dis_style_register, "d%d", rd);
9098
5.51k
      else
9099
5.51k
        {
9100
5.51k
          func (stream, dis_style_register, "d%d", rd);
9101
5.51k
          func (stream, dis_style_text, "-");
9102
5.51k
          func (stream, dis_style_register, "d%d",
9103
5.51k
          rd + n - 1);
9104
5.51k
        }
9105
8.98k
      func (stream, dis_style_text, "}, [");
9106
8.98k
      func (stream, dis_style_register, "%s",
9107
8.98k
            arm_regnames[rn]);
9108
8.98k
      if (align)
9109
5.10k
        {
9110
5.10k
          func (stream, dis_style_text, " :");
9111
5.10k
          func (stream, dis_style_immediate, "%d",
9112
5.10k
          32 << align);
9113
5.10k
        }
9114
8.98k
      func (stream, dis_style_text, "]");
9115
8.98k
      if (rm == 0xd)
9116
1.35k
        func (stream, dis_style_text, "!");
9117
7.63k
      else if (rm != 0xf)
9118
7.07k
        {
9119
7.07k
          func (stream, dis_style_text, ", ");
9120
7.07k
          func (stream, dis_style_register, "%s",
9121
7.07k
          arm_regnames[rm]);
9122
7.07k
        }
9123
8.98k
          }
9124
8.98k
          break;
9125
9126
7.88k
        case 'B':
9127
7.88k
          {
9128
7.88k
      int rd = ((given >> 12) & 0xf) | (((given >> 22) & 1) << 4);
9129
7.88k
      int rn = ((given >> 16) & 0xf);
9130
7.88k
      int rm = ((given >> 0) & 0xf);
9131
7.88k
      int idx_align = ((given >> 4) & 0xf);
9132
7.88k
                        int align = 0;
9133
7.88k
      int size = ((given >> 10) & 0x3);
9134
7.88k
      int idx = idx_align >> (size + 1);
9135
7.88k
                        int length = ((given >> 8) & 3) + 1;
9136
7.88k
                        int stride = 1;
9137
7.88k
                        int i;
9138
9139
7.88k
                        if (length > 1 && size > 0)
9140
4.34k
                          stride = (idx_align & (1 << size)) ? 2 : 1;
9141
9142
7.88k
                        switch (length)
9143
7.88k
                          {
9144
2.71k
                          case 1:
9145
2.71k
                            {
9146
2.71k
                              int amask = (1 << size) - 1;
9147
2.71k
                              if ((idx_align & (1 << size)) != 0)
9148
1.08k
                                return false;
9149
1.62k
                              if (size > 0)
9150
1.08k
                                {
9151
1.08k
                                  if ((idx_align & amask) == amask)
9152
321
                                    align = 8 << size;
9153
760
                                  else if ((idx_align & amask) != 0)
9154
401
                                    return false;
9155
1.08k
                                }
9156
1.62k
                              }
9157
1.22k
                            break;
9158
9159
1.32k
                          case 2:
9160
1.32k
                            if (size == 2 && (idx_align & 2) != 0)
9161
300
                              return false;
9162
1.02k
                            align = (idx_align & 1) ? 16 << size : 0;
9163
1.02k
                            break;
9164
9165
1.85k
                          case 3:
9166
1.85k
                            if ((size == 2 && (idx_align & 3) != 0)
9167
1.50k
                                || (idx_align & 1) != 0)
9168
1.34k
                              return false;
9169
504
                            break;
9170
9171
1.99k
                          case 4:
9172
1.99k
                            if (size == 2)
9173
944
                              {
9174
944
                                if ((idx_align & 3) == 3)
9175
362
                                  return false;
9176
582
                                align = (idx_align & 3) * 64;
9177
582
                              }
9178
1.05k
                            else
9179
1.05k
                              align = (idx_align & 1) ? 32 << size : 0;
9180
1.63k
                            break;
9181
9182
1.63k
                          default:
9183
0
                            abort ();
9184
7.88k
                          }
9185
9186
4.38k
      func (stream, dis_style_text, "{");
9187
15.7k
                        for (i = 0; i < length; i++)
9188
11.3k
        {
9189
11.3k
          if (i > 0)
9190
6.93k
            func (stream, dis_style_text, ",");
9191
11.3k
          func (stream, dis_style_register, "d%d[%d]",
9192
11.3k
          rd + i * stride, idx);
9193
11.3k
        }
9194
4.38k
      func (stream, dis_style_text, "}, [");
9195
4.38k
      func (stream, dis_style_register, "%s",
9196
4.38k
            arm_regnames[rn]);
9197
4.38k
      if (align)
9198
1.68k
        {
9199
1.68k
          func (stream, dis_style_text, " :");
9200
1.68k
          func (stream, dis_style_immediate, "%d", align);
9201
1.68k
        }
9202
4.38k
      func (stream, dis_style_text, "]");
9203
4.38k
      if (rm == 0xd)
9204
380
        func (stream, dis_style_text, "!");
9205
4.00k
      else if (rm != 0xf)
9206
3.04k
        {
9207
3.04k
          func (stream, dis_style_text, ", ");
9208
3.04k
          func (stream, dis_style_register, "%s",
9209
3.04k
          arm_regnames[rm]);
9210
3.04k
        }
9211
4.38k
          }
9212
0
          break;
9213
9214
2.62k
        case 'C':
9215
2.62k
          {
9216
2.62k
      int rd = ((given >> 12) & 0xf) | (((given >> 22) & 1) << 4);
9217
2.62k
      int rn = ((given >> 16) & 0xf);
9218
2.62k
      int rm = ((given >> 0) & 0xf);
9219
2.62k
      int align = ((given >> 4) & 0x1);
9220
2.62k
      int size = ((given >> 6) & 0x3);
9221
2.62k
      int type = ((given >> 8) & 0x3);
9222
2.62k
      int n = type + 1;
9223
2.62k
      int stride = ((given >> 5) & 0x1);
9224
2.62k
      int ix;
9225
9226
2.62k
      if (stride && (n == 1))
9227
556
        n++;
9228
2.06k
      else
9229
2.06k
        stride++;
9230
9231
2.62k
      func (stream, dis_style_text, "{");
9232
2.62k
      if (stride > 1)
9233
4.87k
        for (ix = 0; ix != n; ix++)
9234
3.83k
          {
9235
3.83k
            if (ix > 0)
9236
2.79k
        func (stream, dis_style_text, ",");
9237
3.83k
            func (stream, dis_style_register, "d%d[]",
9238
3.83k
            rd + ix * stride);
9239
3.83k
          }
9240
1.58k
      else if (n == 1)
9241
323
        func (stream, dis_style_register, "d%d[]", rd);
9242
1.26k
      else
9243
1.26k
        {
9244
1.26k
          func (stream, dis_style_register, "d%d[]", rd);
9245
1.26k
          func (stream, dis_style_text, "-");
9246
1.26k
          func (stream, dis_style_register, "d%d[]",
9247
1.26k
          rd + n - 1);
9248
1.26k
        }
9249
2.62k
      func (stream, dis_style_text, "}, [");
9250
2.62k
      func (stream, dis_style_register, "%s",
9251
2.62k
            arm_regnames[rn]);
9252
2.62k
      if (align)
9253
1.82k
        {
9254
1.82k
                            align = (8 * (type + 1)) << size;
9255
1.82k
                            if (type == 3)
9256
774
                              align = (size > 1) ? align >> 1 : align;
9257
1.82k
          if (type == 2 || (type == 0 && !size))
9258
653
            func (stream, dis_style_text,
9259
653
            " :<bad align %d>", align);
9260
1.17k
          else
9261
1.17k
            {
9262
1.17k
        func (stream, dis_style_text, " :");
9263
1.17k
        func (stream, dis_style_immediate,
9264
1.17k
              "%d", align);
9265
1.17k
            }
9266
1.82k
        }
9267
2.62k
      func (stream, dis_style_text, "]");
9268
2.62k
      if (rm == 0xd)
9269
399
        func (stream, dis_style_text, "!");
9270
2.22k
      else if (rm != 0xf)
9271
1.51k
        {
9272
1.51k
          func (stream, dis_style_text, ", ");
9273
1.51k
          func (stream, dis_style_register, "%s",
9274
1.51k
          arm_regnames[rm]);
9275
1.51k
        }
9276
2.62k
          }
9277
2.62k
          break;
9278
9279
3.44k
        case 'D':
9280
3.44k
          {
9281
3.44k
      int raw_reg = (given & 0xf) | ((given >> 1) & 0x10);
9282
3.44k
      int size = (given >> 20) & 3;
9283
3.44k
      int reg = raw_reg & ((4 << size) - 1);
9284
3.44k
      int ix = raw_reg >> size >> 2;
9285
9286
3.44k
      func (stream, dis_style_register, "d%d[%d]", reg, ix);
9287
3.44k
          }
9288
3.44k
          break;
9289
9290
3.03k
        case 'E':
9291
          /* Neon encoded constant for mov, mvn, vorr, vbic.  */
9292
3.03k
          {
9293
3.03k
      int bits = 0;
9294
3.03k
      int cmode = (given >> 8) & 0xf;
9295
3.03k
      int op = (given >> 5) & 0x1;
9296
3.03k
      unsigned long value = 0, hival = 0;
9297
3.03k
      unsigned shift;
9298
3.03k
                        int size = 0;
9299
3.03k
                        int isfloat = 0;
9300
9301
3.03k
      bits |= ((given >> 24) & 1) << 7;
9302
3.03k
      bits |= ((given >> 16) & 7) << 4;
9303
3.03k
      bits |= ((given >> 0) & 15) << 0;
9304
9305
3.03k
      if (cmode < 8)
9306
835
        {
9307
835
          shift = (cmode >> 1) & 3;
9308
835
          value = (unsigned long) bits << (8 * shift);
9309
835
                            size = 32;
9310
835
        }
9311
2.20k
      else if (cmode < 12)
9312
323
        {
9313
323
          shift = (cmode >> 1) & 1;
9314
323
          value = (unsigned long) bits << (8 * shift);
9315
323
                            size = 16;
9316
323
        }
9317
1.87k
      else if (cmode < 14)
9318
259
        {
9319
259
          shift = (cmode & 1) + 1;
9320
259
          value = (unsigned long) bits << (8 * shift);
9321
259
          value |= (1ul << (8 * shift)) - 1;
9322
259
                            size = 32;
9323
259
        }
9324
1.61k
      else if (cmode == 14)
9325
1.00k
        {
9326
1.00k
          if (op)
9327
647
            {
9328
        /* Bit replication into bytes.  */
9329
647
        int ix;
9330
647
        unsigned long mask;
9331
9332
647
        value = 0;
9333
647
                                hival = 0;
9334
5.82k
        for (ix = 7; ix >= 0; ix--)
9335
5.17k
          {
9336
5.17k
            mask = ((bits >> ix) & 1) ? 0xff : 0;
9337
5.17k
                                    if (ix <= 3)
9338
2.58k
              value = (value << 8) | mask;
9339
2.58k
                                    else
9340
2.58k
                                      hival = (hival << 8) | mask;
9341
5.17k
          }
9342
647
                                size = 64;
9343
647
            }
9344
359
                            else
9345
359
                              {
9346
                                /* Byte replication.  */
9347
359
                                value = (unsigned long) bits;
9348
359
                                size = 8;
9349
359
                              }
9350
1.00k
        }
9351
612
      else if (!op)
9352
612
        {
9353
          /* Floating point encoding.  */
9354
612
          int tmp;
9355
9356
612
          value = (unsigned long)  (bits & 0x7f) << 19;
9357
612
          value |= (unsigned long) (bits & 0x80) << 24;
9358
612
          tmp = bits & 0x40 ? 0x3c : 0x40;
9359
612
          value |= (unsigned long) tmp << 24;
9360
612
                            size = 32;
9361
612
                            isfloat = 1;
9362
612
        }
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.03k
                        switch (size)
9372
3.03k
                          {
9373
359
                          case 8:
9374
359
          func (stream, dis_style_immediate, "#%ld", value);
9375
359
          func (stream, dis_style_comment_start,
9376
359
          "\t@ 0x%.2lx", value);
9377
359
                            break;
9378
9379
323
                          case 16:
9380
323
          func (stream, dis_style_immediate, "#%ld", value);
9381
323
          func (stream, dis_style_comment_start,
9382
323
          "\t@ 0x%.4lx", value);
9383
323
                            break;
9384
9385
1.70k
                          case 32:
9386
1.70k
                            if (isfloat)
9387
612
                              {
9388
612
                                unsigned char valbytes[4];
9389
612
                                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
612
                                valbytes[0] = value & 0xff;
9394
612
                                valbytes[1] = (value >> 8) & 0xff;
9395
612
                                valbytes[2] = (value >> 16) & 0xff;
9396
612
                                valbytes[3] = (value >> 24) & 0xff;
9397
9398
612
                                floatformat_to_double
9399
612
                                  (& floatformat_ieee_single_little, valbytes,
9400
612
                                  & fvalue);
9401
9402
612
        func (stream, dis_style_immediate,
9403
612
              "#%.7g", fvalue);
9404
612
        func (stream, dis_style_comment_start,
9405
612
              "\t@ 0x%.8lx", value);
9406
612
                              }
9407
1.09k
                            else
9408
1.09k
            {
9409
1.09k
        func (stream, dis_style_immediate, "#%ld",
9410
1.09k
              (long) (((value & 0x80000000L) != 0)
9411
1.09k
                ? value | ~0xffffffffL : value));
9412
1.09k
        func (stream, dis_style_comment_start,
9413
1.09k
              "\t@ 0x%.8lx", value);
9414
1.09k
            }
9415
1.70k
                            break;
9416
9417
647
                          case 64:
9418
647
          func (stream, dis_style_immediate,
9419
647
          "#0x%.8lx%.8lx", hival, value);
9420
647
                            break;
9421
9422
0
                          default:
9423
0
                            abort ();
9424
3.03k
                          }
9425
3.03k
          }
9426
3.03k
          break;
9427
9428
3.03k
        case 'F':
9429
2.22k
          {
9430
2.22k
      int regno = ((given >> 16) & 0xf) | ((given >> (7 - 4)) & 0x10);
9431
2.22k
      int num = (given >> 8) & 0x3;
9432
9433
2.22k
      func (stream, dis_style_text, "{");
9434
2.22k
      if (!num)
9435
402
        func (stream, dis_style_register, "d%d", regno);
9436
1.81k
      else if (num + regno >= 32)
9437
1.15k
        {
9438
1.15k
          func (stream, dis_style_register, "d%d", regno);
9439
1.15k
          func (stream, dis_style_text, "-<overflow reg d%d",
9440
1.15k
          regno + num);
9441
1.15k
        }
9442
660
      else
9443
660
        {
9444
660
          func (stream, dis_style_register, "d%d", regno);
9445
660
          func (stream, dis_style_text, "-");
9446
660
          func (stream, dis_style_register, "d%d",
9447
660
          regno + num);
9448
660
        }
9449
2.22k
      func (stream, dis_style_text, "}");
9450
2.22k
          }
9451
2.22k
          break;
9452
9453
9454
265k
        case '0': case '1': case '2': case '3': case '4':
9455
279k
        case '5': case '6': case '7': case '8': case '9':
9456
279k
          {
9457
279k
      int width;
9458
279k
      unsigned long value;
9459
9460
279k
      c = arm_decode_bitfield (c, given, &value, &width);
9461
9462
279k
      switch (*c)
9463
279k
        {
9464
527
        case 'r':
9465
527
          func (stream, dis_style_register, "%s",
9466
527
          arm_regnames[value]);
9467
527
          break;
9468
5.08k
        case 'd':
9469
5.08k
          func (stream, base_style, "%ld", value);
9470
5.08k
          value_in_comment = value;
9471
5.08k
          break;
9472
15.7k
        case 'e':
9473
15.7k
          func (stream, dis_style_immediate, "%ld",
9474
15.7k
          (1ul << width) - value);
9475
15.7k
          break;
9476
9477
41.3k
        case 'S':
9478
42.5k
        case 'T':
9479
42.5k
        case 'U':
9480
          /* Various width encodings.  */
9481
42.5k
          {
9482
42.5k
            int base = 8 << (*c - 'S'); /* 8,16 or 32 */
9483
42.5k
            int limit;
9484
42.5k
            unsigned low, high;
9485
9486
42.5k
            c++;
9487
42.5k
            if (*c >= '0' && *c <= '9')
9488
41.4k
        limit = *c - '0';
9489
1.12k
            else if (*c >= 'a' && *c <= 'f')
9490
1.12k
        limit = *c - 'a' + 10;
9491
0
            else
9492
0
        abort ();
9493
42.5k
            low = limit >> 2;
9494
42.5k
            high = limit & 3;
9495
9496
42.5k
            if (value < low || value > high)
9497
12.7k
        func (stream, dis_style_text,
9498
12.7k
              "<illegal width %d>", base << value);
9499
29.7k
            else
9500
29.7k
        func (stream, base_style, "%d",
9501
29.7k
              base << value);
9502
42.5k
          }
9503
0
          break;
9504
111k
        case 'R':
9505
111k
          if (given & (1 << 6))
9506
75.2k
            goto Q;
9507
          /* FALLTHROUGH */
9508
53.9k
        case 'D':
9509
53.9k
          func (stream, dis_style_register, "d%ld", value);
9510
53.9k
          break;
9511
18.1k
        case 'Q':
9512
93.3k
        Q:
9513
93.3k
          if (value & 1)
9514
47.2k
            func (stream, dis_style_text,
9515
47.2k
            "<illegal reg q%ld.5>", value >> 1);
9516
46.0k
          else
9517
46.0k
            func (stream, dis_style_register,
9518
46.0k
            "q%ld", value >> 1);
9519
93.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
68.2k
        case '?':
9532
68.2k
          func (stream, dis_style_mnemonic, "%c",
9533
68.2k
          c[(1 << width) - (int) value]);
9534
68.2k
          c += 1 << width;
9535
68.2k
          break;
9536
0
        default:
9537
0
          abort ();
9538
279k
        }
9539
279k
          }
9540
279k
          break;
9541
9542
279k
        default:
9543
0
          abort ();
9544
427k
        }
9545
427k
    }
9546
851k
        else
9547
851k
    {
9548
851k
      if (*c == '@')
9549
0
        base_style = dis_style_comment_start;
9550
9551
851k
      if (*c == '\t')
9552
79.7k
        base_style = dis_style_text;
9553
9554
851k
      func (stream, base_style, "%c", *c);
9555
9556
851k
    }
9557
1.27M
      }
9558
9559
76.2k
    if (value_in_comment > 32 || value_in_comment < -16)
9560
1.87k
      func (stream, dis_style_comment_start, "\t@ 0x%lx",
9561
1.87k
      value_in_comment);
9562
9563
76.2k
    if (is_unpredictable)
9564
294
      func (stream, dis_style_comment_start, UNPREDICTABLE_INSTRUCTION);
9565
9566
76.2k
    return true;
9567
79.7k
  }
9568
1.06G
    }
9569
3.45M
  return false;
9570
3.53M
}
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
581k
{
9579
581k
  const struct mopcode32 *insn;
9580
581k
  void *stream = info->stream;
9581
581k
  fprintf_styled_ftype func = info->fprintf_styled_func;
9582
581k
  enum disassembler_style base_style = dis_style_mnemonic;
9583
581k
  enum disassembler_style old_base_style = base_style;
9584
9585
115M
  for (insn = mve_opcodes; insn->assembler; insn++)
9586
114M
    {
9587
114M
      if (((given & insn->mask) == insn->value)
9588
210k
    && !is_mve_encoding_conflict (given, insn->mve_op))
9589
167k
  {
9590
167k
    signed long value_in_comment = 0;
9591
167k
    bool is_unpredictable = false;
9592
167k
    bool is_undefined = false;
9593
167k
    const char *c;
9594
167k
    enum mve_unpredictable unpredictable_cond = UNPRED_NONE;
9595
167k
    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
167k
    if (ifthen_state && !is_mve_okay_in_it (insn->mve_op))
9600
1.94k
      {
9601
1.94k
        is_unpredictable = true;
9602
1.94k
        unpredictable_cond = UNPRED_IT_BLOCK;
9603
1.94k
      }
9604
165k
    else if (is_mve_unpredictable (given, insn->mve_op,
9605
165k
           &unpredictable_cond))
9606
28.2k
      is_unpredictable = true;
9607
9608
167k
    if (is_mve_undefined (given, insn->mve_op, &undefined_cond))
9609
19.1k
      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
167k
    if ((insn->mve_op == MVE_VORR_REG)
9614
1.10k
        && (arm_decode_field (given, 1, 3)
9615
1.10k
      == arm_decode_field (given, 17, 19)))
9616
828
      continue;
9617
9618
2.99M
    for (c = insn->assembler; *c; c++)
9619
2.82M
      {
9620
2.82M
        if (*c == '%')
9621
911k
    {
9622
911k
      switch (*++c)
9623
911k
        {
9624
37.0k
        case '{':
9625
37.0k
          ++c;
9626
37.0k
          if (*c == '\0')
9627
0
      abort ();
9628
37.0k
          old_base_style = base_style;
9629
37.0k
          base_style = decode_base_style (*c);
9630
37.0k
          ++c;
9631
37.0k
          if (*c != ':')
9632
0
      abort ();
9633
37.0k
          break;
9634
9635
37.0k
        case '}':
9636
37.0k
          base_style = old_base_style;
9637
37.0k
          break;
9638
9639
0
        case '%':
9640
0
          func (stream, base_style, "%%");
9641
0
          break;
9642
9643
3.14k
        case 'a':
9644
          /* Don't print anything for '+' as it is implied.  */
9645
3.14k
          if (arm_decode_field (given, 23, 23) == 0)
9646
2.49k
      func (stream, dis_style_immediate, "-");
9647
3.14k
          break;
9648
9649
14.7k
        case 'c':
9650
14.7k
          if (ifthen_state)
9651
8.24k
      func (stream, dis_style_mnemonic, "%s",
9652
8.24k
            arm_conditional[IFTHEN_COND]);
9653
14.7k
          break;
9654
9655
8.57k
        case 'd':
9656
8.57k
          print_mve_vld_str_addr (info, given, insn->mve_op);
9657
8.57k
          break;
9658
9659
12.5k
        case 'i':
9660
12.5k
          {
9661
12.5k
      long mve_mask = mve_extract_pred_mask (given);
9662
12.5k
      func (stream, dis_style_mnemonic, "%s",
9663
12.5k
            mve_predicatenames[mve_mask]);
9664
12.5k
          }
9665
12.5k
          break;
9666
9667
6.08k
        case 'j':
9668
6.08k
          {
9669
6.08k
      unsigned int imm5 = 0;
9670
6.08k
      imm5 |= arm_decode_field (given, 6, 7);
9671
6.08k
      imm5 |= (arm_decode_field (given, 12, 14) << 2);
9672
6.08k
      func (stream, dis_style_immediate, "#%u",
9673
6.08k
            (imm5 == 0) ? 32 : imm5);
9674
6.08k
          }
9675
6.08k
          break;
9676
9677
1.26k
        case 'k':
9678
1.26k
          func (stream, dis_style_immediate, "#%u",
9679
1.26k
          (arm_decode_field (given, 7, 7) == 0) ? 64 : 48);
9680
1.26k
          break;
9681
9682
15.1k
        case 'n':
9683
15.1k
          print_vec_condition (info, given, insn->mve_op);
9684
15.1k
          break;
9685
9686
5.63k
        case 'o':
9687
5.63k
          if (arm_decode_field (given, 0, 0) == 1)
9688
3.34k
      {
9689
3.34k
        unsigned long size
9690
3.34k
          = arm_decode_field (given, 4, 4)
9691
3.34k
            | (arm_decode_field (given, 6, 6) << 1);
9692
9693
3.34k
        func (stream, dis_style_text, ", ");
9694
3.34k
        func (stream, dis_style_sub_mnemonic, "uxtw ");
9695
3.34k
        func (stream, dis_style_immediate, "#%lu", size);
9696
3.34k
      }
9697
5.63k
          break;
9698
9699
6.95k
        case 'm':
9700
6.95k
          print_mve_rounding_mode (info, given, insn->mve_op);
9701
6.95k
          break;
9702
9703
14.0k
        case 's':
9704
14.0k
          print_mve_vcvt_size (info, given, insn->mve_op);
9705
14.0k
          break;
9706
9707
36.3k
        case 'u':
9708
36.3k
          {
9709
36.3k
      unsigned long op1 = arm_decode_field (given, 21, 22);
9710
9711
36.3k
      if ((insn->mve_op == MVE_VMOV_VEC_LANE_TO_GP))
9712
1.33k
        {
9713
          /* Check for signed.  */
9714
1.33k
          if (arm_decode_field (given, 23, 23) == 0)
9715
504
            {
9716
        /* We don't print 's' for S32.  */
9717
504
        if ((arm_decode_field (given, 5, 6) == 0)
9718
0
            && ((op1 == 0) || (op1 == 1)))
9719
0
          ;
9720
504
        else
9721
504
          func (stream, dis_style_mnemonic, "s");
9722
504
            }
9723
829
          else
9724
829
            func (stream, dis_style_mnemonic, "u");
9725
1.33k
        }
9726
35.0k
      else
9727
35.0k
        {
9728
35.0k
          if (arm_decode_field (given, 28, 28) == 0)
9729
17.1k
            func (stream, dis_style_mnemonic, "s");
9730
17.9k
          else
9731
17.9k
            func (stream, dis_style_mnemonic, "u");
9732
35.0k
        }
9733
36.3k
          }
9734
36.3k
          break;
9735
9736
132k
        case 'v':
9737
132k
          print_instruction_predicate (info);
9738
132k
          break;
9739
9740
4.43k
        case 'w':
9741
4.43k
          if (arm_decode_field (given, 21, 21) == 1)
9742
2.17k
      func (stream, dis_style_text, "!");
9743
4.43k
          break;
9744
9745
3.40k
        case 'B':
9746
3.40k
          print_mve_register_blocks (info, given, insn->mve_op);
9747
3.40k
          break;
9748
9749
10.9k
        case 'E':
9750
          /* SIMD encoded constant for mov, mvn, vorr, vbic.  */
9751
9752
10.9k
          print_simd_imm8 (info, given, 28, insn);
9753
10.9k
          break;
9754
9755
2.26k
        case 'N':
9756
2.26k
          print_mve_vmov_index (info, given);
9757
2.26k
          break;
9758
9759
12.9k
        case 'T':
9760
12.9k
          if (arm_decode_field (given, 12, 12) == 0)
9761
6.81k
      func (stream, dis_style_mnemonic, "b");
9762
6.16k
          else
9763
6.16k
      func (stream, dis_style_mnemonic, "t");
9764
12.9k
          break;
9765
9766
4.54k
        case 'X':
9767
4.54k
          if (arm_decode_field (given, 12, 12) == 1)
9768
1.58k
      func (stream, dis_style_mnemonic, "x");
9769
4.54k
          break;
9770
9771
494k
        case '0': case '1': case '2': case '3': case '4':
9772
542k
        case '5': case '6': case '7': case '8': case '9':
9773
542k
          {
9774
542k
      int width;
9775
542k
      unsigned long value;
9776
9777
542k
      c = arm_decode_bitfield (c, given, &value, &width);
9778
9779
542k
      switch (*c)
9780
542k
        {
9781
13.1k
        case 'Z':
9782
13.1k
          if (value == 13)
9783
1.47k
            is_unpredictable = true;
9784
11.6k
          else if (value == 15)
9785
1.68k
            func (stream, dis_style_register, "zr");
9786
9.97k
          else
9787
9.97k
            func (stream, dis_style_register, "%s",
9788
9.97k
            arm_regnames[value]);
9789
13.1k
          break;
9790
9791
1.82k
        case 'c':
9792
1.82k
          func (stream, dis_style_sub_mnemonic, "%s",
9793
1.82k
          arm_conditional[value]);
9794
1.82k
          break;
9795
9796
1.45k
        case 'C':
9797
1.45k
          value ^= 1;
9798
1.45k
          func (stream, dis_style_sub_mnemonic, "%s",
9799
1.45k
          arm_conditional[value]);
9800
1.45k
          break;
9801
9802
9.41k
        case 'S':
9803
9.41k
          if (value == 13 || value == 15)
9804
2.52k
            is_unpredictable = true;
9805
6.88k
          else
9806
6.88k
            func (stream, dis_style_register, "%s",
9807
6.88k
            arm_regnames[value]);
9808
9.41k
          break;
9809
9810
118k
        case 's':
9811
118k
          print_mve_size (info,
9812
118k
              value,
9813
118k
              insn->mve_op);
9814
118k
          break;
9815
907
        case 'I':
9816
907
          if (value == 1)
9817
477
            func (stream, dis_style_mnemonic, "i");
9818
907
          break;
9819
6.07k
        case 'A':
9820
6.07k
          if (value == 1)
9821
1.81k
            func (stream, dis_style_mnemonic, "a");
9822
6.07k
          break;
9823
12.5k
        case 'h':
9824
12.5k
          {
9825
12.5k
            unsigned int odd_reg = (value << 1) | 1;
9826
12.5k
            func (stream, dis_style_register, "%s",
9827
12.5k
            arm_regnames[odd_reg]);
9828
12.5k
          }
9829
12.5k
          break;
9830
3.14k
        case 'i':
9831
3.14k
          {
9832
3.14k
            unsigned long imm
9833
3.14k
        = arm_decode_field (given, 0, 6);
9834
3.14k
            unsigned long mod_imm = imm;
9835
9836
3.14k
            switch (insn->mve_op)
9837
3.14k
        {
9838
587
        case MVE_VLDRW_GATHER_T5:
9839
1.39k
        case MVE_VSTRW_SCATTER_T5:
9840
1.39k
          mod_imm = mod_imm << 2;
9841
1.39k
          break;
9842
1.20k
        case MVE_VSTRD_SCATTER_T6:
9843
1.74k
        case MVE_VLDRD_GATHER_T6:
9844
1.74k
          mod_imm = mod_imm << 3;
9845
1.74k
          break;
9846
9847
0
        default:
9848
0
          break;
9849
3.14k
        }
9850
9851
3.14k
            func (stream, dis_style_immediate, "%lu",
9852
3.14k
            mod_imm);
9853
3.14k
          }
9854
0
          break;
9855
4.91k
        case 'k':
9856
4.91k
          func (stream, dis_style_immediate, "%lu",
9857
4.91k
          64 - value);
9858
4.91k
          break;
9859
15.9k
        case 'l':
9860
15.9k
          {
9861
15.9k
            unsigned int even_reg = value << 1;
9862
15.9k
            func (stream, dis_style_register, "%s",
9863
15.9k
            arm_regnames[even_reg]);
9864
15.9k
          }
9865
15.9k
          break;
9866
3.41k
        case 'u':
9867
3.41k
          switch (value)
9868
3.41k
            {
9869
704
            case 0:
9870
704
        func (stream, dis_style_immediate, "1");
9871
704
        break;
9872
395
            case 1:
9873
395
        func (stream, dis_style_immediate, "2");
9874
395
        break;
9875
1.77k
            case 2:
9876
1.77k
        func (stream, dis_style_immediate, "4");
9877
1.77k
        break;
9878
537
            case 3:
9879
537
        func (stream, dis_style_immediate, "8");
9880
537
        break;
9881
0
            default:
9882
0
        break;
9883
3.41k
            }
9884
3.41k
          break;
9885
7.31k
        case 'o':
9886
7.31k
          print_mve_rotate (info, value, width);
9887
7.31k
          break;
9888
42.7k
        case 'r':
9889
42.7k
          func (stream, dis_style_register, "%s",
9890
42.7k
          arm_regnames[value]);
9891
42.7k
          break;
9892
13.2k
        case 'd':
9893
13.2k
          if (mve_shift_insn_p (insn->mve_op))
9894
8.73k
            print_mve_shift_n (info, given, insn->mve_op);
9895
4.46k
          else if (insn->mve_op == MVE_VSHLL_T2)
9896
389
            func (stream, dis_style_immediate, "%s",
9897
389
            mve_vec_sizename[value]);
9898
4.07k
          else
9899
4.07k
            {
9900
4.07k
        if (insn->mve_op == MVE_VSHLC && value == 0)
9901
379
          value = 32;
9902
4.07k
        func (stream, base_style, "%ld", value);
9903
4.07k
        value_in_comment = value;
9904
4.07k
            }
9905
13.2k
          break;
9906
0
        case 'F':
9907
0
          func (stream, dis_style_register, "s%ld", value);
9908
0
          break;
9909
287k
        case 'Q':
9910
287k
          if (value & 0x8)
9911
130k
            func (stream, dis_style_text,
9912
130k
            "<illegal reg q%ld.5>", value);
9913
156k
          else
9914
156k
            func (stream, dis_style_register, "q%ld", value);
9915
287k
          break;
9916
514
        case 'x':
9917
514
          func (stream, dis_style_immediate,
9918
514
          "0x%08lx", value);
9919
514
          break;
9920
0
        default:
9921
0
          abort ();
9922
542k
        }
9923
542k
      break;
9924
542k
          default:
9925
0
      abort ();
9926
542k
          }
9927
911k
        }
9928
911k
    }
9929
1.91M
        else
9930
1.91M
    {
9931
1.91M
      if (*c == '@')
9932
514
        base_style = dis_style_comment_start;
9933
9934
1.91M
      if (*c == '\t')
9935
166k
        base_style = dis_style_text;
9936
9937
1.91M
      func (stream, base_style, "%c", *c);
9938
1.91M
    }
9939
2.82M
      }
9940
9941
166k
    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
166k
    if (is_unpredictable)
9946
33.2k
      print_mve_unpredictable (info, unpredictable_cond);
9947
9948
166k
    if (is_undefined)
9949
19.1k
      print_mve_undefined (info, undefined_cond);
9950
9951
166k
    if (!vpt_block_state.in_vpt_block
9952
152k
        && !ifthen_state
9953
142k
        && is_vpt_instruction (given))
9954
5.41k
      mark_inside_vpt_block (given);
9955
161k
    else if (vpt_block_state.in_vpt_block)
9956
14.3k
      update_vpt_block_state ();
9957
9958
166k
    return true;
9959
166k
  }
9960
114M
    }
9961
415k
  return false;
9962
581k
}
9963
9964
9965
/* Return the name of a v7A special register.  */
9966
9967
static const char *
9968
banked_regname (unsigned reg)
9969
79.9k
{
9970
79.9k
  switch (reg)
9971
79.9k
    {
9972
535
      case 15: return "CPSR";
9973
450
      case 32: return "R8_usr";
9974
285
      case 33: return "R9_usr";
9975
385
      case 34: return "R10_usr";
9976
538
      case 35: return "R11_usr";
9977
240
      case 36: return "R12_usr";
9978
455
      case 37: return "SP_usr";
9979
785
      case 38: return "LR_usr";
9980
491
      case 40: return "R8_fiq";
9981
243
      case 41: return "R9_fiq";
9982
300
      case 42: return "R10_fiq";
9983
338
      case 43: return "R11_fiq";
9984
237
      case 44: return "R12_fiq";
9985
551
      case 45: return "SP_fiq";
9986
542
      case 46: return "LR_fiq";
9987
2.17k
      case 48: return "LR_irq";
9988
2.76k
      case 49: return "SP_irq";
9989
391
      case 50: return "LR_svc";
9990
281
      case 51: return "SP_svc";
9991
320
      case 52: return "LR_abt";
9992
832
      case 53: return "SP_abt";
9993
287
      case 54: return "LR_und";
9994
835
      case 55: return "SP_und";
9995
669
      case 60: return "LR_mon";
9996
312
      case 61: return "SP_mon";
9997
599
      case 62: return "ELR_hyp";
9998
514
      case 63: return "SP_hyp";
9999
409
      case 79: return "SPSR";
10000
458
      case 110: return "SPSR_fiq";
10001
355
      case 112: return "SPSR_irq";
10002
413
      case 114: return "SPSR_svc";
10003
252
      case 116: return "SPSR_abt";
10004
239
      case 118: return "SPSR_und";
10005
896
      case 124: return "SPSR_mon";
10006
659
      case 126: return "SPSR_hyp";
10007
59.9k
      default: return NULL;
10008
79.9k
    }
10009
79.9k
}
10010
10011
/* Return the name of the DMB/DSB option.  */
10012
static const char *
10013
data_barrier_option (unsigned option)
10014
1.10k
{
10015
1.10k
  switch (option & 0xf)
10016
1.10k
    {
10017
36
    case 0xf: return "sy";
10018
10
    case 0xe: return "st";
10019
2
    case 0xd: return "ld";
10020
5
    case 0xb: return "ish";
10021
224
    case 0xa: return "ishst";
10022
14
    case 0x9: return "ishld";
10023
38
    case 0x7: return "un";
10024
59
    case 0x6: return "unst";
10025
91
    case 0x5: return "nshld";
10026
0
    case 0x3: return "osh";
10027
2
    case 0x2: return "oshst";
10028
4
    case 0x1: return "oshld";
10029
620
    default:  return NULL;
10030
1.10k
    }
10031
1.10k
}
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.44M
{
10038
3.44M
  const struct opcode32 *insn;
10039
3.44M
  void *stream = info->stream;
10040
3.44M
  fprintf_styled_ftype func = info->fprintf_styled_func;
10041
3.44M
  struct arm_private_data *private_data = info->private_data;
10042
3.44M
  enum disassembler_style base_style = dis_style_mnemonic;
10043
3.44M
  enum disassembler_style old_base_style = base_style;
10044
10045
3.44M
  if (print_insn_coprocessor (pc, info, given, false))
10046
20.9k
    return;
10047
10048
3.42M
  if (print_insn_neon (info, given, false))
10049
29.3k
    return;
10050
10051
3.39M
  if (print_insn_generic_coprocessor (pc, info, given, false))
10052
304k
    return;
10053
10054
832M
  for (insn = arm_opcodes; insn->assembler; insn++)
10055
832M
    {
10056
832M
      if ((given & insn->mask) != insn->value)
10057
828M
  continue;
10058
10059
3.37M
      if (! ARM_CPU_HAS_FEATURE (insn->arch, private_data->features))
10060
59.9k
  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.31M
      if ((given & 0xF0000000) != 0xF0000000
10066
453k
    || (insn->mask & 0xF0000000) == 0xF0000000
10067
445k
    || (insn->mask == 0 && insn->value == 0))
10068
3.09M
  {
10069
3.09M
    unsigned long u_reg = 16;
10070
3.09M
    unsigned long U_reg = 16;
10071
3.09M
    bool is_unpredictable = false;
10072
3.09M
    signed long value_in_comment = 0;
10073
3.09M
    const char *c;
10074
10075
45.5M
    for (c = insn->assembler; *c; c++)
10076
42.4M
      {
10077
42.4M
        if (*c == '%')
10078
13.0M
    {
10079
13.0M
      bool allow_unpredictable = false;
10080
10081
13.0M
      switch (*++c)
10082
13.0M
        {
10083
6.21k
        case '{':
10084
6.21k
          ++c;
10085
6.21k
          if (*c == '\0')
10086
0
      abort ();
10087
6.21k
          old_base_style = base_style;
10088
6.21k
          base_style = decode_base_style (*c);
10089
6.21k
          ++c;
10090
6.21k
          if (*c != ':')
10091
0
      abort ();
10092
6.21k
          break;
10093
10094
6.21k
        case '}':
10095
6.21k
          base_style = old_base_style;
10096
6.21k
          break;
10097
10098
0
        case '%':
10099
0
          func (stream, base_style, "%%");
10100
0
          break;
10101
10102
361k
        case 'a':
10103
361k
          value_in_comment = print_arm_address (pc, info, given);
10104
361k
          break;
10105
10106
194
        case 'P':
10107
          /* Set P address bit and use normal address
10108
       printing routine.  */
10109
194
          value_in_comment = print_arm_address (pc, info, given | (1 << P_BIT));
10110
194
          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
15.9k
        case 'S':
10125
15.9k
          allow_unpredictable = true;
10126
          /* Fall through.  */
10127
75.4k
        case 's':
10128
75.4k
                      if ((given & 0x004f0000) == 0x004f0000)
10129
11.3k
      {
10130
                          /* PC relative with immediate offset.  */
10131
11.3k
        bfd_vma offset = ((given & 0xf00) >> 4) | (given & 0xf);
10132
10133
11.3k
        if (PRE_BIT_SET)
10134
1.13k
          {
10135
            /* Elide positive zero offset.  */
10136
1.13k
            if (offset || NEGATIVE_BIT_SET)
10137
921
        {
10138
921
          func (stream, dis_style_text, "[");
10139
921
          func (stream, dis_style_register, "pc");
10140
921
          func (stream, dis_style_text, ", ");
10141
921
          func (stream, dis_style_immediate, "#%s%d",
10142
921
          (NEGATIVE_BIT_SET ? "-" : ""),
10143
921
          (int) offset);
10144
921
          func (stream, dis_style_text, "]");
10145
921
        }
10146
210
            else
10147
210
        {
10148
210
          func (stream, dis_style_text, "[");
10149
210
          func (stream, dis_style_register, "pc");
10150
210
          func (stream, dis_style_text, "]");
10151
210
        }
10152
1.13k
            if (NEGATIVE_BIT_SET)
10153
225
        offset = -offset;
10154
1.13k
            func (stream, dis_style_comment_start, "\t@ ");
10155
1.13k
            info->print_address_func (offset + pc + 8, info);
10156
1.13k
          }
10157
10.2k
        else
10158
10.2k
          {
10159
            /* Always show the offset.  */
10160
10.2k
            func (stream, dis_style_text, "[");
10161
10.2k
            func (stream, dis_style_register, "pc");
10162
10.2k
            func (stream, dis_style_text, "], ");
10163
10.2k
            func (stream, dis_style_immediate, "#%s%d",
10164
10.2k
            NEGATIVE_BIT_SET ? "-" : "", (int) offset);
10165
10.2k
            if (! allow_unpredictable)
10166
2.90k
        is_unpredictable = true;
10167
10.2k
          }
10168
11.3k
      }
10169
64.0k
          else
10170
64.0k
      {
10171
64.0k
        int offset = ((given & 0xf00) >> 4) | (given & 0xf);
10172
10173
64.0k
        func (stream, dis_style_text, "[");
10174
64.0k
        func (stream, dis_style_register, "%s",
10175
64.0k
        arm_regnames[(given >> 16) & 0xf]);
10176
10177
64.0k
        if (PRE_BIT_SET)
10178
10.0k
          {
10179
10.0k
            if (IMMEDIATE_BIT_SET)
10180
5.13k
        {
10181
          /* Elide offset for non-writeback
10182
             positive zero.  */
10183
5.13k
          if (WRITEBACK_BIT_SET || NEGATIVE_BIT_SET
10184
1.82k
              || offset)
10185
4.92k
            {
10186
4.92k
              func (stream, dis_style_text, ", ");
10187
4.92k
              func (stream, dis_style_immediate,
10188
4.92k
              "#%s%d",
10189
4.92k
              (NEGATIVE_BIT_SET ? "-" : ""),
10190
4.92k
              offset);
10191
4.92k
            }
10192
10193
5.13k
          if (NEGATIVE_BIT_SET)
10194
1.83k
            offset = -offset;
10195
10196
5.13k
          value_in_comment = offset;
10197
5.13k
        }
10198
4.92k
            else
10199
4.92k
        {
10200
          /* Register Offset or Register Pre-Indexed.  */
10201
4.92k
          func (stream, dis_style_text, ", %s",
10202
4.92k
          NEGATIVE_BIT_SET ? "-" : "");
10203
4.92k
          func (stream, dis_style_register, "%s",
10204
4.92k
          arm_regnames[given & 0xf]);
10205
10206
          /* Writing back to the register that is the source/
10207
             destination of the load/store is unpredictable.  */
10208
4.92k
          if (! allow_unpredictable
10209
4.92k
              && WRITEBACK_BIT_SET
10210
1.57k
              && ((given & 0xf) == ((given >> 12) & 0xf)))
10211
218
            is_unpredictable = true;
10212
4.92k
        }
10213
10214
10.0k
            func (stream, dis_style_text, "]%s",
10215
10.0k
            WRITEBACK_BIT_SET ? "!" : "");
10216
10.0k
          }
10217
54.0k
        else
10218
54.0k
          {
10219
54.0k
            if (IMMEDIATE_BIT_SET)
10220
9.48k
        {
10221
          /* Immediate Post-indexed.  */
10222
          /* PR 10924: Offset must be printed, even if it is zero.  */
10223
9.48k
          func (stream, dis_style_text, "], ");
10224
9.48k
          func (stream, dis_style_immediate, "#%s%d",
10225
9.48k
          NEGATIVE_BIT_SET ? "-" : "", offset);
10226
9.48k
          if (NEGATIVE_BIT_SET)
10227
3.11k
            offset = -offset;
10228
9.48k
          value_in_comment = offset;
10229
9.48k
        }
10230
44.5k
            else
10231
44.5k
        {
10232
          /* Register Post-indexed.  */
10233
44.5k
          func (stream, dis_style_text, "], %s",
10234
44.5k
          NEGATIVE_BIT_SET ? "-" : "");
10235
44.5k
          func (stream, dis_style_register, "%s",
10236
44.5k
          arm_regnames[given & 0xf]);
10237
10238
          /* Writing back to the register that is the source/
10239
             destination of the load/store is unpredictable.  */
10240
44.5k
          if (! allow_unpredictable
10241
39.5k
              && (given & 0xf) == ((given >> 12) & 0xf))
10242
9.62k
            is_unpredictable = true;
10243
44.5k
        }
10244
10245
54.0k
            if (! allow_unpredictable)
10246
45.3k
        {
10247
          /* Writeback is automatically implied by post- addressing.
10248
             Setting the W bit is unnecessary and ARM specify it as
10249
             being unpredictable.  */
10250
45.3k
          if (WRITEBACK_BIT_SET
10251
              /* Specifying the PC register as the post-indexed
10252
           registers is also unpredictable.  */
10253
40.6k
              || (! IMMEDIATE_BIT_SET && ((given & 0xf) == 0xf)))
10254
21.2k
            is_unpredictable = true;
10255
45.3k
        }
10256
54.0k
          }
10257
64.0k
      }
10258
75.4k
          break;
10259
10260
188k
        case 'b':
10261
188k
          {
10262
188k
      bfd_vma disp = (((given & 0xffffff) ^ 0x800000) - 0x800000);
10263
188k
      bfd_vma target = disp * 4 + pc + 8;
10264
188k
      info->print_address_func (target, info);
10265
10266
      /* Fill in instruction information.  */
10267
188k
      info->insn_info_valid = 1;
10268
188k
      info->insn_type = dis_branch;
10269
188k
      info->target = target;
10270
188k
          }
10271
188k
          break;
10272
10273
2.71M
        case 'c':
10274
2.71M
          if (((given >> 28) & 0xf) != 0xe)
10275
2.61M
      func (stream, dis_style_mnemonic, "%s",
10276
2.61M
            arm_conditional [(given >> 28) & 0xf]);
10277
2.71M
          break;
10278
10279
278k
        case 'm':
10280
278k
          {
10281
278k
      int started = 0;
10282
278k
      int reg;
10283
10284
278k
      func (stream, dis_style_text, "{");
10285
4.73M
      for (reg = 0; reg < 16; reg++)
10286
4.45M
        if ((given & (1 << reg)) != 0)
10287
1.71M
          {
10288
1.71M
            if (started)
10289
1.46M
        func (stream, dis_style_text, ", ");
10290
1.71M
            started = 1;
10291
1.71M
            func (stream, dis_style_register, "%s",
10292
1.71M
            arm_regnames[reg]);
10293
1.71M
          }
10294
278k
      func (stream, dis_style_text, "}");
10295
278k
      if (! started)
10296
23.0k
        is_unpredictable = true;
10297
278k
          }
10298
278k
          break;
10299
10300
1.21k
        case 'q':
10301
1.21k
          arm_decode_shift (given, func, stream, false);
10302
1.21k
          break;
10303
10304
1.61M
        case 'o':
10305
1.61M
          if ((given & 0x02000000) != 0)
10306
269k
      {
10307
269k
        unsigned int rotate = (given & 0xf00) >> 7;
10308
269k
        unsigned int immed = (given & 0xff);
10309
269k
        unsigned int a, i;
10310
10311
269k
        a = (immed << ((32 - rotate) & 31)
10312
269k
             | immed >> rotate) & 0xffffffff;
10313
        /* If there is another encoding with smaller rotate,
10314
           the rotate should be specified directly.  */
10315
1.37M
        for (i = 0; i < 32; i += 2)
10316
1.37M
          if ((a << i | a >> ((32 - i) & 31)) <= 0xff)
10317
269k
            break;
10318
10319
269k
        if (i != rotate)
10320
41.9k
          {
10321
41.9k
            func (stream, dis_style_immediate, "#%d", immed);
10322
41.9k
            func (stream, dis_style_text, ", ");
10323
41.9k
            func (stream, dis_style_immediate, "%d", rotate);
10324
41.9k
          }
10325
227k
        else
10326
227k
          func (stream, dis_style_immediate, "#%d", a);
10327
269k
        value_in_comment = a;
10328
269k
      }
10329
1.34M
          else
10330
1.34M
      arm_decode_shift (given, func, stream, true);
10331
1.61M
          break;
10332
10333
128k
        case 'p':
10334
128k
          if ((given & 0x0000f000) == 0x0000f000)
10335
3.89k
      func (stream, dis_style_mnemonic, "p");
10336
128k
          break;
10337
128k
        case 'O':
10338
128k
          if ((given & 0x0000f000) == 0x0000f000)
10339
3.89k
      func (stream, dis_style_text,
10340
3.89k
            "\t@ p-variant is OBSOLETE");
10341
128k
          break;
10342
10343
306k
        case 't':
10344
306k
          if ((given & 0x01200000) == 0x00200000)
10345
64.2k
      func (stream, dis_style_mnemonic, "t");
10346
306k
          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
6.40k
        case 'B':
10389
          /* Print ARM V5 BLX(1) address: pc+25 bits.  */
10390
6.40k
          {
10391
6.40k
      bfd_vma address;
10392
6.40k
      bfd_vma offset = 0;
10393
10394
6.40k
      if (! NEGATIVE_BIT_SET)
10395
        /* Is signed, hi bits should be ones.  */
10396
2.82k
        offset = (-1) ^ 0x00ffffff;
10397
10398
      /* Offset is (SignExtend(offset field)<<2).  */
10399
6.40k
      offset += given & 0x00ffffff;
10400
6.40k
      offset <<= 2;
10401
6.40k
      address = offset + pc + 8;
10402
10403
6.40k
      if (given & 0x01000000)
10404
        /* H bit allows addressing to 2-byte boundaries.  */
10405
3.03k
        address += 2;
10406
10407
6.40k
            info->print_address_func (address, info);
10408
10409
      /* Fill in instruction information.  */
10410
6.40k
      info->insn_info_valid = 1;
10411
6.40k
      info->insn_type = dis_branch;
10412
6.40k
      info->target = address;
10413
6.40k
          }
10414
6.40k
          break;
10415
10416
4.45k
        case 'C':
10417
4.45k
          if ((given & 0x02000200) == 0x200)
10418
1.43k
      {
10419
1.43k
        const char * name;
10420
1.43k
        unsigned sysm = (given & 0x004f0000) >> 16;
10421
10422
1.43k
        sysm |= (given & 0x300) >> 4;
10423
1.43k
        name = banked_regname (sysm);
10424
10425
1.43k
        if (name != NULL)
10426
1.09k
          func (stream, dis_style_register, "%s", name);
10427
341
        else
10428
341
          func (stream, dis_style_text,
10429
341
          "(UNDEF: %lu)", (unsigned long) sysm);
10430
1.43k
      }
10431
3.02k
          else
10432
3.02k
      {
10433
3.02k
        func (stream, dis_style_register, "%cPSR_",
10434
3.02k
        (given & 0x00400000) ? 'S' : 'C');
10435
10436
3.02k
        if (given & 0x80000)
10437
1.08k
          func (stream, dis_style_register, "f");
10438
3.02k
        if (given & 0x40000)
10439
1.63k
          func (stream, dis_style_register, "s");
10440
3.02k
        if (given & 0x20000)
10441
1.69k
          func (stream, dis_style_register, "x");
10442
3.02k
        if (given & 0x10000)
10443
1.12k
          func (stream, dis_style_register, "c");
10444
3.02k
      }
10445
4.45k
          break;
10446
10447
790
        case 'U':
10448
790
          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
399
          else
10462
399
      {
10463
399
        const char * opt = data_barrier_option (given & 0xf);
10464
399
        if (opt != NULL)
10465
201
          func (stream, dis_style_sub_mnemonic, "%s", opt);
10466
198
        else
10467
198
          func (stream, dis_style_immediate,
10468
198
          "#%d", (int) given & 0xf);
10469
399
      }
10470
790
          break;
10471
10472
7.12M
        case '0': case '1': case '2': case '3': case '4':
10473
7.20M
        case '5': case '6': case '7': case '8': case '9':
10474
7.20M
          {
10475
7.20M
      int width;
10476
7.20M
      unsigned long value;
10477
10478
7.20M
      c = arm_decode_bitfield (c, given, &value, &width);
10479
10480
7.20M
      switch (*c)
10481
7.20M
        {
10482
982k
        case 'R':
10483
982k
          if (value == 15)
10484
45.1k
            is_unpredictable = true;
10485
          /* Fall through.  */
10486
3.92M
        case 'r':
10487
3.92M
        case 'T':
10488
          /* We want register + 1 when decoding T.  */
10489
3.92M
          if (*c == 'T')
10490
194
            value = (value + 1) & 0xf;
10491
10492
3.92M
          if (c[1] == 'u')
10493
13.8k
            {
10494
        /* Eat the 'u' character.  */
10495
13.8k
        ++ c;
10496
10497
13.8k
        if (u_reg == value)
10498
1.21k
          is_unpredictable = true;
10499
13.8k
        u_reg = value;
10500
13.8k
            }
10501
3.92M
          if (c[1] == 'U')
10502
1.40k
            {
10503
        /* Eat the 'U' character.  */
10504
1.40k
        ++ c;
10505
10506
1.40k
        if (U_reg == value)
10507
324
          is_unpredictable = true;
10508
1.40k
        U_reg = value;
10509
1.40k
            }
10510
3.92M
          func (stream, dis_style_register, "%s",
10511
3.92M
          arm_regnames[value]);
10512
3.92M
          break;
10513
3.02k
        case 'd':
10514
3.02k
          func (stream, base_style, "%ld", value);
10515
3.02k
          value_in_comment = value;
10516
3.02k
          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
1.50k
        case 'W':
10523
1.50k
          func (stream, dis_style_immediate,
10524
1.50k
          "%ld", value + 1);
10525
1.50k
          value_in_comment = value + 1;
10526
1.50k
          break;
10527
469k
        case 'x':
10528
469k
          func (stream, dis_style_immediate,
10529
469k
          "0x%08lx", value);
10530
10531
          /* Some SWI instructions have special
10532
             meanings.  */
10533
469k
          if ((given & 0x0fffffff) == 0x0FF00000)
10534
234
            func (stream, dis_style_comment_start,
10535
234
            "\t@ IMB");
10536
468k
          else if ((given & 0x0fffffff) == 0x0FF00001)
10537
206
            func (stream, dis_style_comment_start,
10538
206
            "\t@ IMBRange");
10539
469k
          break;
10540
292
        case 'X':
10541
292
          func (stream, dis_style_immediate,
10542
292
          "%01lx", value & 0xf);
10543
292
          value_in_comment = value;
10544
292
          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.26M
        case '\'':
10551
2.26M
          c++;
10552
2.26M
          if (value == ((1ul << width) - 1))
10553
523k
            func (stream, base_style, "%c", *c);
10554
2.26M
          break;
10555
539k
        case '?':
10556
539k
          func (stream, base_style, "%c",
10557
539k
          c[(1 << width) - (int) value]);
10558
539k
          c += 1 << width;
10559
539k
          break;
10560
0
        default:
10561
0
          abort ();
10562
7.20M
        }
10563
7.20M
          }
10564
7.20M
          break;
10565
10566
7.20M
        case 'e':
10567
1.03k
          {
10568
1.03k
      int imm;
10569
10570
1.03k
      imm = (given & 0xf) | ((given & 0xfff00) >> 4);
10571
1.03k
      func (stream, dis_style_immediate, "%d", imm);
10572
1.03k
      value_in_comment = imm;
10573
1.03k
          }
10574
1.03k
          break;
10575
10576
993
        case 'E':
10577
          /* LSB and WIDTH fields of BFI or BFC.  The machine-
10578
       language instruction encodes LSB and MSB.  */
10579
993
          {
10580
993
      long msb = (given & 0x001f0000) >> 16;
10581
993
      long lsb = (given & 0x00000f80) >> 7;
10582
993
      long w = msb - lsb + 1;
10583
10584
993
      if (w > 0)
10585
350
        {
10586
350
          func (stream, dis_style_immediate, "#%lu", lsb);
10587
350
          func (stream, dis_style_text, ", ");
10588
350
          func (stream, dis_style_immediate, "#%lu", w);
10589
350
        }
10590
643
      else
10591
643
        func (stream, dis_style_text,
10592
643
        "(invalid: %lu:%lu)", lsb, msb);
10593
993
          }
10594
993
          break;
10595
10596
59.5k
        case 'R':
10597
          /* Get the PSR/banked register name.  */
10598
59.5k
          {
10599
59.5k
      const char * name;
10600
59.5k
      unsigned sysm = (given & 0x004f0000) >> 16;
10601
10602
59.5k
      sysm |= (given & 0x300) >> 4;
10603
59.5k
      name = banked_regname (sysm);
10604
10605
59.5k
      if (name != NULL)
10606
3.01k
        func (stream, dis_style_register, "%s", name);
10607
56.5k
      else
10608
56.5k
        func (stream, dis_style_text,
10609
56.5k
        "(UNDEF: %lu)", (unsigned long) sysm);
10610
59.5k
          }
10611
59.5k
          break;
10612
10613
19.6k
        case 'V':
10614
          /* 16-bit unsigned immediate from a MOVT or MOVW
10615
       instruction, encoded in bits 0:11 and 15:19.  */
10616
19.6k
          {
10617
19.6k
      long hi = (given & 0x000f0000) >> 4;
10618
19.6k
      long lo = (given & 0x00000fff);
10619
19.6k
      long imm16 = hi | lo;
10620
10621
19.6k
      func (stream, dis_style_immediate, "#%lu", imm16);
10622
19.6k
      value_in_comment = imm16;
10623
19.6k
          }
10624
19.6k
          break;
10625
10626
0
        default:
10627
0
          abort ();
10628
13.0M
        }
10629
13.0M
    }
10630
29.3M
        else
10631
29.3M
    {
10632
10633
29.3M
      if (*c == '@')
10634
371k
        base_style = dis_style_comment_start;
10635
10636
29.3M
      if (*c == '\t')
10637
3.46M
        base_style = dis_style_text;
10638
10639
29.3M
      func (stream, base_style, "%c", *c);
10640
29.3M
    }
10641
42.4M
      }
10642
10643
3.09M
    if (value_in_comment > 32 || value_in_comment < -16)
10644
421k
      func (stream, dis_style_comment_start, "\t@ 0x%lx",
10645
421k
      (value_in_comment & 0xffffffffUL));
10646
10647
3.09M
    if (is_unpredictable)
10648
92.1k
      func (stream, dis_style_comment_start, UNPREDICTABLE_INSTRUCTION);
10649
10650
3.09M
    return;
10651
3.09M
  }
10652
3.31M
    }
10653
1.24k
  func (stream, dis_style_comment_start, UNKNOWN_INSTRUCTION_32BIT,
10654
1.24k
  (unsigned) given);
10655
1.24k
  return;
10656
3.09M
}
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
2.85M
{
10663
2.85M
  const struct opcode16 *insn;
10664
2.85M
  void *stream = info->stream;
10665
2.85M
  fprintf_styled_ftype func = info->fprintf_styled_func;
10666
2.85M
  enum disassembler_style base_style = dis_style_mnemonic;
10667
2.85M
  enum disassembler_style old_base_style = base_style;
10668
10669
190M
  for (insn = thumb_opcodes; insn->assembler; insn++)
10670
190M
    if ((given & insn->mask) == insn->value)
10671
2.85M
      {
10672
2.85M
  signed long value_in_comment = 0;
10673
2.85M
  const char *c = insn->assembler;
10674
10675
41.9M
  for (; *c; c++)
10676
39.1M
    {
10677
39.1M
      int domaskpc = 0;
10678
39.1M
      int domasklr = 0;
10679
10680
39.1M
      if (*c != '%')
10681
25.5M
        {
10682
25.5M
    if (*c == '@')
10683
155k
      base_style = dis_style_comment_start;
10684
10685
25.5M
    if (*c == '\t')
10686
2.96M
      base_style = dis_style_text;
10687
10688
25.5M
    func (stream, base_style, "%c", *c);
10689
10690
25.5M
    continue;
10691
25.5M
        }
10692
10693
13.5M
      switch (*++c)
10694
13.5M
        {
10695
1.79M
    case '{':
10696
1.79M
      ++c;
10697
1.79M
      if (*c == '\0')
10698
0
        abort ();
10699
1.79M
      old_base_style = base_style;
10700
1.79M
      base_style = decode_base_style (*c);
10701
1.79M
      ++c;
10702
1.79M
      if (*c != ':')
10703
0
        abort ();
10704
1.79M
      break;
10705
10706
1.79M
    case '}':
10707
1.79M
      base_style = old_base_style;
10708
1.79M
      break;
10709
10710
0
        case '%':
10711
0
    func (stream, base_style, "%%");
10712
0
    break;
10713
10714
1.33M
        case 'c':
10715
1.33M
    if (ifthen_state)
10716
27.9k
      func (stream, dis_style_mnemonic, "%s",
10717
27.9k
      arm_conditional[IFTHEN_COND]);
10718
1.33M
    break;
10719
10720
1.33M
        case 'C':
10721
1.33M
    if (ifthen_state)
10722
31.8k
      func (stream, dis_style_mnemonic, "%s",
10723
31.8k
      arm_conditional[IFTHEN_COND]);
10724
1.30M
    else
10725
1.30M
      func (stream, dis_style_mnemonic, "s");
10726
1.33M
    break;
10727
10728
41.9k
        case 'I':
10729
41.9k
    {
10730
41.9k
      unsigned int tmp;
10731
10732
41.9k
      ifthen_next_state = given & 0xff;
10733
158k
      for (tmp = given << 1; tmp & 0xf; tmp <<= 1)
10734
116k
        func (stream, dis_style_mnemonic,
10735
116k
        ((given ^ tmp) & 0x10) ? "e" : "t");
10736
41.9k
      func (stream, dis_style_text, "\t");
10737
41.9k
      func (stream, dis_style_sub_mnemonic, "%s",
10738
41.9k
      arm_conditional[(given >> 4) & 0xf]);
10739
41.9k
    }
10740
41.9k
    break;
10741
10742
102k
        case 'x':
10743
102k
    if (ifthen_next_state)
10744
1.34k
      func (stream, dis_style_comment_start,
10745
1.34k
      "\t@ unpredictable branch in IT block\n");
10746
102k
    break;
10747
10748
156k
        case 'X':
10749
156k
    if (ifthen_state)
10750
23.3k
      func (stream, dis_style_comment_start,
10751
23.3k
      "\t@ unpredictable <IT:%s>",
10752
23.3k
      arm_conditional[IFTHEN_COND]);
10753
156k
    break;
10754
10755
27.6k
        case 'S':
10756
27.6k
    {
10757
27.6k
      long reg;
10758
10759
27.6k
      reg = (given >> 3) & 0x7;
10760
27.6k
      if (given & (1 << 6))
10761
19.3k
        reg += 8;
10762
10763
27.6k
      func (stream, dis_style_register, "%s", arm_regnames[reg]);
10764
27.6k
    }
10765
27.6k
    break;
10766
10767
19.4k
        case 'D':
10768
19.4k
    {
10769
19.4k
      long reg;
10770
10771
19.4k
      reg = given & 0x7;
10772
19.4k
      if (given & (1 << 7))
10773
8.31k
        reg += 8;
10774
10775
19.4k
      func (stream, dis_style_register, "%s", arm_regnames[reg]);
10776
19.4k
    }
10777
19.4k
    break;
10778
10779
11.6k
        case 'N':
10780
11.6k
    if (given & (1 << 8))
10781
8.84k
      domasklr = 1;
10782
    /* Fall through.  */
10783
20.3k
        case 'O':
10784
20.3k
    if (*c == 'O' && (given & (1 << 8)))
10785
5.35k
      domaskpc = 1;
10786
    /* Fall through.  */
10787
158k
        case 'M':
10788
158k
    {
10789
158k
      int started = 0;
10790
158k
      int reg;
10791
10792
158k
      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.43M
      for (reg = 0; (reg < 8); reg++)
10797
1.27M
        if ((given & (1 << reg)) != 0)
10798
657k
          {
10799
657k
      if (started)
10800
511k
        func (stream, dis_style_text, ", ");
10801
657k
      started = 1;
10802
657k
      func (stream, dis_style_register, "%s",
10803
657k
            arm_regnames[reg]);
10804
657k
          }
10805
10806
158k
      if (domasklr)
10807
8.84k
        {
10808
8.84k
          if (started)
10809
7.87k
      func (stream, dis_style_text, ", ");
10810
8.84k
          started = 1;
10811
8.84k
          func (stream, dis_style_register, "%s",
10812
8.84k
          arm_regnames[14] /* "lr" */);
10813
8.84k
        }
10814
10815
158k
      if (domaskpc)
10816
5.35k
        {
10817
5.35k
          if (started)
10818
4.70k
      func (stream, dis_style_text, ", ");
10819
5.35k
          func (stream, dis_style_register, "%s",
10820
5.35k
          arm_regnames[15] /* "pc" */);
10821
5.35k
        }
10822
10823
158k
      func (stream, dis_style_text, "}");
10824
158k
    }
10825
158k
    break;
10826
10827
77.4k
        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
77.4k
    if ((given & (1 << ((given & 0x0700) >> 8))) == 0)
10832
35.7k
      func (stream, dis_style_text, "!");
10833
77.4k
    break;
10834
10835
29.6k
        case 'b':
10836
    /* Print ARM V6T2 CZB address: pc+4+6 bits.  */
10837
29.6k
    {
10838
29.6k
      bfd_vma address = (pc + 4
10839
29.6k
             + ((given & 0x00f8) >> 2)
10840
29.6k
             + ((given & 0x0200) >> 3));
10841
29.6k
      info->print_address_func (address, info);
10842
10843
      /* Fill in instruction information.  */
10844
29.6k
      info->insn_info_valid = 1;
10845
29.6k
      info->insn_type = dis_branch;
10846
29.6k
      info->target = address;
10847
29.6k
    }
10848
29.6k
    break;
10849
10850
174k
        case 's':
10851
    /* Right shift immediate -- bits 6..10; 1-31 print
10852
       as themselves, 0 prints as 32.  */
10853
174k
    {
10854
174k
      long imm = (given & 0x07c0) >> 6;
10855
174k
      if (imm == 0)
10856
15.6k
        imm = 32;
10857
174k
      func (stream, dis_style_immediate, "#%ld", imm);
10858
174k
    }
10859
174k
    break;
10860
10861
4.57M
        case '0': case '1': case '2': case '3': case '4':
10862
6.53M
        case '5': case '6': case '7': case '8': case '9':
10863
6.53M
    {
10864
6.53M
      int bitstart = *c++ - '0';
10865
6.53M
      int bitend = 0;
10866
10867
6.62M
      while (*c >= '0' && *c <= '9')
10868
88.2k
        bitstart = (bitstart * 10) + *c++ - '0';
10869
10870
6.53M
      switch (*c)
10871
6.53M
        {
10872
6.44M
        case '-':
10873
6.44M
          {
10874
6.44M
      bfd_vma reg;
10875
10876
6.44M
      c++;
10877
14.7M
      while (*c >= '0' && *c <= '9')
10878
8.31M
        bitend = (bitend * 10) + *c++ - '0';
10879
6.44M
      if (!bitend)
10880
0
        abort ();
10881
6.44M
      reg = given >> bitstart;
10882
6.44M
      reg &= ((bfd_vma) 2 << (bitend - bitstart)) - 1;
10883
10884
6.44M
      switch (*c)
10885
6.44M
        {
10886
4.50M
        case 'r':
10887
4.50M
          func (stream, dis_style_register, "%s",
10888
4.50M
          arm_regnames[reg]);
10889
4.50M
          break;
10890
10891
855k
        case 'd':
10892
855k
          func (stream, dis_style_immediate, "%ld",
10893
855k
          (long) reg);
10894
855k
          value_in_comment = reg;
10895
855k
          break;
10896
10897
164k
        case 'H':
10898
164k
          func (stream, dis_style_immediate, "%ld",
10899
164k
          (long) (reg << 1));
10900
164k
          value_in_comment = reg << 1;
10901
164k
          break;
10902
10903
491k
        case 'W':
10904
491k
          func (stream, dis_style_immediate, "%ld",
10905
491k
          (long) (reg << 2));
10906
491k
          value_in_comment = reg << 2;
10907
491k
          break;
10908
10909
137k
        case 'a':
10910
          /* PC-relative address -- the bottom two
10911
             bits of the address are dropped
10912
             before the calculation.  */
10913
137k
          info->print_address_func
10914
137k
            (((pc + 4) & ~3) + (reg << 2), info);
10915
137k
          value_in_comment = 0;
10916
137k
          break;
10917
10918
25.8k
        case 'x':
10919
25.8k
          func (stream, dis_style_immediate, "0x%04lx",
10920
25.8k
          (long) reg);
10921
25.8k
          break;
10922
10923
176k
        case 'B':
10924
176k
          reg = ((reg ^ (1 << bitend)) - (1 << bitend));
10925
176k
          bfd_vma target = reg * 2 + pc + 4;
10926
176k
          info->print_address_func (target, info);
10927
176k
          value_in_comment = 0;
10928
10929
          /* Fill in instruction information.  */
10930
176k
          info->insn_info_valid = 1;
10931
176k
          info->insn_type = dis_branch;
10932
176k
          info->target = target;
10933
176k
          break;
10934
10935
83.6k
        case 'c':
10936
83.6k
          func (stream, dis_style_mnemonic, "%s",
10937
83.6k
          arm_conditional [reg]);
10938
83.6k
          break;
10939
10940
0
        default:
10941
0
          abort ();
10942
6.44M
        }
10943
6.44M
          }
10944
6.44M
          break;
10945
10946
6.44M
        case '\'':
10947
54.7k
          c++;
10948
54.7k
          if ((given & (1 << bitstart)) != 0)
10949
25.0k
      func (stream, base_style, "%c", *c);
10950
54.7k
          break;
10951
10952
35.9k
        case '?':
10953
35.9k
          ++c;
10954
35.9k
          if ((given & (1 << bitstart)) != 0)
10955
28.9k
      func (stream, base_style, "%c", *c++);
10956
6.97k
          else
10957
6.97k
      func (stream, base_style, "%c", *++c);
10958
35.9k
          break;
10959
10960
0
        default:
10961
0
          abort ();
10962
6.53M
        }
10963
6.53M
    }
10964
6.53M
    break;
10965
10966
6.53M
        default:
10967
0
    abort ();
10968
13.5M
        }
10969
13.5M
    }
10970
10971
2.85M
  if (value_in_comment > 32 || value_in_comment < -16)
10972
648k
    func (stream, dis_style_comment_start,
10973
648k
    "\t@ 0x%lx", value_in_comment);
10974
2.85M
  return;
10975
2.85M
      }
10976
10977
  /* No match.  */
10978
0
  func (stream, dis_style_comment_start, UNKNOWN_INSTRUCTION_16BIT,
10979
0
  (unsigned) given);
10980
0
  return;
10981
2.85M
}
10982
10983
/* Return the name of an V7M special register.  */
10984
10985
static const char *
10986
psr_name (int regno)
10987
18.1k
{
10988
18.1k
  switch (regno)
10989
18.1k
    {
10990
291
    case 0x0: return "APSR";
10991
336
    case 0x1: return "IAPSR";
10992
388
    case 0x2: return "EAPSR";
10993
236
    case 0x3: return "PSR";
10994
373
    case 0x5: return "IPSR";
10995
340
    case 0x6: return "EPSR";
10996
314
    case 0x7: return "IEPSR";
10997
522
    case 0x8: return "MSP";
10998
371
    case 0x9: return "PSP";
10999
301
    case 0xa: return "MSPLIM";
11000
469
    case 0xb: return "PSPLIM";
11001
311
    case 0x10: return "PRIMASK";
11002
575
    case 0x11: return "BASEPRI";
11003
230
    case 0x12: return "BASEPRI_MAX";
11004
310
    case 0x13: return "FAULTMASK";
11005
266
    case 0x14: return "CONTROL";
11006
492
    case 0x20: return "PAC_KEY_P_0";
11007
328
    case 0x21: return "PAC_KEY_P_1";
11008
459
    case 0x22: return "PAC_KEY_P_2";
11009
242
    case 0x23: return "PAC_KEY_P_3";
11010
247
    case 0x24: return "PAC_KEY_U_0";
11011
261
    case 0x25: return "PAC_KEY_U_1";
11012
442
    case 0x26: return "PAC_KEY_U_2";
11013
227
    case 0x27: return "PAC_KEY_U_3";
11014
293
    case 0x88: return "MSP_NS";
11015
391
    case 0x89: return "PSP_NS";
11016
423
    case 0x8a: return "MSPLIM_NS";
11017
593
    case 0x8b: return "PSPLIM_NS";
11018
304
    case 0x90: return "PRIMASK_NS";
11019
902
    case 0x91: return "BASEPRI_NS";
11020
208
    case 0x93: return "FAULTMASK_NS";
11021
275
    case 0x94: return "CONTROL_NS";
11022
399
    case 0x98: return "SP_NS";
11023
1.08k
    case 0xa0: return "PAC_KEY_P_0_NS";
11024
290
    case 0xa1: return "PAC_KEY_P_1_NS";
11025
523
    case 0xa2: return "PAC_KEY_P_2_NS";
11026
229
    case 0xa3: return "PAC_KEY_P_3_NS";
11027
411
    case 0xa4: return "PAC_KEY_U_0_NS";
11028
279
    case 0xa5: return "PAC_KEY_U_1_NS";
11029
430
    case 0xa6: return "PAC_KEY_U_2_NS";
11030
372
    case 0xa7: return "PAC_KEY_U_3_NS";
11031
2.43k
    default: return "<unknown>";
11032
18.1k
    }
11033
18.1k
}
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
819k
{
11040
819k
  const struct opcode32 *insn;
11041
819k
  void *stream = info->stream;
11042
819k
  fprintf_styled_ftype func = info->fprintf_styled_func;
11043
819k
  bool is_mve = is_v81m_architecture (info);
11044
819k
  enum disassembler_style base_style = dis_style_mnemonic;
11045
819k
  enum disassembler_style old_base_style = base_style;
11046
11047
819k
  if (print_insn_coprocessor (pc, info, given, true))
11048
30.5k
    return;
11049
11050
789k
  if (!is_mve && print_insn_neon (info, given, true))
11051
46.8k
    return;
11052
11053
742k
  if (is_mve && print_insn_mve (info, given))
11054
166k
    return;
11055
11056
575k
  if (print_insn_cde (info, given, true))
11057
9.17k
    return;
11058
11059
566k
  if (print_insn_generic_coprocessor (pc, info, given, true))
11060
72.2k
    return;
11061
11062
113M
  for (insn = thumb32_opcodes; insn->assembler; insn++)
11063
113M
    if ((given & insn->mask) == insn->value)
11064
494k
      {
11065
494k
  bool is_clrm = false;
11066
494k
  bool is_unpredictable = false;
11067
494k
  signed long value_in_comment = 0;
11068
494k
  const char *c = insn->assembler;
11069
11070
12.4M
  for (; *c; c++)
11071
11.9M
    {
11072
11.9M
      if (*c != '%')
11073
11.0M
        {
11074
11.0M
    if (*c == '@')
11075
345k
      base_style = dis_style_comment_start;
11076
11.0M
    if (*c == '\t')
11077
838k
      base_style = dis_style_text;
11078
11.0M
    func (stream, base_style, "%c", *c);
11079
11.0M
    continue;
11080
11.0M
        }
11081
11082
915k
      switch (*++c)
11083
915k
        {
11084
14.2k
        case '{':
11085
14.2k
    ++c;
11086
14.2k
    if (*c == '\0')
11087
0
      abort ();
11088
14.2k
    old_base_style = base_style;
11089
14.2k
    base_style = decode_base_style (*c);
11090
14.2k
    ++c;
11091
14.2k
    if (*c != ':')
11092
0
      abort ();
11093
14.2k
    break;
11094
11095
14.2k
        case '}':
11096
14.2k
    base_style = old_base_style;
11097
14.2k
    break;
11098
11099
0
        case '%':
11100
0
    func (stream, base_style, "%%");
11101
0
    break;
11102
11103
134k
        case 'c':
11104
134k
    if (ifthen_state)
11105
3.27k
      func (stream, dis_style_mnemonic, "%s",
11106
3.27k
      arm_conditional[IFTHEN_COND]);
11107
134k
    break;
11108
11109
30.2k
        case 'x':
11110
30.2k
    if (ifthen_next_state)
11111
1.03k
      func (stream, dis_style_comment_start,
11112
1.03k
      "\t@ unpredictable branch in IT block\n");
11113
30.2k
    break;
11114
11115
8.89k
        case 'X':
11116
8.89k
    if (ifthen_state)
11117
498
      func (stream, dis_style_comment_start,
11118
498
      "\t@ unpredictable <IT:%s>",
11119
498
      arm_conditional[IFTHEN_COND]);
11120
8.89k
    break;
11121
11122
1.40k
        case 'I':
11123
1.40k
    {
11124
1.40k
      unsigned int imm12 = 0;
11125
11126
1.40k
      imm12 |= (given & 0x000000ffu);
11127
1.40k
      imm12 |= (given & 0x00007000u) >> 4;
11128
1.40k
      imm12 |= (given & 0x04000000u) >> 15;
11129
1.40k
      func (stream, dis_style_immediate, "#%u", imm12);
11130
1.40k
      value_in_comment = imm12;
11131
1.40k
    }
11132
1.40k
    break;
11133
11134
9.64k
        case 'M':
11135
9.64k
    {
11136
9.64k
      unsigned int bits = 0, imm, imm8, mod;
11137
11138
9.64k
      bits |= (given & 0x000000ffu);
11139
9.64k
      bits |= (given & 0x00007000u) >> 4;
11140
9.64k
      bits |= (given & 0x04000000u) >> 15;
11141
9.64k
      imm8 = (bits & 0x0ff);
11142
9.64k
      mod = (bits & 0xf00) >> 8;
11143
9.64k
      switch (mod)
11144
9.64k
        {
11145
1.73k
        case 0: imm = imm8; break;
11146
490
        case 1: imm = ((imm8 << 16) | imm8); break;
11147
484
        case 2: imm = ((imm8 << 24) | (imm8 << 8)); break;
11148
1.05k
        case 3: imm = ((imm8 << 24) | (imm8 << 16) | (imm8 << 8) | imm8); break;
11149
5.88k
        default:
11150
5.88k
          mod  = (bits & 0xf80) >> 7;
11151
5.88k
          imm8 = (bits & 0x07f) | 0x80;
11152
5.88k
          imm  = (((imm8 << (32 - mod)) | (imm8 >> mod)) & 0xffffffff);
11153
9.64k
        }
11154
9.64k
      func (stream, dis_style_immediate, "#%u", imm);
11155
9.64k
      value_in_comment = imm;
11156
9.64k
    }
11157
0
    break;
11158
11159
484
        case 'J':
11160
484
    {
11161
484
      unsigned int imm = 0;
11162
11163
484
      imm |= (given & 0x000000ffu);
11164
484
      imm |= (given & 0x00007000u) >> 4;
11165
484
      imm |= (given & 0x04000000u) >> 15;
11166
484
      imm |= (given & 0x000f0000u) >> 4;
11167
484
      func (stream, dis_style_immediate, "#%u", imm);
11168
484
      value_in_comment = imm;
11169
484
    }
11170
484
    break;
11171
11172
314
        case 'K':
11173
314
    {
11174
314
      unsigned int imm = 0;
11175
11176
314
      imm |= (given & 0x000f0000u) >> 16;
11177
314
      imm |= (given & 0x00000ff0u) >> 0;
11178
314
      imm |= (given & 0x0000000fu) << 12;
11179
314
      func (stream, dis_style_immediate, "#%u", imm);
11180
314
      value_in_comment = imm;
11181
314
    }
11182
314
    break;
11183
11184
384
        case 'H':
11185
384
    {
11186
384
      unsigned int imm = 0;
11187
11188
384
      imm |= (given & 0x000f0000u) >> 4;
11189
384
      imm |= (given & 0x00000fffu) >> 0;
11190
384
      func (stream, dis_style_immediate, "#%u", imm);
11191
384
      value_in_comment = imm;
11192
384
    }
11193
384
    break;
11194
11195
350
        case 'V':
11196
350
    {
11197
350
      unsigned int imm = 0;
11198
11199
350
      imm |= (given & 0x00000fffu);
11200
350
      imm |= (given & 0x000f0000u) >> 4;
11201
350
      func (stream, dis_style_immediate, "#%u", imm);
11202
350
      value_in_comment = imm;
11203
350
    }
11204
350
    break;
11205
11206
6.46k
        case 'S':
11207
6.46k
    {
11208
6.46k
      unsigned int reg = (given & 0x0000000fu);
11209
6.46k
      unsigned int stp = (given & 0x00000030u) >> 4;
11210
6.46k
      unsigned int imm = 0;
11211
6.46k
      imm |= (given & 0x000000c0u) >> 6;
11212
6.46k
      imm |= (given & 0x00007000u) >> 10;
11213
11214
6.46k
      func (stream, dis_style_register, "%s", arm_regnames[reg]);
11215
6.46k
      switch (stp)
11216
6.46k
        {
11217
1.36k
        case 0:
11218
1.36k
          if (imm > 0)
11219
913
      {
11220
913
        func (stream, dis_style_text, ", ");
11221
913
        func (stream, dis_style_sub_mnemonic, "lsl ");
11222
913
        func (stream, dis_style_immediate, "#%u", imm);
11223
913
      }
11224
1.36k
          break;
11225
11226
1.58k
        case 1:
11227
1.58k
          if (imm == 0)
11228
407
      imm = 32;
11229
1.58k
          func (stream, dis_style_text, ", ");
11230
1.58k
          func (stream, dis_style_sub_mnemonic, "lsr ");
11231
1.58k
          func (stream, dis_style_immediate, "#%u", imm);
11232
1.58k
          break;
11233
11234
1.47k
        case 2:
11235
1.47k
          if (imm == 0)
11236
339
      imm = 32;
11237
1.47k
          func (stream, dis_style_text, ", ");
11238
1.47k
          func (stream, dis_style_sub_mnemonic, "asr ");
11239
1.47k
          func (stream, dis_style_immediate, "#%u", imm);
11240
1.47k
          break;
11241
11242
2.04k
        case 3:
11243
2.04k
          if (imm == 0)
11244
390
      {
11245
390
        func (stream, dis_style_text, ", ");
11246
390
        func (stream, dis_style_sub_mnemonic, "rrx");
11247
390
      }
11248
1.65k
          else
11249
1.65k
      {
11250
1.65k
        func (stream, dis_style_text, ", ");
11251
1.65k
        func (stream, dis_style_sub_mnemonic, "ror ");
11252
1.65k
        func (stream, dis_style_immediate, "#%u", imm);
11253
1.65k
      }
11254
6.46k
        }
11255
6.46k
    }
11256
6.46k
    break;
11257
11258
23.5k
        case 'a':
11259
23.5k
    {
11260
23.5k
      unsigned int Rn  = (given & 0x000f0000) >> 16;
11261
23.5k
      unsigned int U   = ! NEGATIVE_BIT_SET;
11262
23.5k
      unsigned int op  = (given & 0x00000f00) >> 8;
11263
23.5k
      unsigned int i12 = (given & 0x00000fff);
11264
23.5k
      unsigned int i8  = (given & 0x000000ff);
11265
23.5k
      bool writeback = false, postind = false;
11266
23.5k
      bfd_vma offset = 0;
11267
11268
23.5k
      func (stream, dis_style_text, "[");
11269
23.5k
      func (stream, dis_style_register, "%s", arm_regnames[Rn]);
11270
23.5k
      if (U) /* 12-bit positive immediate offset.  */
11271
13.5k
        {
11272
13.5k
          offset = i12;
11273
13.5k
          if (Rn != 15)
11274
10.6k
      value_in_comment = offset;
11275
13.5k
        }
11276
10.0k
      else if (Rn == 15) /* 12-bit negative immediate offset.  */
11277
820
        offset = - (int) i12;
11278
9.21k
      else if (op == 0x0) /* Shifted register offset.  */
11279
1.43k
        {
11280
1.43k
          unsigned int Rm = (i8 & 0x0f);
11281
1.43k
          unsigned int sh = (i8 & 0x30) >> 4;
11282
11283
1.43k
          func (stream, dis_style_text, ", ");
11284
1.43k
          func (stream, dis_style_register, "%s",
11285
1.43k
          arm_regnames[Rm]);
11286
1.43k
          if (sh)
11287
864
      {
11288
864
        func (stream, dis_style_text, ", ");
11289
864
        func (stream, dis_style_sub_mnemonic, "lsl ");
11290
864
        func (stream, dis_style_immediate, "#%u", sh);
11291
864
      }
11292
1.43k
          func (stream, dis_style_text, "]");
11293
1.43k
          break;
11294
1.43k
        }
11295
7.77k
      else switch (op)
11296
7.77k
        {
11297
627
        case 0xE:  /* 8-bit positive immediate offset.  */
11298
627
          offset = i8;
11299
627
          break;
11300
11301
819
        case 0xC:  /* 8-bit negative immediate offset.  */
11302
819
          offset = -i8;
11303
819
          break;
11304
11305
1.05k
        case 0xF:  /* 8-bit + preindex with wb.  */
11306
1.05k
          offset = i8;
11307
1.05k
          writeback = true;
11308
1.05k
          break;
11309
11310
669
        case 0xD:  /* 8-bit - preindex with wb.  */
11311
669
          offset = -i8;
11312
669
          writeback = true;
11313
669
          break;
11314
11315
830
        case 0xB:  /* 8-bit + postindex.  */
11316
830
          offset = i8;
11317
830
          postind = true;
11318
830
          break;
11319
11320
638
        case 0x9:  /* 8-bit - postindex.  */
11321
638
          offset = -i8;
11322
638
          postind = true;
11323
638
          break;
11324
11325
3.13k
        default:
11326
3.13k
          func (stream, dis_style_text, ", <undefined>]");
11327
3.13k
          goto skip;
11328
7.77k
        }
11329
11330
19.0k
      if (postind)
11331
1.46k
        {
11332
1.46k
          func (stream, dis_style_text, "], ");
11333
1.46k
          func (stream, dis_style_immediate, "#%d", (int) offset);
11334
1.46k
        }
11335
17.5k
      else
11336
17.5k
        {
11337
17.5k
          if (offset)
11338
16.0k
      {
11339
16.0k
        func (stream, dis_style_text, ", ");
11340
16.0k
        func (stream, dis_style_immediate, "#%d",
11341
16.0k
        (int) offset);
11342
16.0k
      }
11343
17.5k
          func (stream, dis_style_text, writeback ? "]!" : "]");
11344
17.5k
        }
11345
11346
19.0k
      if (Rn == 15)
11347
3.71k
        {
11348
3.71k
          func (stream, dis_style_comment_start, "\t@ ");
11349
3.71k
          info->print_address_func (((pc + 4) & ~3) + offset, info);
11350
3.71k
        }
11351
19.0k
    }
11352
22.1k
        skip:
11353
22.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
22.5k
        case 'w':
11399
22.5k
    {
11400
22.5k
      unsigned int Sbit = (given & 0x01000000) >> 24;
11401
22.5k
      unsigned int type = (given & 0x00600000) >> 21;
11402
11403
22.5k
      switch (type)
11404
22.5k
        {
11405
6.01k
        case 0:
11406
6.01k
          func (stream, dis_style_mnemonic, Sbit ? "sb" : "b");
11407
6.01k
          break;
11408
2.76k
        case 1:
11409
2.76k
          func (stream, dis_style_mnemonic, Sbit ? "sh" : "h");
11410
2.76k
          break;
11411
2.86k
        case 2:
11412
2.86k
          if (Sbit)
11413
632
      func (stream, dis_style_text, "??");
11414
2.86k
          break;
11415
10.9k
        case 3:
11416
10.9k
          func (stream, dis_style_text, "??");
11417
10.9k
          break;
11418
22.5k
        }
11419
22.5k
    }
11420
22.5k
    break;
11421
11422
22.5k
        case 'n':
11423
1.07k
    is_clrm = true;
11424
    /* Fall through.  */
11425
3.63k
        case 'm':
11426
3.63k
    {
11427
3.63k
      int started = 0;
11428
3.63k
      int reg;
11429
11430
3.63k
      func (stream, dis_style_text, "{");
11431
61.7k
      for (reg = 0; reg < 16; reg++)
11432
58.1k
        if ((given & (1 << reg)) != 0)
11433
29.5k
          {
11434
29.5k
      if (started)
11435
25.9k
        func (stream, dis_style_text, ", ");
11436
29.5k
      started = 1;
11437
29.5k
      if (is_clrm && reg == 13)
11438
0
        func (stream, dis_style_text, "(invalid: %s)",
11439
0
        arm_regnames[reg]);
11440
29.5k
      else if (is_clrm && reg == 15)
11441
1.02k
        func (stream, dis_style_register, "%s", "APSR");
11442
28.4k
      else
11443
28.4k
        func (stream, dis_style_register, "%s",
11444
28.4k
        arm_regnames[reg]);
11445
29.5k
          }
11446
3.63k
      func (stream, dis_style_text, "}");
11447
3.63k
    }
11448
3.63k
    break;
11449
11450
919
        case 'E':
11451
919
    {
11452
919
      unsigned int msb = (given & 0x0000001f);
11453
919
      unsigned int lsb = 0;
11454
11455
919
      lsb |= (given & 0x000000c0u) >> 6;
11456
919
      lsb |= (given & 0x00007000u) >> 10;
11457
919
      func (stream, dis_style_immediate, "#%u", lsb);
11458
919
      func (stream, dis_style_text, ", ");
11459
919
      func (stream, dis_style_immediate, "#%u", msb - lsb + 1);
11460
919
    }
11461
919
    break;
11462
11463
406
        case 'F':
11464
406
    {
11465
406
      unsigned int width = (given & 0x0000001f) + 1;
11466
406
      unsigned int lsb = 0;
11467
11468
406
      lsb |= (given & 0x000000c0u) >> 6;
11469
406
      lsb |= (given & 0x00007000u) >> 10;
11470
406
      func (stream, dis_style_immediate, "#%u", lsb);
11471
406
      func (stream, dis_style_text, ", ");
11472
406
      func (stream, dis_style_immediate, "#%u", width);
11473
406
    }
11474
406
    break;
11475
11476
6.10k
        case 'G':
11477
6.10k
    {
11478
6.10k
      unsigned int boff = (((given & 0x07800000) >> 23) << 1);
11479
6.10k
      func (stream, dis_style_immediate, "%x", boff);
11480
6.10k
    }
11481
6.10k
    break;
11482
11483
1.06k
        case 'W':
11484
1.06k
    {
11485
1.06k
      unsigned int immA = (given & 0x001f0000u) >> 16;
11486
1.06k
      unsigned int immB = (given & 0x000007feu) >> 1;
11487
1.06k
      unsigned int immC = (given & 0x00000800u) >> 11;
11488
1.06k
      bfd_vma offset = 0;
11489
11490
1.06k
      offset |= immA << 12;
11491
1.06k
      offset |= immB << 2;
11492
1.06k
      offset |= immC << 1;
11493
      /* Sign extend.  */
11494
1.06k
      offset = (offset & 0x10000) ? offset - (1 << 17) : offset;
11495
11496
1.06k
      info->print_address_func (pc + 4 + offset, info);
11497
1.06k
    }
11498
1.06k
    break;
11499
11500
2.87k
        case 'Y':
11501
2.87k
    {
11502
2.87k
      unsigned int immA = (given & 0x007f0000u) >> 16;
11503
2.87k
      unsigned int immB = (given & 0x000007feu) >> 1;
11504
2.87k
      unsigned int immC = (given & 0x00000800u) >> 11;
11505
2.87k
      bfd_vma offset = 0;
11506
11507
2.87k
      offset |= immA << 12;
11508
2.87k
      offset |= immB << 2;
11509
2.87k
      offset |= immC << 1;
11510
      /* Sign extend.  */
11511
2.87k
      offset = (offset & 0x40000) ? offset - (1 << 19) : offset;
11512
11513
2.87k
      info->print_address_func (pc + 4 + offset, info);
11514
2.87k
    }
11515
2.87k
    break;
11516
11517
2.09k
        case 'Z':
11518
2.09k
    {
11519
2.09k
      unsigned int immA = (given & 0x00010000u) >> 16;
11520
2.09k
      unsigned int immB = (given & 0x000007feu) >> 1;
11521
2.09k
      unsigned int immC = (given & 0x00000800u) >> 11;
11522
2.09k
      bfd_vma offset = 0;
11523
11524
2.09k
      offset |= immA << 12;
11525
2.09k
      offset |= immB << 2;
11526
2.09k
      offset |= immC << 1;
11527
      /* Sign extend.  */
11528
2.09k
      offset = (offset & 0x1000) ? offset - (1 << 13) : offset;
11529
11530
2.09k
      info->print_address_func (pc + 4 + offset, info);
11531
11532
2.09k
      unsigned int T    = (given & 0x00020000u) >> 17;
11533
2.09k
      unsigned int endoffset = (((given & 0x07800000) >> 23) << 1);
11534
2.09k
      unsigned int boffset   = (T == 1) ? 4 : 2;
11535
2.09k
      func (stream, dis_style_text, ", ");
11536
2.09k
      func (stream, dis_style_immediate, "%x",
11537
2.09k
      endoffset + boffset);
11538
2.09k
    }
11539
2.09k
    break;
11540
11541
763
        case 'Q':
11542
763
    {
11543
763
      unsigned int immh = (given & 0x000007feu) >> 1;
11544
763
      unsigned int imml = (given & 0x00000800u) >> 11;
11545
763
      bfd_vma imm32 = 0;
11546
11547
763
      imm32 |= immh << 2;
11548
763
      imm32 |= imml << 1;
11549
11550
763
      info->print_address_func (pc + 4 + imm32, info);
11551
763
    }
11552
763
    break;
11553
11554
206
        case 'P':
11555
206
    {
11556
206
      unsigned int immh = (given & 0x000007feu) >> 1;
11557
206
      unsigned int imml = (given & 0x00000800u) >> 11;
11558
206
      bfd_vma imm32 = 0;
11559
11560
206
      imm32 |= immh << 2;
11561
206
      imm32 |= imml << 1;
11562
11563
206
      info->print_address_func (pc + 4 - imm32, info);
11564
206
    }
11565
206
    break;
11566
11567
8.52k
        case 'b':
11568
8.52k
    {
11569
8.52k
      unsigned int S = (given & 0x04000000u) >> 26;
11570
8.52k
      unsigned int J1 = (given & 0x00002000u) >> 13;
11571
8.52k
      unsigned int J2 = (given & 0x00000800u) >> 11;
11572
8.52k
      bfd_vma offset = 0;
11573
11574
8.52k
      offset |= !S << 20;
11575
8.52k
      offset |= J2 << 19;
11576
8.52k
      offset |= J1 << 18;
11577
8.52k
      offset |= (given & 0x003f0000) >> 4;
11578
8.52k
      offset |= (given & 0x000007ff) << 1;
11579
8.52k
      offset -= (1 << 20);
11580
11581
8.52k
      bfd_vma target = pc + 4 + offset;
11582
8.52k
      info->print_address_func (target, info);
11583
11584
      /* Fill in instruction information.  */
11585
8.52k
      info->insn_info_valid = 1;
11586
8.52k
      info->insn_type = dis_branch;
11587
8.52k
      info->target = target;
11588
8.52k
    }
11589
8.52k
    break;
11590
11591
30.2k
        case 'B':
11592
30.2k
    {
11593
30.2k
      unsigned int S = (given & 0x04000000u) >> 26;
11594
30.2k
      unsigned int I1 = (given & 0x00002000u) >> 13;
11595
30.2k
      unsigned int I2 = (given & 0x00000800u) >> 11;
11596
30.2k
      bfd_vma offset = 0;
11597
11598
30.2k
      offset |= !S << 24;
11599
30.2k
      offset |= !(I1 ^ S) << 23;
11600
30.2k
      offset |= !(I2 ^ S) << 22;
11601
30.2k
      offset |= (given & 0x03ff0000u) >> 4;
11602
30.2k
      offset |= (given & 0x000007ffu) << 1;
11603
30.2k
      offset -= (1 << 24);
11604
30.2k
      offset += pc + 4;
11605
11606
      /* BLX target addresses are always word aligned.  */
11607
30.2k
      if ((given & 0x00001000u) == 0)
11608
4.72k
          offset &= ~2u;
11609
11610
30.2k
      info->print_address_func (offset, info);
11611
11612
      /* Fill in instruction information.  */
11613
30.2k
      info->insn_info_valid = 1;
11614
30.2k
      info->insn_type = dis_branch;
11615
30.2k
      info->target = offset;
11616
30.2k
    }
11617
30.2k
    break;
11618
11619
2.34k
        case 's':
11620
2.34k
    {
11621
2.34k
      unsigned int shift = 0;
11622
11623
2.34k
      shift |= (given & 0x000000c0u) >> 6;
11624
2.34k
      shift |= (given & 0x00007000u) >> 10;
11625
2.34k
      if (WRITEBACK_BIT_SET)
11626
415
        {
11627
415
          func (stream, dis_style_text, ", ");
11628
415
          func (stream, dis_style_sub_mnemonic, "asr ");
11629
415
          func (stream, dis_style_immediate, "#%u", shift);
11630
415
        }
11631
1.92k
      else if (shift)
11632
1.16k
        {
11633
1.16k
          func (stream, dis_style_text, ", ");
11634
1.16k
          func (stream, dis_style_sub_mnemonic, "lsl ");
11635
1.16k
          func (stream, dis_style_immediate, "#%u", shift);
11636
1.16k
        }
11637
      /* else print nothing - lsl #0 */
11638
2.34k
    }
11639
2.34k
    break;
11640
11641
694
        case 'R':
11642
694
    {
11643
694
      unsigned int rot = (given & 0x00000030) >> 4;
11644
11645
694
      if (rot)
11646
382
        {
11647
382
          func (stream, dis_style_text, ", ");
11648
382
          func (stream, dis_style_sub_mnemonic, "ror ");
11649
382
          func (stream, dis_style_immediate, "#%u", rot * 8);
11650
382
        }
11651
694
    }
11652
694
    break;
11653
11654
1.52k
        case 'U':
11655
1.52k
    if ((given & 0xf0) == 0x60)
11656
818
      {
11657
818
        switch (given & 0xf)
11658
818
          {
11659
429
          case 0xf:
11660
429
      func (stream, dis_style_sub_mnemonic, "sy");
11661
429
      break;
11662
389
          default:
11663
389
      func (stream, dis_style_immediate, "#%d",
11664
389
            (int) given & 0xf);
11665
389
      break;
11666
818
          }
11667
818
      }
11668
706
    else
11669
706
      {
11670
706
        const char * opt = data_barrier_option (given & 0xf);
11671
706
        if (opt != NULL)
11672
284
          func (stream, dis_style_sub_mnemonic, "%s", opt);
11673
422
        else
11674
422
          func (stream, dis_style_immediate, "#%d",
11675
422
          (int) given & 0xf);
11676
706
       }
11677
1.52k
    break;
11678
11679
17.1k
        case 'C':
11680
17.1k
    if ((given & 0xff) == 0)
11681
935
      {
11682
935
        func (stream, dis_style_register, "%cPSR_",
11683
935
        (given & 0x100000) ? 'S' : 'C');
11684
11685
935
        if (given & 0x800)
11686
265
          func (stream, dis_style_register, "f");
11687
935
        if (given & 0x400)
11688
381
          func (stream, dis_style_register, "s");
11689
935
        if (given & 0x200)
11690
430
          func (stream, dis_style_register, "x");
11691
935
        if (given & 0x100)
11692
607
          func (stream, dis_style_register, "c");
11693
935
      }
11694
16.2k
    else if (is_v81m_architecture (info))
11695
4.51k
      func (stream, dis_style_register, "%s",
11696
4.51k
      psr_name (given & 0xff));
11697
11698
11.7k
    else if ((given & 0x20) == 0x20)
11699
10.4k
      {
11700
10.4k
        char const* name;
11701
10.4k
        unsigned sysm = (given & 0xf00) >> 8;
11702
11703
10.4k
        sysm |= (given & 0x30);
11704
10.4k
        sysm |= (given & 0x00100000) >> 14;
11705
10.4k
        name = banked_regname (sysm);
11706
11707
10.4k
        if (name != NULL)
11708
8.33k
          func (stream, dis_style_register, "%s", name);
11709
2.06k
        else
11710
2.06k
          func (stream, dis_style_text,
11711
2.06k
          "(UNDEF: %lu)", (unsigned long) sysm);
11712
10.4k
      }
11713
1.32k
    else
11714
1.32k
      {
11715
1.32k
        func (stream, dis_style_register, "%s",
11716
1.32k
        psr_name (given & 0xff));
11717
1.32k
      }
11718
17.1k
    break;
11719
11720
20.9k
        case 'D':
11721
20.9k
    if (is_v81m_architecture (info))
11722
7.49k
      func (stream, dis_style_register, "%s",
11723
7.49k
      psr_name (given & 0xff));
11724
13.4k
    else if (((given & 0xff) == 0)
11725
12.2k
       || ((given & 0x20) == 0x20))
11726
8.61k
      {
11727
8.61k
        char const* name;
11728
8.61k
        unsigned sm = (given & 0xf0000) >> 16;
11729
11730
8.61k
        sm |= (given & 0x30);
11731
8.61k
        sm |= (given & 0x00100000) >> 14;
11732
8.61k
        name = banked_regname (sm);
11733
11734
8.61k
        if (name != NULL)
11735
7.58k
          func (stream, dis_style_register, "%s", name);
11736
1.03k
        else
11737
1.03k
          func (stream, dis_style_text,
11738
1.03k
          "(UNDEF: %lu)", (unsigned long) sm);
11739
8.61k
      }
11740
4.83k
    else
11741
4.83k
      func (stream, dis_style_register, "%s",
11742
4.83k
      psr_name (given & 0xff));
11743
20.9k
    break;
11744
11745
485k
        case '0': case '1': case '2': case '3': case '4':
11746
541k
        case '5': case '6': case '7': case '8': case '9':
11747
541k
    {
11748
541k
      int width;
11749
541k
      unsigned long val;
11750
11751
541k
      c = arm_decode_bitfield (c, given, &val, &width);
11752
11753
541k
      switch (*c)
11754
541k
        {
11755
757
        case 's':
11756
757
          if (val <= 3)
11757
757
      func (stream, dis_style_mnemonic, "%s",
11758
757
            mve_vec_sizename[val]);
11759
0
          else
11760
0
      func (stream, dis_style_text, "<undef size>");
11761
757
          break;
11762
11763
560
        case 'd':
11764
560
          func (stream, base_style, "%lu", val);
11765
560
          value_in_comment = val;
11766
560
          break;
11767
11768
1.89k
        case 'D':
11769
1.89k
          func (stream, dis_style_immediate, "%lu", val + 1);
11770
1.89k
          value_in_comment = val + 1;
11771
1.89k
          break;
11772
11773
7.75k
        case 'W':
11774
7.75k
          func (stream, dis_style_immediate, "%lu", val * 4);
11775
7.75k
          value_in_comment = val * 4;
11776
7.75k
          break;
11777
11778
836
        case 'S':
11779
836
          if (val == 13)
11780
357
      is_unpredictable = true;
11781
          /* Fall through.  */
11782
5.97k
        case 'R':
11783
5.97k
          if (val == 15)
11784
1.10k
      is_unpredictable = true;
11785
          /* Fall through.  */
11786
140k
        case 'r':
11787
140k
          func (stream, dis_style_register, "%s",
11788
140k
          arm_regnames[val]);
11789
140k
          break;
11790
11791
10.6k
        case 'c':
11792
10.6k
          func (stream, base_style, "%s", arm_conditional[val]);
11793
10.6k
          break;
11794
11795
24.6k
        case '\'':
11796
24.6k
          c++;
11797
24.6k
          if (val == ((1ul << width) - 1))
11798
11.1k
      func (stream, base_style, "%c", *c);
11799
24.6k
          break;
11800
11801
7.46k
        case '`':
11802
7.46k
          c++;
11803
7.46k
          if (val == 0)
11804
1.16k
      func (stream, dis_style_immediate, "%c", *c);
11805
7.46k
          break;
11806
11807
1.24k
        case '?':
11808
1.24k
          func (stream, dis_style_mnemonic, "%c",
11809
1.24k
          c[(1 << width) - (int) val]);
11810
1.24k
          c += 1 << width;
11811
1.24k
          break;
11812
11813
345k
        case 'x':
11814
345k
          func (stream, dis_style_immediate, "0x%lx",
11815
345k
          val & 0xffffffffUL);
11816
345k
          break;
11817
11818
0
        default:
11819
0
          abort ();
11820
541k
        }
11821
541k
    }
11822
541k
    break;
11823
11824
541k
        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
7.46k
    if (((given >> 16) & 0xf) == 0xf)
11829
2.18k
      {
11830
2.18k
        bfd_vma offset = (given & 0xff) * 4;
11831
11832
2.18k
        if ((given & (1 << 23)) == 0)
11833
560
          offset = - offset;
11834
2.18k
        func (stream, dis_style_comment_start, "\t@ ");
11835
2.18k
        info->print_address_func ((pc & ~3) + 4 + offset, info);
11836
2.18k
      }
11837
7.46k
    break;
11838
11839
0
        default:
11840
0
    abort ();
11841
915k
        }
11842
915k
    }
11843
11844
494k
  if (value_in_comment > 32 || value_in_comment < -16)
11845
28.3k
    func (stream, dis_style_comment_start, "\t@ 0x%lx",
11846
28.3k
    value_in_comment);
11847
11848
494k
  if (is_unpredictable)
11849
1.16k
    func (stream, dis_style_comment_start, UNPREDICTABLE_INSTRUCTION);
11850
11851
494k
  return;
11852
494k
      }
11853
11854
  /* No match.  */
11855
0
  func (stream, dis_style_comment_start, UNKNOWN_INSTRUCTION_32BIT,
11856
0
  (unsigned) given);
11857
0
  return;
11858
494k
}
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
9.29k
{
11901
9.29k
  const char * name;
11902
11903
9.29k
  if (sym == NULL)
11904
0
    return false;
11905
11906
9.29k
  name = bfd_asymbol_name (sym);
11907
11908
9.29k
  return (name && *name != '$' && strncmp (name, "__tagsym$$", 10));
11909
9.29k
}
11910
11911
/* Parse a disassembler option.  */
11912
11913
static bool
11914
arm_parse_option (const char *opt, void *data ATTRIBUTE_UNUSED)
11915
21.0k
{
11916
21.0k
  if (startswith (opt, "reg-names-"))
11917
464
    {
11918
464
      unsigned int i;
11919
4.36k
      for (i = 0; i < NUM_ARM_OPTIONS; i++)
11920
3.93k
  if (strcmp (opt, regnames[i].name) == 0)
11921
38
    {
11922
38
      regname_selected = i;
11923
38
      break;
11924
38
    }
11925
11926
464
      if (i >= NUM_ARM_OPTIONS)
11927
  /* xgettext: c-format */
11928
426
  opcodes_error_handler (_("unrecognised register name set: %s"),
11929
426
             opt);
11930
464
    }
11931
20.5k
  else if (startswith (opt, "force-thumb"))
11932
2.96k
    force_thumb = 1;
11933
17.5k
  else if (startswith (opt, "no-force-thumb"))
11934
54
    force_thumb = 0;
11935
17.5k
  else if (startswith (opt, "coproc"))
11936
636
    {
11937
636
      const char *procptr = opt + sizeof ("coproc") - 1;
11938
636
      char *endptr;
11939
636
      uint8_t coproc_number = strtol (procptr, &endptr, 10);
11940
636
      if (endptr != procptr + 1 || coproc_number > 7)
11941
168
  opcodes_error_handler (_("cde coprocessor not between 0-7: %s"),
11942
168
             opt);
11943
468
      else if (*endptr != '=')
11944
86
  opcodes_error_handler (_("coproc must have an argument: %s"),
11945
86
             opt);
11946
382
      else
11947
382
  {
11948
382
    endptr += 1;
11949
382
    if (startswith (endptr, "generic"))
11950
38
      cde_coprocs &= ~(1 << coproc_number);
11951
344
    else if (startswith (endptr, "cde")
11952
306
       || startswith (endptr, "CDE"))
11953
120
      cde_coprocs |= (1 << coproc_number);
11954
224
    else
11955
224
      opcodes_error_handler
11956
224
        (_("coprocN argument takes options \"generic\","
11957
224
     " \"cde\", or \"CDE\": %s"), opt);
11958
382
  }
11959
636
    }
11960
16.8k
  else
11961
    /* xgettext: c-format */
11962
16.8k
    opcodes_error_handler (_("unrecognised disassembler option: %s"), opt);
11963
21.0k
  return true;
11964
21.0k
}
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
17.0k
    {
12000
17.0k
      if (addr == 0 || info->symbol_at_address_func (addr, info))
12001
57
  {
12002
    /* A symbol must be on an instruction boundary, and will not
12003
       be within an IT block.  */
12004
57
    if (seen_it && (count & 1))
12005
0
      break;
12006
12007
57
    return;
12008
57
  }
12009
17.0k
      addr -= 2;
12010
17.0k
      status = info->read_memory_func (addr, (bfd_byte *) b, 2, info);
12011
17.0k
      if (status)
12012
13.9k
  return;
12013
12014
3.06k
      if (little)
12015
3.06k
  insn = (b[0]) | (b[1] << 8);
12016
0
      else
12017
0
  insn = (b[1]) | (b[0] << 8);
12018
3.06k
      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
3.06k
      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
3.06k
      if ((insn & 0xf800) >= 0xe800)
12043
0
  count++;
12044
3.06k
      else
12045
3.06k
  count = (count + 2) | 1;
12046
      /* IT blocks contain at most 4 instructions.  */
12047
3.06k
      if (count >= 8 && !seen_it)
12048
765
  return;
12049
3.06k
    }
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
92.3k
{
12064
92.3k
  const char *name = bfd_asymbol_name (info->symtab[n]);
12065
12066
92.3k
  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
92.3k
  return false;
12077
92.3k
}
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
93.5k
{
12087
  /* If the symbol is in a different section, ignore it.  */
12088
93.5k
  if (info->section != NULL && info->section != info->symtab[n]->section)
12089
1.13k
    return false;
12090
12091
92.3k
  return is_mapping_symbol (info, n, map_type);
12092
93.5k
}
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
46.1k
{
12102
46.1k
  elf_symbol_type *es;
12103
46.1k
  unsigned int type;
12104
46.1k
  asymbol * sym;
12105
12106
  /* If the symbol is in a different section, ignore it.  */
12107
46.1k
  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
46.1k
  sym = info->symtab[n];
12112
46.1k
  if (bfd_asymbol_flavour (sym) != bfd_target_elf_flavour)
12113
0
    return false;
12114
12115
46.1k
  es = (elf_symbol_type *) sym;
12116
46.1k
  type = ELF_ST_TYPE (es->internal_elf_sym.st_info);
12117
12118
  /* If the symbol has function type then use that.  */
12119
46.1k
  if (type == STT_FUNC || type == STT_GNU_IFUNC)
12120
46.1k
    {
12121
46.1k
      if (ARM_GET_SYM_BRANCH_TYPE (es->internal_elf_sym.st_target_internal)
12122
46.1k
    == ST_BRANCH_TO_THUMB)
12123
46.1k
  *map_type = MAP_THUMB;
12124
24
      else
12125
24
  *map_type = MAP_ARM;
12126
46.1k
      return true;
12127
46.1k
    }
12128
12129
0
  return false;
12130
46.1k
}
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
47.4k
{
12146
47.4k
  bfd_vma addr, section_vma = 0;
12147
47.4k
  int n, last_sym = -1;
12148
47.4k
  bool found = false;
12149
47.4k
  bool can_use_search_opt_p = false;
12150
12151
  /* Sanity check.  */
12152
47.4k
  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
47.4k
  enum map_type type = MAP_DATA;
12164
47.4k
  if ((info->section && info->section->flags & SEC_CODE) || !info->section)
12165
46.3k
    type = MAP_ARM;
12166
47.4k
  struct arm_private_data *private_data;
12167
12168
47.4k
  if (info->private_data == NULL || info->symtab == NULL
12169
47.4k
      || info->symtab_size == 0
12170
47.4k
      || bfd_asymbol_flavour (*info->symtab) != bfd_target_elf_flavour)
12171
0
    return false;
12172
12173
47.4k
  private_data = info->private_data;
12174
12175
  /* First, look for mapping symbols.  */
12176
47.4k
  if (pc <= private_data->last_mapping_addr)
12177
120
    private_data->last_mapping_sym = -1;
12178
12179
  /* Start scanning at the start of the function, or wherever
12180
     we finished last time.  */
12181
47.4k
  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
47.4k
  can_use_search_opt_p
12187
47.4k
    = (private_data->last_mapping_sym >= 0
12188
46.1k
       && info->stop_offset == private_data->last_stop_offset);
12189
12190
47.4k
  if (n >= private_data->last_mapping_sym && can_use_search_opt_p)
12191
46.1k
    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
94.8k
  for (; n < info->symtab_size; n++)
12198
47.6k
    {
12199
47.6k
      addr = bfd_asymbol_value (info->symtab[n]);
12200
47.6k
      if (addr > pc)
12201
345
  break;
12202
47.3k
      if (get_map_sym_type (info, n, &type))
12203
0
  {
12204
0
    last_sym = n;
12205
0
    found = true;
12206
0
  }
12207
47.3k
    }
12208
12209
47.4k
  if (!found)
12210
47.4k
    {
12211
47.4k
      n = info->symtab_pos;
12212
47.4k
      if (n >= private_data->last_mapping_sym && can_use_search_opt_p)
12213
46.1k
  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
47.4k
      if (info->section)
12222
47.4k
  section_vma = info->section->vma;
12223
12224
93.6k
      for (; n >= 0; n--)
12225
46.1k
  {
12226
46.1k
    addr = bfd_asymbol_value (info->symtab[n]);
12227
46.1k
    if (addr < section_vma)
12228
0
      break;
12229
12230
46.1k
    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
46.1k
  }
12237
47.4k
    }
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
47.4k
  if (!found)
12244
47.4k
    {
12245
47.4k
      n = info->symtab_pos;
12246
47.4k
      if (n >= 0 && get_sym_code_type (info, n, &type))
12247
46.1k
  {
12248
46.1k
    last_sym = n;
12249
46.1k
    found = true;
12250
46.1k
  }
12251
47.4k
    }
12252
12253
47.4k
  private_data->last_mapping_sym = last_sym;
12254
47.4k
  private_data->last_type = type;
12255
47.4k
  private_data->last_stop_offset = info->stop_offset;
12256
12257
47.4k
  *map_symbol = type;
12258
47.4k
  return found;
12259
47.4k
}
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
349
    case bfd_mach_arm_2:  ARM_SET_FEATURES (ARM_ARCH_V2); break;
12287
104
    case bfd_mach_arm_2a:  ARM_SET_FEATURES (ARM_ARCH_V2S); break;
12288
186
    case bfd_mach_arm_3:  ARM_SET_FEATURES (ARM_ARCH_V3); break;
12289
703
    case bfd_mach_arm_3M:  ARM_SET_FEATURES (ARM_ARCH_V3M); break;
12290
154
    case bfd_mach_arm_4:  ARM_SET_FEATURES (ARM_ARCH_V4); break;
12291
0
    case bfd_mach_arm_ep9312:
12292
32
    case bfd_mach_arm_4T:  ARM_SET_FEATURES (ARM_ARCH_V4T); break;
12293
232
    case bfd_mach_arm_5:  ARM_SET_FEATURES (ARM_ARCH_V5); break;
12294
181
    case bfd_mach_arm_5T:  ARM_SET_FEATURES (ARM_ARCH_V5T); break;
12295
128
    case bfd_mach_arm_5TE:  ARM_SET_FEATURES (ARM_ARCH_V5TE); break;
12296
301
    case bfd_mach_arm_XScale:  ARM_SET_FEATURES (ARM_ARCH_XSCALE); break;
12297
415
    case bfd_mach_arm_iWMMXt:  ARM_SET_FEATURES (ARM_ARCH_IWMMXT); break;
12298
502
    case bfd_mach_arm_iWMMXt2:  ARM_SET_FEATURES (ARM_ARCH_IWMMXT2); break;
12299
42
    case bfd_mach_arm_5TEJ:  ARM_SET_FEATURES (ARM_ARCH_V5TEJ); break;
12300
68
    case bfd_mach_arm_6:  ARM_SET_FEATURES (ARM_ARCH_V6); break;
12301
114
    case bfd_mach_arm_6KZ:  ARM_SET_FEATURES (ARM_ARCH_V6KZ); break;
12302
68
    case bfd_mach_arm_6T2:  ARM_SET_FEATURES (ARM_ARCH_V6KZT2); break;
12303
58
    case bfd_mach_arm_6K:  ARM_SET_FEATURES (ARM_ARCH_V6K); break;
12304
88
    case bfd_mach_arm_7:  ARM_SET_FEATURES (ARM_ARCH_V7VE); break;
12305
104
    case bfd_mach_arm_6M:  ARM_SET_FEATURES (ARM_ARCH_V6M); break;
12306
83
    case bfd_mach_arm_6SM:  ARM_SET_FEATURES (ARM_ARCH_V6SM); break;
12307
151
    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
48
    case bfd_mach_arm_8R:  ARM_SET_FEATURES (ARM_ARCH_V8R_CRC); break;
12318
75
    case bfd_mach_arm_8M_BASE:  ARM_SET_FEATURES (ARM_ARCH_V8M_BASE); break;
12319
45
    case bfd_mach_arm_8M_MAIN:  ARM_SET_FEATURES (ARM_ARCH_V8M_MAIN); break;
12320
10.2k
    case bfd_mach_arm_8_1M_MAIN:
12321
10.2k
      ARM_SET_FEATURES (ARM_ARCH_V8_1M_MAIN);
12322
10.2k
      arm_feature_set mve_all
12323
10.2k
  = ARM_FEATURE_CORE_HIGH (ARM_EXT2_MVE | ARM_EXT2_MVE_FP);
12324
10.2k
      ARM_MERGE_FEATURE_SETS (arch_fset, arch_fset, mve_all);
12325
10.2k
      force_thumb = 1;
12326
10.2k
      break;
12327
63
    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.63k
    case bfd_mach_arm_unknown:
12331
3.63k
      ARM_SET_FEATURES (ARM_ARCH_UNKNOWN);
12332
3.63k
      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.13M
{
12351
7.13M
  unsigned char b[4];
12352
7.13M
  unsigned long given;
12353
7.13M
  int status;
12354
7.13M
  int is_thumb = false;
12355
7.13M
  int is_data = false;
12356
7.13M
  int little_code;
12357
7.13M
  unsigned int  size = 4;
12358
7.13M
  void (*printer) (bfd_vma, struct disassemble_info *, long);
12359
7.13M
  bool found = false;
12360
7.13M
  struct arm_private_data *private_data;
12361
12362
  /* Clear instruction information field.  */
12363
7.13M
  info->insn_info_valid = 0;
12364
7.13M
  info->branch_delay_insns = 0;
12365
7.13M
  info->data_size = 0;
12366
7.13M
  info->insn_type = dis_noninsn;
12367
7.13M
  info->target = 0;
12368
7.13M
  info->target2 = 0;
12369
12370
7.13M
  if (info->disassembler_options)
12371
14.3k
    {
12372
14.3k
      force_thumb = false;
12373
14.3k
      for_each_disassembler_option (info, arm_parse_option, NULL);
12374
12375
      /* To avoid repeated parsing of these options, we remove them here.  */
12376
14.3k
      info->disassembler_options = NULL;
12377
14.3k
    }
12378
12379
  /* PR 10288: Control which instructions will be disassembled.  */
12380
7.13M
  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.4k
    && (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
158
    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.13M
  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.13M
  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.13M
  if (info->symtab_size != 0
12432
50.0k
      && bfd_asymbol_flavour (*info->symtab) == bfd_target_elf_flavour)
12433
47.4k
    {
12434
47.4k
      bfd_vma addr;
12435
47.4k
      int n;
12436
47.4k
      int last_sym = -1;
12437
47.4k
      enum map_type type = MAP_ARM;
12438
12439
47.4k
      found = mapping_symbol_for_insn (pc, info, &type);
12440
47.4k
      last_sym = private_data->last_mapping_sym;
12441
12442
47.4k
      is_thumb = (private_data->last_type == MAP_THUMB);
12443
47.4k
      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
47.4k
      if (is_data)
12450
1.10k
  {
12451
1.10k
    size = 4 - (pc & 3);
12452
2.40k
    for (n = last_sym + 1; n < info->symtab_size; n++)
12453
1.29k
      {
12454
1.29k
        addr = bfd_asymbol_value (info->symtab[n]);
12455
1.29k
        if (addr > pc
12456
214
      && (info->section == NULL
12457
214
          || 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.29k
      }
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
1.10k
    if (size == 3)
12468
0
      size = (pc & 1) ? 1 : 2;
12469
1.10k
  }
12470
47.4k
    }
12471
12472
7.13M
  if (info->symbols != NULL)
12473
46.1k
    {
12474
46.1k
      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
46.1k
      else if (bfd_asymbol_flavour (*info->symbols) == bfd_target_elf_flavour
12486
46.1k
         && !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
46.1k
      else if (bfd_asymbol_flavour (*info->symbols)
12501
46.1k
         == 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
46.1k
    }
12508
12509
7.13M
  if (force_thumb)
12510
3.63M
    is_thumb = true;
12511
12512
7.13M
  if (is_data)
12513
1.10k
    info->display_endian = little ? BFD_ENDIAN_LITTLE : BFD_ENDIAN_BIG;
12514
7.12M
  else
12515
7.12M
    info->display_endian = little_code ? BFD_ENDIAN_LITTLE : BFD_ENDIAN_BIG;
12516
12517
7.13M
  info->bytes_per_line = 4;
12518
12519
  /* PR 10263: Disassemble data if requested to do so by the user.  */
12520
7.13M
  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.13M
  else if (!is_thumb)
12538
3.45M
    {
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.45M
      printer = print_insn_arm;
12542
3.45M
      info->bytes_per_chunk = 4;
12543
3.45M
      size = 4;
12544
12545
3.45M
      status = info->read_memory_func (pc, (bfd_byte *) b, 4, info);
12546
3.45M
      if (little_code)
12547
2.35M
  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.45M
    }
12551
3.67M
  else
12552
3.67M
    {
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.67M
      printer = print_insn_thumb16;
12558
3.67M
      info->bytes_per_chunk = 2;
12559
3.67M
      size = 2;
12560
12561
3.67M
      status = info->read_memory_func (pc, (bfd_byte *) b, 2, info);
12562
3.67M
      if (little_code)
12563
3.42M
  given = (b[0]) | (b[1] << 8);
12564
251k
      else
12565
251k
  given = (b[1]) | (b[0] << 8);
12566
12567
3.67M
      if (!status)
12568
3.67M
  {
12569
    /* These bit patterns signal a four-byte Thumb
12570
       instruction.  */
12571
3.67M
    if ((given & 0xF800) == 0xF800
12572
3.19M
        || (given & 0xF800) == 0xF000
12573
3.06M
        || (given & 0xF800) == 0xE800)
12574
821k
      {
12575
821k
        status = info->read_memory_func (pc + 2, (bfd_byte *) b, 2, info);
12576
821k
        if (little_code)
12577
712k
    given = (b[0]) | (b[1] << 8) | (given << 16);
12578
109k
        else
12579
109k
    given = (b[1]) | (b[0] << 8) | (given << 16);
12580
12581
821k
        printer = print_insn_thumb32;
12582
821k
        size = 4;
12583
821k
      }
12584
3.67M
  }
12585
12586
3.67M
      if (ifthen_address != pc)
12587
14.7k
  find_ifthen_state (pc, info, little_code);
12588
12589
3.67M
      if (ifthen_state)
12590
109k
  {
12591
109k
    if ((ifthen_state & 0xf) == 0x8)
12592
23.4k
      ifthen_next_state = 0;
12593
85.6k
    else
12594
85.6k
      ifthen_next_state = (ifthen_state & 0xe0)
12595
85.6k
        | ((ifthen_state & 0xf) << 1);
12596
109k
  }
12597
3.67M
    }
12598
12599
7.13M
  if (status)
12600
6.92k
    {
12601
6.92k
      info->memory_error_func (status, pc, info);
12602
6.92k
      return -1;
12603
6.92k
    }
12604
7.12M
  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
12
    pc = 0;
12611
12612
7.12M
  printer (pc, info, given);
12613
12614
7.12M
  if (is_thumb)
12615
3.67M
    {
12616
3.67M
      ifthen_state = ifthen_next_state;
12617
3.67M
      ifthen_address += size;
12618
3.67M
    }
12619
7.12M
  return size;
12620
7.13M
}
12621
12622
int
12623
print_insn_big_arm (bfd_vma pc, struct disassemble_info *info)
12624
1.44M
{
12625
  /* Detect BE8-ness and record it in the disassembler info.  */
12626
1.44M
  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
90.2k
    info->endian_code = BFD_ENDIAN_LITTLE;
12630
12631
1.44M
  return print_insn (pc, info, false);
12632
1.44M
}
12633
12634
int
12635
print_insn_little_arm (bfd_vma pc, struct disassemble_info *info)
12636
5.68M
{
12637
5.68M
  return print_insn (pc, info, true);
12638
5.68M
}
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
}