Coverage Report

Created: 2026-10-02 09:53

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