[PATCH 43/57][Arm][OBJDUMP] Add support for MVE instructions: scatter stores and...
[external/binutils.git] / opcodes / arm-dis.c
1 /* Instruction printing code for the ARM
2    Copyright (C) 1994-2019 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 /* FIXME: Belongs in global header.  */
43 #ifndef strneq
44 #define strneq(a,b,n)   (strncmp ((a), (b), (n)) == 0)
45 #endif
46
47 /* Cached mapping symbol state.  */
48 enum map_type
49 {
50   MAP_ARM,
51   MAP_THUMB,
52   MAP_DATA
53 };
54
55 struct arm_private_data
56 {
57   /* The features to use when disassembling optional instructions.  */
58   arm_feature_set features;
59
60   /* Track the last type (although this doesn't seem to be useful) */
61   enum map_type last_type;
62
63   /* Tracking symbol table information */
64   int last_mapping_sym;
65
66   /* The end range of the current range being disassembled.  */
67   bfd_vma last_stop_offset;
68   bfd_vma last_mapping_addr;
69 };
70
71 enum mve_instructions
72 {
73   MVE_VPST,
74   MVE_VPT_FP_T1,
75   MVE_VPT_FP_T2,
76   MVE_VPT_VEC_T1,
77   MVE_VPT_VEC_T2,
78   MVE_VPT_VEC_T3,
79   MVE_VPT_VEC_T4,
80   MVE_VPT_VEC_T5,
81   MVE_VPT_VEC_T6,
82   MVE_VCMP_FP_T1,
83   MVE_VCMP_FP_T2,
84   MVE_VCMP_VEC_T1,
85   MVE_VCMP_VEC_T2,
86   MVE_VCMP_VEC_T3,
87   MVE_VCMP_VEC_T4,
88   MVE_VCMP_VEC_T5,
89   MVE_VCMP_VEC_T6,
90   MVE_VDUP,
91   MVE_VEOR,
92   MVE_VFMAS_FP_SCALAR,
93   MVE_VFMA_FP_SCALAR,
94   MVE_VFMA_FP,
95   MVE_VFMS_FP,
96   MVE_VHADD_T1,
97   MVE_VHADD_T2,
98   MVE_VHSUB_T1,
99   MVE_VHSUB_T2,
100   MVE_VRHADD,
101   MVE_VLD2,
102   MVE_VLD4,
103   MVE_VST2,
104   MVE_VST4,
105   MVE_VLDRB_T1,
106   MVE_VLDRH_T2,
107   MVE_VLDRB_T5,
108   MVE_VLDRH_T6,
109   MVE_VLDRW_T7,
110   MVE_VSTRB_T1,
111   MVE_VSTRH_T2,
112   MVE_VSTRB_T5,
113   MVE_VSTRH_T6,
114   MVE_VSTRW_T7,
115   MVE_VLDRB_GATHER_T1,
116   MVE_VLDRH_GATHER_T2,
117   MVE_VLDRW_GATHER_T3,
118   MVE_VLDRD_GATHER_T4,
119   MVE_VLDRW_GATHER_T5,
120   MVE_VLDRD_GATHER_T6,
121   MVE_VSTRB_SCATTER_T1,
122   MVE_VSTRH_SCATTER_T2,
123   MVE_VSTRW_SCATTER_T3,
124   MVE_VSTRD_SCATTER_T4,
125   MVE_VSTRW_SCATTER_T5,
126   MVE_VSTRD_SCATTER_T6,
127   MVE_NONE
128 };
129
130 enum mve_unpredictable
131 {
132   UNPRED_IT_BLOCK,              /* Unpredictable because mve insn in it block.
133                                  */
134   UNPRED_FCA_0_FCB_1,           /* Unpredictable because fcA = 0 and
135                                    fcB = 1 (vpt).  */
136   UNPRED_R13,                   /* Unpredictable because r13 (sp) or
137                                    r15 (sp) used.  */
138   UNPRED_R15,                   /* Unpredictable because r15 (pc) is used.  */
139   UNPRED_Q_GT_4,                /* Unpredictable because
140                                    vec reg start > 4 (vld4/st4).  */
141   UNPRED_Q_GT_6,                /* Unpredictable because
142                                    vec reg start > 6 (vld2/st2).  */
143   UNPRED_R13_AND_WB,            /* Unpredictable becase gp reg = r13
144                                    and WB bit = 1.  */
145   UNPRED_Q_REGS_EQUAL,          /* Unpredictable because vector registers are
146                                    equal.  */
147   UNPRED_OS,                    /* Unpredictable because offset scaled == 1.  */
148   UNPRED_NONE                   /* No unpredictable behavior.  */
149 };
150
151 enum mve_undefined
152 {
153   UNDEF_SIZE_3,                 /* undefined because size == 3.  */
154   UNDEF_SIZE_3,                 /* undefined because size == 3.  */
155   UNDEF_SIZE_LE_1,              /* undefined because size <= 1.  */
156   UNDEF_SIZE_NOT_2,             /* undefined because size != 2.  */
157   UNDEF_SIZE_NOT_3,             /* undefined because size != 3.  */
158   UNDEF_NOT_UNS_SIZE_0,         /* undefined because U == 0 and
159                                    size == 0.  */
160   UNDEF_NOT_UNS_SIZE_1,         /* undefined because U == 0 and
161                                    size == 1.  */
162   UNDEF_NOT_UNSIGNED,           /* undefined because U == 0.  */
163   UNDEF_NONE                    /* no undefined behavior.  */
164 };
165
166 struct opcode32
167 {
168   arm_feature_set arch;         /* Architecture defining this insn.  */
169   unsigned long value;          /* If arch is 0 then value is a sentinel.  */
170   unsigned long mask;           /* Recognise insn if (op & mask) == value.  */
171   const char *  assembler;      /* How to disassemble this insn.  */
172 };
173
174 /* MVE opcodes.  */
175
176 struct mopcode32
177 {
178   arm_feature_set arch;         /* Architecture defining this insn.  */
179   enum mve_instructions mve_op;  /* Specific mve instruction for faster
180                                     decoding.  */
181   unsigned long value;          /* If arch is 0 then value is a sentinel.  */
182   unsigned long mask;           /* Recognise insn if (op & mask) == value.  */
183   const char *  assembler;      /* How to disassemble this insn.  */
184 };
185
186 enum isa {
187   ANY,
188   T32,
189   ARM
190 };
191
192
193 /* Shared (between Arm and Thumb mode) opcode.  */
194 struct sopcode32
195 {
196   enum isa isa;                 /* Execution mode instruction availability.  */
197   arm_feature_set arch;         /* Architecture defining this insn.  */
198   unsigned long value;          /* If arch is 0 then value is a sentinel.  */
199   unsigned long mask;           /* Recognise insn if (op & mask) == value.  */
200   const char *  assembler;      /* How to disassemble this insn.  */
201 };
202
203 struct opcode16
204 {
205   arm_feature_set arch;         /* Architecture defining this insn.  */
206   unsigned short value, mask;   /* Recognise insn if (op & mask) == value.  */
207   const char *assembler;        /* How to disassemble this insn.  */
208 };
209
210 /* print_insn_coprocessor recognizes the following format control codes:
211
212    %%                   %
213
214    %c                   print condition code (always bits 28-31 in ARM mode)
215    %q                   print shifter argument
216    %u                   print condition code (unconditional in ARM mode,
217                           UNPREDICTABLE if not AL in Thumb)
218    %A                   print address for ldc/stc/ldf/stf instruction
219    %B                   print vstm/vldm register list
220    %C                   print vscclrm register list
221    %I                   print cirrus signed shift immediate: bits 0..3|4..6
222    %J                   print register for VLDR instruction
223    %K                   print address for VLDR instruction
224    %F                   print the COUNT field of a LFM/SFM instruction.
225    %P                   print floating point precision in arithmetic insn
226    %Q                   print floating point precision in ldf/stf insn
227    %R                   print floating point rounding mode
228
229    %<bitfield>c         print as a condition code (for vsel)
230    %<bitfield>r         print as an ARM register
231    %<bitfield>R         as %<>r but r15 is UNPREDICTABLE
232    %<bitfield>ru        as %<>r but each u register must be unique.
233    %<bitfield>d         print the bitfield in decimal
234    %<bitfield>k         print immediate for VFPv3 conversion instruction
235    %<bitfield>x         print the bitfield in hex
236    %<bitfield>X         print the bitfield as 1 hex digit without leading "0x"
237    %<bitfield>f         print a floating point constant if >7 else a
238                         floating point register
239    %<bitfield>w         print as an iWMMXt width field - [bhwd]ss/us
240    %<bitfield>g         print as an iWMMXt 64-bit register
241    %<bitfield>G         print as an iWMMXt general purpose or control register
242    %<bitfield>D         print as a NEON D register
243    %<bitfield>Q         print as a NEON Q register
244    %<bitfield>V         print as a NEON D or Q register
245    %<bitfield>E         print a quarter-float immediate value
246
247    %y<code>             print a single precision VFP reg.
248                           Codes: 0=>Sm, 1=>Sd, 2=>Sn, 3=>multi-list, 4=>Sm pair
249    %z<code>             print a double precision VFP reg
250                           Codes: 0=>Dm, 1=>Dd, 2=>Dn, 3=>multi-list
251
252    %<bitfield>'c        print specified char iff bitfield is all ones
253    %<bitfield>`c        print specified char iff bitfield is all zeroes
254    %<bitfield>?ab...    select from array of values in big endian order
255
256    %L                   print as an iWMMXt N/M width field.
257    %Z                   print the Immediate of a WSHUFH instruction.
258    %l                   like 'A' except use byte offsets for 'B' & 'H'
259                         versions.
260    %i                   print 5-bit immediate in bits 8,3..0
261                         (print "32" when 0)
262    %r                   print register offset address for wldt/wstr instruction.  */
263
264 enum opcode_sentinel_enum
265 {
266   SENTINEL_IWMMXT_START = 1,
267   SENTINEL_IWMMXT_END,
268   SENTINEL_GENERIC_START
269 } opcode_sentinels;
270
271 #define UNDEFINED_INSTRUCTION      "\t\t; <UNDEFINED> instruction: %0-31x"
272 #define UNKNOWN_INSTRUCTION_32BIT  "\t\t; <UNDEFINED> instruction: %08x"
273 #define UNKNOWN_INSTRUCTION_16BIT  "\t\t; <UNDEFINED> instruction: %04x"
274 #define UNPREDICTABLE_INSTRUCTION  "\t; <UNPREDICTABLE>"
275
276 /* Common coprocessor opcodes shared between Arm and Thumb-2.  */
277
278 static const struct sopcode32 coprocessor_opcodes[] =
279 {
280   /* XScale instructions.  */
281   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
282     0x0e200010, 0x0fff0ff0,
283     "mia%c\tacc0, %0-3r, %12-15r"},
284   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
285     0x0e280010, 0x0fff0ff0,
286     "miaph%c\tacc0, %0-3r, %12-15r"},
287   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
288     0x0e2c0010, 0x0ffc0ff0, "mia%17'T%17`B%16'T%16`B%c\tacc0, %0-3r, %12-15r"},
289   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
290     0x0c400000, 0x0ff00fff, "mar%c\tacc0, %12-15r, %16-19r"},
291   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
292     0x0c500000, 0x0ff00fff, "mra%c\t%12-15r, %16-19r, acc0"},
293
294   /* Intel Wireless MMX technology instructions.  */
295   {ANY, ARM_FEATURE_CORE_LOW (0), SENTINEL_IWMMXT_START, 0, "" },
296   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_IWMMXT),
297     0x0e130130, 0x0f3f0fff, "tandc%22-23w%c\t%12-15r"},
298   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
299     0x0e400010, 0x0ff00f3f, "tbcst%6-7w%c\t%16-19g, %12-15r"},
300   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
301     0x0e130170, 0x0f3f0ff8, "textrc%22-23w%c\t%12-15r, #%0-2d"},
302   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
303     0x0e100070, 0x0f300ff0, "textrm%3?su%22-23w%c\t%12-15r, %16-19g, #%0-2d"},
304   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
305     0x0e600010, 0x0ff00f38, "tinsr%6-7w%c\t%16-19g, %12-15r, #%0-2d"},
306   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
307     0x0e000110, 0x0ff00fff, "tmcr%c\t%16-19G, %12-15r"},
308   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
309     0x0c400000, 0x0ff00ff0, "tmcrr%c\t%0-3g, %12-15r, %16-19r"},
310   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
311     0x0e2c0010, 0x0ffc0e10, "tmia%17?tb%16?tb%c\t%5-8g, %0-3r, %12-15r"},
312   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
313     0x0e200010, 0x0fff0e10, "tmia%c\t%5-8g, %0-3r, %12-15r"},
314   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
315     0x0e280010, 0x0fff0e10, "tmiaph%c\t%5-8g, %0-3r, %12-15r"},
316   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
317     0x0e100030, 0x0f300fff, "tmovmsk%22-23w%c\t%12-15r, %16-19g"},
318   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
319     0x0e100110, 0x0ff00ff0, "tmrc%c\t%12-15r, %16-19G"},
320   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
321     0x0c500000, 0x0ff00ff0, "tmrrc%c\t%12-15r, %16-19r, %0-3g"},
322   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
323     0x0e130150, 0x0f3f0fff, "torc%22-23w%c\t%12-15r"},
324   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
325     0x0e120190, 0x0f3f0fff, "torvsc%22-23w%c\t%12-15r"},
326   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
327     0x0e2001c0, 0x0f300fff, "wabs%22-23w%c\t%12-15g, %16-19g"},
328   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
329     0x0e0001c0, 0x0f300fff, "wacc%22-23w%c\t%12-15g, %16-19g"},
330   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
331     0x0e000180, 0x0f000ff0, "wadd%20-23w%c\t%12-15g, %16-19g, %0-3g"},
332   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
333     0x0e2001a0, 0x0fb00ff0, "waddbhus%22?ml%c\t%12-15g, %16-19g, %0-3g"},
334   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
335     0x0ea001a0, 0x0ff00ff0, "waddsubhx%c\t%12-15g, %16-19g, %0-3g"},
336   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
337     0x0e000020, 0x0f800ff0, "waligni%c\t%12-15g, %16-19g, %0-3g, #%20-22d"},
338   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
339     0x0e800020, 0x0fc00ff0, "walignr%20-21d%c\t%12-15g, %16-19g, %0-3g"},
340   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
341     0x0e200000, 0x0fe00ff0, "wand%20'n%c\t%12-15g, %16-19g, %0-3g"},
342   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
343     0x0e800000, 0x0fa00ff0, "wavg2%22?hb%20'r%c\t%12-15g, %16-19g, %0-3g"},
344   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
345     0x0e400000, 0x0fe00ff0, "wavg4%20'r%c\t%12-15g, %16-19g, %0-3g"},
346   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
347     0x0e000060, 0x0f300ff0, "wcmpeq%22-23w%c\t%12-15g, %16-19g, %0-3g"},
348   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
349     0x0e100060, 0x0f100ff0, "wcmpgt%21?su%22-23w%c\t%12-15g, %16-19g, %0-3g"},
350   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
351     0xfc500100, 0xfe500f00, "wldrd\t%12-15g, %r"},
352   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
353     0xfc100100, 0xfe500f00, "wldrw\t%12-15G, %A"},
354   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
355     0x0c100000, 0x0e100e00, "wldr%L%c\t%12-15g, %l"},
356   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
357     0x0e400100, 0x0fc00ff0, "wmac%21?su%20'z%c\t%12-15g, %16-19g, %0-3g"},
358   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
359     0x0e800100, 0x0fc00ff0, "wmadd%21?su%20'x%c\t%12-15g, %16-19g, %0-3g"},
360   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
361     0x0ec00100, 0x0fd00ff0, "wmadd%21?sun%c\t%12-15g, %16-19g, %0-3g"},
362   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
363     0x0e000160, 0x0f100ff0, "wmax%21?su%22-23w%c\t%12-15g, %16-19g, %0-3g"},
364   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
365     0x0e000080, 0x0f100fe0, "wmerge%c\t%12-15g, %16-19g, %0-3g, #%21-23d"},
366   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
367     0x0e0000a0, 0x0f800ff0, "wmia%21?tb%20?tb%22'n%c\t%12-15g, %16-19g, %0-3g"},
368   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
369     0x0e800120, 0x0f800ff0,
370     "wmiaw%21?tb%20?tb%22'n%c\t%12-15g, %16-19g, %0-3g"},
371   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
372     0x0e100160, 0x0f100ff0, "wmin%21?su%22-23w%c\t%12-15g, %16-19g, %0-3g"},
373   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
374     0x0e000100, 0x0fc00ff0, "wmul%21?su%20?ml%23'r%c\t%12-15g, %16-19g, %0-3g"},
375   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
376     0x0ed00100, 0x0fd00ff0, "wmul%21?sumr%c\t%12-15g, %16-19g, %0-3g"},
377   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
378     0x0ee000c0, 0x0fe00ff0, "wmulwsm%20`r%c\t%12-15g, %16-19g, %0-3g"},
379   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
380     0x0ec000c0, 0x0fe00ff0, "wmulwum%20`r%c\t%12-15g, %16-19g, %0-3g"},
381   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
382     0x0eb000c0, 0x0ff00ff0, "wmulwl%c\t%12-15g, %16-19g, %0-3g"},
383   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
384     0x0e8000a0, 0x0f800ff0,
385     "wqmia%21?tb%20?tb%22'n%c\t%12-15g, %16-19g, %0-3g"},
386   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
387     0x0e100080, 0x0fd00ff0, "wqmulm%21'r%c\t%12-15g, %16-19g, %0-3g"},
388   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
389     0x0ec000e0, 0x0fd00ff0, "wqmulwm%21'r%c\t%12-15g, %16-19g, %0-3g"},
390   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
391     0x0e000000, 0x0ff00ff0, "wor%c\t%12-15g, %16-19g, %0-3g"},
392   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
393     0x0e000080, 0x0f000ff0, "wpack%20-23w%c\t%12-15g, %16-19g, %0-3g"},
394   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
395     0xfe300040, 0xff300ef0, "wror%22-23w\t%12-15g, %16-19g, #%i"},
396   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
397     0x0e300040, 0x0f300ff0, "wror%22-23w%c\t%12-15g, %16-19g, %0-3g"},
398   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
399     0x0e300140, 0x0f300ff0, "wror%22-23wg%c\t%12-15g, %16-19g, %0-3G"},
400   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
401     0x0e000120, 0x0fa00ff0, "wsad%22?hb%20'z%c\t%12-15g, %16-19g, %0-3g"},
402   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
403     0x0e0001e0, 0x0f000ff0, "wshufh%c\t%12-15g, %16-19g, #%Z"},
404   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
405     0xfe100040, 0xff300ef0, "wsll%22-23w\t%12-15g, %16-19g, #%i"},
406   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
407     0x0e100040, 0x0f300ff0, "wsll%22-23w%8'g%c\t%12-15g, %16-19g, %0-3g"},
408   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
409     0x0e100148, 0x0f300ffc, "wsll%22-23w%8'g%c\t%12-15g, %16-19g, %0-3G"},
410   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
411     0xfe000040, 0xff300ef0, "wsra%22-23w\t%12-15g, %16-19g, #%i"},
412   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
413     0x0e000040, 0x0f300ff0, "wsra%22-23w%8'g%c\t%12-15g, %16-19g, %0-3g"},
414   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
415     0x0e000148, 0x0f300ffc, "wsra%22-23w%8'g%c\t%12-15g, %16-19g, %0-3G"},
416   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
417     0xfe200040, 0xff300ef0, "wsrl%22-23w\t%12-15g, %16-19g, #%i"},
418   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
419     0x0e200040, 0x0f300ff0, "wsrl%22-23w%8'g%c\t%12-15g, %16-19g, %0-3g"},
420   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
421     0x0e200148, 0x0f300ffc, "wsrl%22-23w%8'g%c\t%12-15g, %16-19g, %0-3G"},
422   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
423     0xfc400100, 0xfe500f00, "wstrd\t%12-15g, %r"},
424   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
425     0xfc000100, 0xfe500f00, "wstrw\t%12-15G, %A"},
426   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
427     0x0c000000, 0x0e100e00, "wstr%L%c\t%12-15g, %l"},
428   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
429     0x0e0001a0, 0x0f000ff0, "wsub%20-23w%c\t%12-15g, %16-19g, %0-3g"},
430   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
431     0x0ed001c0, 0x0ff00ff0, "wsubaddhx%c\t%12-15g, %16-19g, %0-3g"},
432   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
433     0x0e1001c0, 0x0f300ff0, "wabsdiff%22-23w%c\t%12-15g, %16-19g, %0-3g"},
434   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
435     0x0e0000c0, 0x0fd00fff, "wunpckeh%21?sub%c\t%12-15g, %16-19g"},
436   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
437     0x0e4000c0, 0x0fd00fff, "wunpckeh%21?suh%c\t%12-15g, %16-19g"},
438   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
439     0x0e8000c0, 0x0fd00fff, "wunpckeh%21?suw%c\t%12-15g, %16-19g"},
440   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
441     0x0e0000e0, 0x0f100fff, "wunpckel%21?su%22-23w%c\t%12-15g, %16-19g"},
442   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
443     0x0e1000c0, 0x0f300ff0, "wunpckih%22-23w%c\t%12-15g, %16-19g, %0-3g"},
444   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
445     0x0e1000e0, 0x0f300ff0, "wunpckil%22-23w%c\t%12-15g, %16-19g, %0-3g"},
446   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_XSCALE),
447     0x0e100000, 0x0ff00ff0, "wxor%c\t%12-15g, %16-19g, %0-3g"},
448   {ANY, ARM_FEATURE_CORE_LOW (0),
449     SENTINEL_IWMMXT_END, 0, "" },
450
451   /* Floating point coprocessor (FPA) instructions.  */
452   {ANY, ARM_FEATURE_COPROC (FPU_FPA_EXT_V1),
453     0x0e000100, 0x0ff08f10, "adf%c%P%R\t%12-14f, %16-18f, %0-3f"},
454   {ANY, ARM_FEATURE_COPROC (FPU_FPA_EXT_V1),
455     0x0e100100, 0x0ff08f10, "muf%c%P%R\t%12-14f, %16-18f, %0-3f"},
456   {ANY, ARM_FEATURE_COPROC (FPU_FPA_EXT_V1),
457     0x0e200100, 0x0ff08f10, "suf%c%P%R\t%12-14f, %16-18f, %0-3f"},
458   {ANY, ARM_FEATURE_COPROC (FPU_FPA_EXT_V1),
459     0x0e300100, 0x0ff08f10, "rsf%c%P%R\t%12-14f, %16-18f, %0-3f"},
460   {ANY, ARM_FEATURE_COPROC (FPU_FPA_EXT_V1),
461     0x0e400100, 0x0ff08f10, "dvf%c%P%R\t%12-14f, %16-18f, %0-3f"},
462   {ANY, ARM_FEATURE_COPROC (FPU_FPA_EXT_V1),
463     0x0e500100, 0x0ff08f10, "rdf%c%P%R\t%12-14f, %16-18f, %0-3f"},
464   {ANY, ARM_FEATURE_COPROC (FPU_FPA_EXT_V1),
465     0x0e600100, 0x0ff08f10, "pow%c%P%R\t%12-14f, %16-18f, %0-3f"},
466   {ANY, ARM_FEATURE_COPROC (FPU_FPA_EXT_V1),
467     0x0e700100, 0x0ff08f10, "rpw%c%P%R\t%12-14f, %16-18f, %0-3f"},
468   {ANY, ARM_FEATURE_COPROC (FPU_FPA_EXT_V1),
469     0x0e800100, 0x0ff08f10, "rmf%c%P%R\t%12-14f, %16-18f, %0-3f"},
470   {ANY, ARM_FEATURE_COPROC (FPU_FPA_EXT_V1),
471     0x0e900100, 0x0ff08f10, "fml%c%P%R\t%12-14f, %16-18f, %0-3f"},
472   {ANY, ARM_FEATURE_COPROC (FPU_FPA_EXT_V1),
473     0x0ea00100, 0x0ff08f10, "fdv%c%P%R\t%12-14f, %16-18f, %0-3f"},
474   {ANY, ARM_FEATURE_COPROC (FPU_FPA_EXT_V1),
475     0x0eb00100, 0x0ff08f10, "frd%c%P%R\t%12-14f, %16-18f, %0-3f"},
476   {ANY, ARM_FEATURE_COPROC (FPU_FPA_EXT_V1),
477     0x0ec00100, 0x0ff08f10, "pol%c%P%R\t%12-14f, %16-18f, %0-3f"},
478   {ANY, ARM_FEATURE_COPROC (FPU_FPA_EXT_V1),
479     0x0e008100, 0x0ff08f10, "mvf%c%P%R\t%12-14f, %0-3f"},
480   {ANY, ARM_FEATURE_COPROC (FPU_FPA_EXT_V1),
481     0x0e108100, 0x0ff08f10, "mnf%c%P%R\t%12-14f, %0-3f"},
482   {ANY, ARM_FEATURE_COPROC (FPU_FPA_EXT_V1),
483     0x0e208100, 0x0ff08f10, "abs%c%P%R\t%12-14f, %0-3f"},
484   {ANY, ARM_FEATURE_COPROC (FPU_FPA_EXT_V1),
485     0x0e308100, 0x0ff08f10, "rnd%c%P%R\t%12-14f, %0-3f"},
486   {ANY, ARM_FEATURE_COPROC (FPU_FPA_EXT_V1),
487     0x0e408100, 0x0ff08f10, "sqt%c%P%R\t%12-14f, %0-3f"},
488   {ANY, ARM_FEATURE_COPROC (FPU_FPA_EXT_V1),
489     0x0e508100, 0x0ff08f10, "log%c%P%R\t%12-14f, %0-3f"},
490   {ANY, ARM_FEATURE_COPROC (FPU_FPA_EXT_V1),
491     0x0e608100, 0x0ff08f10, "lgn%c%P%R\t%12-14f, %0-3f"},
492   {ANY, ARM_FEATURE_COPROC (FPU_FPA_EXT_V1),
493     0x0e708100, 0x0ff08f10, "exp%c%P%R\t%12-14f, %0-3f"},
494   {ANY, ARM_FEATURE_COPROC (FPU_FPA_EXT_V1),
495     0x0e808100, 0x0ff08f10, "sin%c%P%R\t%12-14f, %0-3f"},
496   {ANY, ARM_FEATURE_COPROC (FPU_FPA_EXT_V1),
497     0x0e908100, 0x0ff08f10, "cos%c%P%R\t%12-14f, %0-3f"},
498   {ANY, ARM_FEATURE_COPROC (FPU_FPA_EXT_V1),
499     0x0ea08100, 0x0ff08f10, "tan%c%P%R\t%12-14f, %0-3f"},
500   {ANY, ARM_FEATURE_COPROC (FPU_FPA_EXT_V1),
501     0x0eb08100, 0x0ff08f10, "asn%c%P%R\t%12-14f, %0-3f"},
502   {ANY, ARM_FEATURE_COPROC (FPU_FPA_EXT_V1),
503     0x0ec08100, 0x0ff08f10, "acs%c%P%R\t%12-14f, %0-3f"},
504   {ANY, ARM_FEATURE_COPROC (FPU_FPA_EXT_V1),
505     0x0ed08100, 0x0ff08f10, "atn%c%P%R\t%12-14f, %0-3f"},
506   {ANY, ARM_FEATURE_COPROC (FPU_FPA_EXT_V1),
507     0x0ee08100, 0x0ff08f10, "urd%c%P%R\t%12-14f, %0-3f"},
508   {ANY, ARM_FEATURE_COPROC (FPU_FPA_EXT_V1),
509     0x0ef08100, 0x0ff08f10, "nrm%c%P%R\t%12-14f, %0-3f"},
510   {ANY, ARM_FEATURE_COPROC (FPU_FPA_EXT_V1),
511     0x0e000110, 0x0ff00f1f, "flt%c%P%R\t%16-18f, %12-15r"},
512   {ANY, ARM_FEATURE_COPROC (FPU_FPA_EXT_V1),
513     0x0e100110, 0x0fff0f98, "fix%c%R\t%12-15r, %0-2f"},
514   {ANY, ARM_FEATURE_COPROC (FPU_FPA_EXT_V1),
515     0x0e200110, 0x0fff0fff, "wfs%c\t%12-15r"},
516   {ANY, ARM_FEATURE_COPROC (FPU_FPA_EXT_V1),
517     0x0e300110, 0x0fff0fff, "rfs%c\t%12-15r"},
518   {ANY, ARM_FEATURE_COPROC (FPU_FPA_EXT_V1),
519     0x0e400110, 0x0fff0fff, "wfc%c\t%12-15r"},
520   {ANY, ARM_FEATURE_COPROC (FPU_FPA_EXT_V1),
521     0x0e500110, 0x0fff0fff, "rfc%c\t%12-15r"},
522   {ANY, ARM_FEATURE_COPROC (FPU_FPA_EXT_V1),
523     0x0e90f110, 0x0ff8fff0, "cmf%c\t%16-18f, %0-3f"},
524   {ANY, ARM_FEATURE_COPROC (FPU_FPA_EXT_V1),
525     0x0eb0f110, 0x0ff8fff0, "cnf%c\t%16-18f, %0-3f"},
526   {ANY, ARM_FEATURE_COPROC (FPU_FPA_EXT_V1),
527     0x0ed0f110, 0x0ff8fff0, "cmfe%c\t%16-18f, %0-3f"},
528   {ANY, ARM_FEATURE_COPROC (FPU_FPA_EXT_V1),
529     0x0ef0f110, 0x0ff8fff0, "cnfe%c\t%16-18f, %0-3f"},
530   {ANY, ARM_FEATURE_COPROC (FPU_FPA_EXT_V1),
531     0x0c000100, 0x0e100f00, "stf%c%Q\t%12-14f, %A"},
532   {ANY, ARM_FEATURE_COPROC (FPU_FPA_EXT_V1),
533     0x0c100100, 0x0e100f00, "ldf%c%Q\t%12-14f, %A"},
534   {ANY, ARM_FEATURE_COPROC (FPU_FPA_EXT_V2),
535     0x0c000200, 0x0e100f00, "sfm%c\t%12-14f, %F, %A"},
536   {ANY, ARM_FEATURE_COPROC (FPU_FPA_EXT_V2),
537     0x0c100200, 0x0e100f00, "lfm%c\t%12-14f, %F, %A"},
538
539   /* Armv8.1-M Mainline instructions.  */
540   {T32, ARM_FEATURE_CORE_HIGH (ARM_EXT2_V8_1M_MAIN),
541     0xec9f0b00, 0xffbf0f01, "vscclrm%c\t%C"},
542   {T32, ARM_FEATURE_CORE_HIGH (ARM_EXT2_V8_1M_MAIN),
543     0xec9f0a00, 0xffbf0f00, "vscclrm%c\t%C"},
544
545   /* ARMv8-M Mainline Security Extensions instructions.  */
546   {ANY, ARM_FEATURE_CORE_HIGH (ARM_EXT2_V8M_MAIN),
547     0xec300a00, 0xfff0ffff, "vlldm\t%16-19r"},
548   {ANY, ARM_FEATURE_CORE_HIGH (ARM_EXT2_V8M_MAIN),
549     0xec200a00, 0xfff0ffff, "vlstm\t%16-19r"},
550
551   /* Register load/store.  */
552   {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1xD | FPU_NEON_EXT_V1),
553     0x0d2d0b00, 0x0fbf0f01, "vpush%c\t%B"},
554   {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1xD | FPU_NEON_EXT_V1),
555     0x0d200b00, 0x0fb00f01, "vstmdb%c\t%16-19r!, %B"},
556   {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1xD | FPU_NEON_EXT_V1),
557     0x0d300b00, 0x0fb00f01, "vldmdb%c\t%16-19r!, %B"},
558   {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1xD | FPU_NEON_EXT_V1),
559     0x0c800b00, 0x0f900f01, "vstmia%c\t%16-19r%21'!, %B"},
560   {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1xD | FPU_NEON_EXT_V1),
561     0x0cbd0b00, 0x0fbf0f01, "vpop%c\t%B"},
562   {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1xD | FPU_NEON_EXT_V1),
563     0x0c900b00, 0x0f900f01, "vldmia%c\t%16-19r%21'!, %B"},
564   {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1xD | FPU_NEON_EXT_V1),
565     0x0d000b00, 0x0f300f00, "vstr%c\t%12-15,22D, %A"},
566   {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1xD | FPU_NEON_EXT_V1),
567     0x0d100b00, 0x0f300f00, "vldr%c\t%12-15,22D, %A"},
568   {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1xD),
569     0x0d2d0a00, 0x0fbf0f00, "vpush%c\t%y3"},
570   {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1xD),
571     0x0d200a00, 0x0fb00f00, "vstmdb%c\t%16-19r!, %y3"},
572   {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1xD),
573     0x0d300a00, 0x0fb00f00, "vldmdb%c\t%16-19r!, %y3"},
574   {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1xD),
575     0x0c800a00, 0x0f900f00, "vstmia%c\t%16-19r%21'!, %y3"},
576   {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1xD),
577     0x0cbd0a00, 0x0fbf0f00, "vpop%c\t%y3"},
578   {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1xD),
579     0x0c900a00, 0x0f900f00, "vldmia%c\t%16-19r%21'!, %y3"},
580   {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1xD),
581     0x0d000a00, 0x0f300f00, "vstr%c\t%y1, %A"},
582   {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1xD),
583     0x0d100a00, 0x0f300f00, "vldr%c\t%y1, %A"},
584   {ANY, ARM_FEATURE_COPROC (ARM_EXT2_V8_1M_MAIN),
585     0xec100f80, 0xfe101f80, "vldr%c\t%J, %K"},
586   {ANY, ARM_FEATURE_COPROC (ARM_EXT2_V8_1M_MAIN),
587     0xec000f80, 0xfe101f80, "vstr%c\t%J, %K"},
588
589   {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1xD),
590     0x0d200b01, 0x0fb00f01, "fstmdbx%c\t%16-19r!, %z3\t;@ Deprecated"},
591   {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1xD),
592     0x0d300b01, 0x0fb00f01, "fldmdbx%c\t%16-19r!, %z3\t;@ Deprecated"},
593   {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1xD),
594     0x0c800b01, 0x0f900f01, "fstmiax%c\t%16-19r%21'!, %z3\t;@ Deprecated"},
595   {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1xD),
596     0x0c900b01, 0x0f900f01, "fldmiax%c\t%16-19r%21'!, %z3\t;@ Deprecated"},
597
598   /* Data transfer between ARM and NEON registers.  */
599   {ANY, ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
600     0x0c400b10, 0x0ff00fd0, "vmov%c\t%0-3,5D, %12-15r, %16-19r"},
601   {ANY, ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
602     0x0c500b10, 0x0ff00fd0, "vmov%c\t%12-15r, %16-19r, %0-3,5D"},
603   {ANY, ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
604     0x0e000b10, 0x0fd00f70, "vmov%c.32\t%16-19,7D[%21d], %12-15r"},
605   {ANY, ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
606     0x0e100b10, 0x0f500f70, "vmov%c.32\t%12-15r, %16-19,7D[%21d]"},
607   {ANY, ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
608     0x0e000b30, 0x0fd00f30, "vmov%c.16\t%16-19,7D[%6,21d], %12-15r"},
609   {ANY, ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
610     0x0e100b30, 0x0f500f30, "vmov%c.%23?us16\t%12-15r, %16-19,7D[%6,21d]"},
611   {ANY, ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
612     0x0e400b10, 0x0fd00f10, "vmov%c.8\t%16-19,7D[%5,6,21d], %12-15r"},
613   {ANY, ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
614     0x0e500b10, 0x0f500f10, "vmov%c.%23?us8\t%12-15r, %16-19,7D[%5,6,21d]"},
615   /* Half-precision conversion instructions.  */
616   {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_ARMV8),
617     0x0eb20b40, 0x0fbf0f50, "vcvt%7?tb%c.f64.f16\t%z1, %y0"},
618   {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_ARMV8),
619     0x0eb30b40, 0x0fbf0f50, "vcvt%7?tb%c.f16.f64\t%y1, %z0"},
620   {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_FP16),
621     0x0eb20a40, 0x0fbf0f50, "vcvt%7?tb%c.f32.f16\t%y1, %y0"},
622   {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_FP16),
623     0x0eb30a40, 0x0fbf0f50, "vcvt%7?tb%c.f16.f32\t%y1, %y0"},
624
625   /* Floating point coprocessor (VFP) instructions.  */
626   {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1xD),
627     0x0ee00a10, 0x0fff0fff, "vmsr%c\tfpsid, %12-15r"},
628   {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1xD),
629     0x0ee10a10, 0x0fff0fff, "vmsr%c\tfpscr, %12-15r"},
630   {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1xD),
631     0x0ee60a10, 0x0fff0fff, "vmsr%c\tmvfr1, %12-15r"},
632   {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1xD),
633     0x0ee70a10, 0x0fff0fff, "vmsr%c\tmvfr0, %12-15r"},
634   {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_ARMV8),
635     0x0ee50a10, 0x0fff0fff, "vmsr%c\tmvfr2, %12-15r"},
636   {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1xD),
637     0x0ee80a10, 0x0fff0fff, "vmsr%c\tfpexc, %12-15r"},
638   {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1xD),
639     0x0ee90a10, 0x0fff0fff, "vmsr%c\tfpinst, %12-15r\t@ Impl def"},
640   {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1xD),
641     0x0eea0a10, 0x0fff0fff, "vmsr%c\tfpinst2, %12-15r\t@ Impl def"},
642   {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1xD),
643     0x0ef00a10, 0x0fff0fff, "vmrs%c\t%12-15r, fpsid"},
644   {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1xD),
645     0x0ef1fa10, 0x0fffffff, "vmrs%c\tAPSR_nzcv, fpscr"},
646   {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1xD),
647     0x0ef10a10, 0x0fff0fff, "vmrs%c\t%12-15r, fpscr"},
648   {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_ARMV8),
649     0x0ef50a10, 0x0fff0fff, "vmrs%c\t%12-15r, mvfr2"},
650   {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1xD),
651     0x0ef60a10, 0x0fff0fff, "vmrs%c\t%12-15r, mvfr1"},
652   {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1xD),
653     0x0ef70a10, 0x0fff0fff, "vmrs%c\t%12-15r, mvfr0"},
654   {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1xD),
655     0x0ef80a10, 0x0fff0fff, "vmrs%c\t%12-15r, fpexc"},
656   {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1xD),
657     0x0ef90a10, 0x0fff0fff, "vmrs%c\t%12-15r, fpinst\t@ Impl def"},
658   {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1xD),
659     0x0efa0a10, 0x0fff0fff, "vmrs%c\t%12-15r, fpinst2\t@ Impl def"},
660   {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1),
661     0x0e000b10, 0x0fd00fff, "vmov%c.32\t%z2[%21d], %12-15r"},
662   {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1),
663     0x0e100b10, 0x0fd00fff, "vmov%c.32\t%12-15r, %z2[%21d]"},
664   {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1xD),
665     0x0ee00a10, 0x0ff00fff, "vmsr%c\t<impl def %16-19x>, %12-15r"},
666   {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1xD),
667     0x0ef00a10, 0x0ff00fff, "vmrs%c\t%12-15r, <impl def %16-19x>"},
668   {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1xD),
669     0x0e000a10, 0x0ff00f7f, "vmov%c\t%y2, %12-15r"},
670   {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1xD),
671     0x0e100a10, 0x0ff00f7f, "vmov%c\t%12-15r, %y2"},
672   {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1xD),
673     0x0eb50a40, 0x0fbf0f70, "vcmp%7'e%c.f32\t%y1, #0.0"},
674   {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1),
675     0x0eb50b40, 0x0fbf0f70, "vcmp%7'e%c.f64\t%z1, #0.0"},
676   {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1xD),
677     0x0eb00a40, 0x0fbf0fd0, "vmov%c.f32\t%y1, %y0"},
678   {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1xD),
679     0x0eb00ac0, 0x0fbf0fd0, "vabs%c.f32\t%y1, %y0"},
680   {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1),
681     0x0eb00b40, 0x0fbf0fd0, "vmov%c.f64\t%z1, %z0"},
682   {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1),
683     0x0eb00bc0, 0x0fbf0fd0, "vabs%c.f64\t%z1, %z0"},
684   {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1xD),
685     0x0eb10a40, 0x0fbf0fd0, "vneg%c.f32\t%y1, %y0"},
686   {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1xD),
687     0x0eb10ac0, 0x0fbf0fd0, "vsqrt%c.f32\t%y1, %y0"},
688   {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1),
689     0x0eb10b40, 0x0fbf0fd0, "vneg%c.f64\t%z1, %z0"},
690   {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1),
691     0x0eb10bc0, 0x0fbf0fd0, "vsqrt%c.f64\t%z1, %z0"},
692   {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1),
693     0x0eb70ac0, 0x0fbf0fd0, "vcvt%c.f64.f32\t%z1, %y0"},
694   {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1),
695     0x0eb70bc0, 0x0fbf0fd0, "vcvt%c.f32.f64\t%y1, %z0"},
696   {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1xD),
697     0x0eb80a40, 0x0fbf0f50, "vcvt%c.f32.%7?su32\t%y1, %y0"},
698   {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1),
699     0x0eb80b40, 0x0fbf0f50, "vcvt%c.f64.%7?su32\t%z1, %y0"},
700   {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1xD),
701     0x0eb40a40, 0x0fbf0f50, "vcmp%7'e%c.f32\t%y1, %y0"},
702   {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1),
703     0x0eb40b40, 0x0fbf0f50, "vcmp%7'e%c.f64\t%z1, %z0"},
704   {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V3xD),
705     0x0eba0a40, 0x0fbe0f50, "vcvt%c.f32.%16?us%7?31%7?26\t%y1, %y1, #%5,0-3k"},
706   {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V3),
707     0x0eba0b40, 0x0fbe0f50, "vcvt%c.f64.%16?us%7?31%7?26\t%z1, %z1, #%5,0-3k"},
708   {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1xD),
709     0x0ebc0a40, 0x0fbe0f50, "vcvt%7`r%c.%16?su32.f32\t%y1, %y0"},
710   {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1),
711     0x0ebc0b40, 0x0fbe0f50, "vcvt%7`r%c.%16?su32.f64\t%y1, %z0"},
712   {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V3xD),
713     0x0ebe0a40, 0x0fbe0f50, "vcvt%c.%16?us%7?31%7?26.f32\t%y1, %y1, #%5,0-3k"},
714   {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V3),
715     0x0ebe0b40, 0x0fbe0f50, "vcvt%c.%16?us%7?31%7?26.f64\t%z1, %z1, #%5,0-3k"},
716   {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1),
717     0x0c500b10, 0x0fb00ff0, "vmov%c\t%12-15r, %16-19r, %z0"},
718   {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V3xD),
719     0x0eb00a00, 0x0fb00ff0, "vmov%c.f32\t%y1, #%0-3,16-19E"},
720   {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V3),
721     0x0eb00b00, 0x0fb00ff0, "vmov%c.f64\t%z1, #%0-3,16-19E"},
722   {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V2),
723     0x0c400a10, 0x0ff00fd0, "vmov%c\t%y4, %12-15r, %16-19r"},
724   {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V2),
725     0x0c400b10, 0x0ff00fd0, "vmov%c\t%z0, %12-15r, %16-19r"},
726   {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V2),
727     0x0c500a10, 0x0ff00fd0, "vmov%c\t%12-15r, %16-19r, %y4"},
728   {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1xD),
729     0x0e000a00, 0x0fb00f50, "vmla%c.f32\t%y1, %y2, %y0"},
730   {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1xD),
731     0x0e000a40, 0x0fb00f50, "vmls%c.f32\t%y1, %y2, %y0"},
732   {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1),
733     0x0e000b00, 0x0fb00f50, "vmla%c.f64\t%z1, %z2, %z0"},
734   {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1),
735     0x0e000b40, 0x0fb00f50, "vmls%c.f64\t%z1, %z2, %z0"},
736   {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1xD),
737     0x0e100a00, 0x0fb00f50, "vnmls%c.f32\t%y1, %y2, %y0"},
738   {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1xD),
739     0x0e100a40, 0x0fb00f50, "vnmla%c.f32\t%y1, %y2, %y0"},
740   {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1),
741     0x0e100b00, 0x0fb00f50, "vnmls%c.f64\t%z1, %z2, %z0"},
742   {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1),
743     0x0e100b40, 0x0fb00f50, "vnmla%c.f64\t%z1, %z2, %z0"},
744   {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1xD),
745     0x0e200a00, 0x0fb00f50, "vmul%c.f32\t%y1, %y2, %y0"},
746   {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1xD),
747     0x0e200a40, 0x0fb00f50, "vnmul%c.f32\t%y1, %y2, %y0"},
748   {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1),
749     0x0e200b00, 0x0fb00f50, "vmul%c.f64\t%z1, %z2, %z0"},
750   {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1),
751     0x0e200b40, 0x0fb00f50, "vnmul%c.f64\t%z1, %z2, %z0"},
752   {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1xD),
753     0x0e300a00, 0x0fb00f50, "vadd%c.f32\t%y1, %y2, %y0"},
754   {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1xD),
755     0x0e300a40, 0x0fb00f50, "vsub%c.f32\t%y1, %y2, %y0"},
756   {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1),
757     0x0e300b00, 0x0fb00f50, "vadd%c.f64\t%z1, %z2, %z0"},
758   {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1),
759     0x0e300b40, 0x0fb00f50, "vsub%c.f64\t%z1, %z2, %z0"},
760   {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1xD),
761     0x0e800a00, 0x0fb00f50, "vdiv%c.f32\t%y1, %y2, %y0"},
762   {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_V1),
763     0x0e800b00, 0x0fb00f50, "vdiv%c.f64\t%z1, %z2, %z0"},
764
765   /* Cirrus coprocessor instructions.  */
766   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_MAVERICK),
767     0x0d100400, 0x0f500f00, "cfldrs%c\tmvf%12-15d, %A"},
768   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_MAVERICK),
769     0x0c100400, 0x0f500f00, "cfldrs%c\tmvf%12-15d, %A"},
770   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_MAVERICK),
771     0x0d500400, 0x0f500f00, "cfldrd%c\tmvd%12-15d, %A"},
772   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_MAVERICK),
773     0x0c500400, 0x0f500f00, "cfldrd%c\tmvd%12-15d, %A"},
774   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_MAVERICK),
775     0x0d100500, 0x0f500f00, "cfldr32%c\tmvfx%12-15d, %A"},
776   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_MAVERICK),
777     0x0c100500, 0x0f500f00, "cfldr32%c\tmvfx%12-15d, %A"},
778   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_MAVERICK),
779     0x0d500500, 0x0f500f00, "cfldr64%c\tmvdx%12-15d, %A"},
780   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_MAVERICK),
781     0x0c500500, 0x0f500f00, "cfldr64%c\tmvdx%12-15d, %A"},
782   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_MAVERICK),
783     0x0d000400, 0x0f500f00, "cfstrs%c\tmvf%12-15d, %A"},
784   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_MAVERICK),
785     0x0c000400, 0x0f500f00, "cfstrs%c\tmvf%12-15d, %A"},
786   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_MAVERICK),
787     0x0d400400, 0x0f500f00, "cfstrd%c\tmvd%12-15d, %A"},
788   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_MAVERICK),
789     0x0c400400, 0x0f500f00, "cfstrd%c\tmvd%12-15d, %A"},
790   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_MAVERICK),
791     0x0d000500, 0x0f500f00, "cfstr32%c\tmvfx%12-15d, %A"},
792   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_MAVERICK),
793     0x0c000500, 0x0f500f00, "cfstr32%c\tmvfx%12-15d, %A"},
794   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_MAVERICK),
795     0x0d400500, 0x0f500f00, "cfstr64%c\tmvdx%12-15d, %A"},
796   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_MAVERICK),
797     0x0c400500, 0x0f500f00, "cfstr64%c\tmvdx%12-15d, %A"},
798   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_MAVERICK),
799     0x0e000450, 0x0ff00ff0, "cfmvsr%c\tmvf%16-19d, %12-15r"},
800   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_MAVERICK),
801     0x0e100450, 0x0ff00ff0, "cfmvrs%c\t%12-15r, mvf%16-19d"},
802   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_MAVERICK),
803     0x0e000410, 0x0ff00ff0, "cfmvdlr%c\tmvd%16-19d, %12-15r"},
804   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_MAVERICK),
805     0x0e100410, 0x0ff00ff0, "cfmvrdl%c\t%12-15r, mvd%16-19d"},
806   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_MAVERICK),
807     0x0e000430, 0x0ff00ff0, "cfmvdhr%c\tmvd%16-19d, %12-15r"},
808   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_MAVERICK),
809     0x0e100430, 0x0ff00fff, "cfmvrdh%c\t%12-15r, mvd%16-19d"},
810   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_MAVERICK),
811     0x0e000510, 0x0ff00fff, "cfmv64lr%c\tmvdx%16-19d, %12-15r"},
812   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_MAVERICK),
813     0x0e100510, 0x0ff00fff, "cfmvr64l%c\t%12-15r, mvdx%16-19d"},
814   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_MAVERICK),
815     0x0e000530, 0x0ff00fff, "cfmv64hr%c\tmvdx%16-19d, %12-15r"},
816   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_MAVERICK),
817     0x0e100530, 0x0ff00fff, "cfmvr64h%c\t%12-15r, mvdx%16-19d"},
818   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_MAVERICK),
819     0x0e200440, 0x0ff00fff, "cfmval32%c\tmvax%12-15d, mvfx%16-19d"},
820   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_MAVERICK),
821     0x0e100440, 0x0ff00fff, "cfmv32al%c\tmvfx%12-15d, mvax%16-19d"},
822   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_MAVERICK),
823     0x0e200460, 0x0ff00fff, "cfmvam32%c\tmvax%12-15d, mvfx%16-19d"},
824   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_MAVERICK),
825     0x0e100460, 0x0ff00fff, "cfmv32am%c\tmvfx%12-15d, mvax%16-19d"},
826   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_MAVERICK),
827     0x0e200480, 0x0ff00fff, "cfmvah32%c\tmvax%12-15d, mvfx%16-19d"},
828   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_MAVERICK),
829     0x0e100480, 0x0ff00fff, "cfmv32ah%c\tmvfx%12-15d, mvax%16-19d"},
830   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_MAVERICK),
831     0x0e2004a0, 0x0ff00fff, "cfmva32%c\tmvax%12-15d, mvfx%16-19d"},
832   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_MAVERICK),
833     0x0e1004a0, 0x0ff00fff, "cfmv32a%c\tmvfx%12-15d, mvax%16-19d"},
834   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_MAVERICK),
835     0x0e2004c0, 0x0ff00fff, "cfmva64%c\tmvax%12-15d, mvdx%16-19d"},
836   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_MAVERICK),
837     0x0e1004c0, 0x0ff00fff, "cfmv64a%c\tmvdx%12-15d, mvax%16-19d"},
838   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_MAVERICK),
839     0x0e2004e0, 0x0fff0fff, "cfmvsc32%c\tdspsc, mvdx%12-15d"},
840   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_MAVERICK),
841     0x0e1004e0, 0x0fff0fff, "cfmv32sc%c\tmvdx%12-15d, dspsc"},
842   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_MAVERICK),
843     0x0e000400, 0x0ff00fff, "cfcpys%c\tmvf%12-15d, mvf%16-19d"},
844   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_MAVERICK),
845     0x0e000420, 0x0ff00fff, "cfcpyd%c\tmvd%12-15d, mvd%16-19d"},
846   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_MAVERICK),
847     0x0e000460, 0x0ff00fff, "cfcvtsd%c\tmvd%12-15d, mvf%16-19d"},
848   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_MAVERICK),
849     0x0e000440, 0x0ff00fff, "cfcvtds%c\tmvf%12-15d, mvd%16-19d"},
850   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_MAVERICK),
851     0x0e000480, 0x0ff00fff, "cfcvt32s%c\tmvf%12-15d, mvfx%16-19d"},
852   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_MAVERICK),
853     0x0e0004a0, 0x0ff00fff, "cfcvt32d%c\tmvd%12-15d, mvfx%16-19d"},
854   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_MAVERICK),
855     0x0e0004c0, 0x0ff00fff, "cfcvt64s%c\tmvf%12-15d, mvdx%16-19d"},
856   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_MAVERICK),
857     0x0e0004e0, 0x0ff00fff, "cfcvt64d%c\tmvd%12-15d, mvdx%16-19d"},
858   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_MAVERICK),
859     0x0e100580, 0x0ff00fff, "cfcvts32%c\tmvfx%12-15d, mvf%16-19d"},
860   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_MAVERICK),
861     0x0e1005a0, 0x0ff00fff, "cfcvtd32%c\tmvfx%12-15d, mvd%16-19d"},
862   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_MAVERICK),
863     0x0e1005c0, 0x0ff00fff, "cftruncs32%c\tmvfx%12-15d, mvf%16-19d"},
864   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_MAVERICK),
865     0x0e1005e0, 0x0ff00fff, "cftruncd32%c\tmvfx%12-15d, mvd%16-19d"},
866   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_MAVERICK),
867     0x0e000550, 0x0ff00ff0, "cfrshl32%c\tmvfx%16-19d, mvfx%0-3d, %12-15r"},
868   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_MAVERICK),
869     0x0e000570, 0x0ff00ff0, "cfrshl64%c\tmvdx%16-19d, mvdx%0-3d, %12-15r"},
870   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_MAVERICK),
871     0x0e000500, 0x0ff00f10, "cfsh32%c\tmvfx%12-15d, mvfx%16-19d, #%I"},
872   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_MAVERICK),
873     0x0e200500, 0x0ff00f10, "cfsh64%c\tmvdx%12-15d, mvdx%16-19d, #%I"},
874   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_MAVERICK),
875     0x0e100490, 0x0ff00ff0, "cfcmps%c\t%12-15r, mvf%16-19d, mvf%0-3d"},
876   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_MAVERICK),
877     0x0e1004b0, 0x0ff00ff0, "cfcmpd%c\t%12-15r, mvd%16-19d, mvd%0-3d"},
878   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_MAVERICK),
879     0x0e100590, 0x0ff00ff0, "cfcmp32%c\t%12-15r, mvfx%16-19d, mvfx%0-3d"},
880   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_MAVERICK),
881     0x0e1005b0, 0x0ff00ff0, "cfcmp64%c\t%12-15r, mvdx%16-19d, mvdx%0-3d"},
882   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_MAVERICK),
883     0x0e300400, 0x0ff00fff, "cfabss%c\tmvf%12-15d, mvf%16-19d"},
884   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_MAVERICK),
885     0x0e300420, 0x0ff00fff, "cfabsd%c\tmvd%12-15d, mvd%16-19d"},
886   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_MAVERICK),
887     0x0e300440, 0x0ff00fff, "cfnegs%c\tmvf%12-15d, mvf%16-19d"},
888   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_MAVERICK),
889     0x0e300460, 0x0ff00fff, "cfnegd%c\tmvd%12-15d, mvd%16-19d"},
890   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_MAVERICK),
891     0x0e300480, 0x0ff00ff0, "cfadds%c\tmvf%12-15d, mvf%16-19d, mvf%0-3d"},
892   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_MAVERICK),
893     0x0e3004a0, 0x0ff00ff0, "cfaddd%c\tmvd%12-15d, mvd%16-19d, mvd%0-3d"},
894   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_MAVERICK),
895     0x0e3004c0, 0x0ff00ff0, "cfsubs%c\tmvf%12-15d, mvf%16-19d, mvf%0-3d"},
896   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_MAVERICK),
897     0x0e3004e0, 0x0ff00ff0, "cfsubd%c\tmvd%12-15d, mvd%16-19d, mvd%0-3d"},
898   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_MAVERICK),
899     0x0e100400, 0x0ff00ff0, "cfmuls%c\tmvf%12-15d, mvf%16-19d, mvf%0-3d"},
900   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_MAVERICK),
901     0x0e100420, 0x0ff00ff0, "cfmuld%c\tmvd%12-15d, mvd%16-19d, mvd%0-3d"},
902   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_MAVERICK),
903     0x0e300500, 0x0ff00fff, "cfabs32%c\tmvfx%12-15d, mvfx%16-19d"},
904   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_MAVERICK),
905     0x0e300520, 0x0ff00fff, "cfabs64%c\tmvdx%12-15d, mvdx%16-19d"},
906   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_MAVERICK),
907     0x0e300540, 0x0ff00fff, "cfneg32%c\tmvfx%12-15d, mvfx%16-19d"},
908   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_MAVERICK),
909     0x0e300560, 0x0ff00fff, "cfneg64%c\tmvdx%12-15d, mvdx%16-19d"},
910   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_MAVERICK),
911     0x0e300580, 0x0ff00ff0, "cfadd32%c\tmvfx%12-15d, mvfx%16-19d, mvfx%0-3d"},
912   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_MAVERICK),
913     0x0e3005a0, 0x0ff00ff0, "cfadd64%c\tmvdx%12-15d, mvdx%16-19d, mvdx%0-3d"},
914   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_MAVERICK),
915     0x0e3005c0, 0x0ff00ff0, "cfsub32%c\tmvfx%12-15d, mvfx%16-19d, mvfx%0-3d"},
916   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_MAVERICK),
917     0x0e3005e0, 0x0ff00ff0, "cfsub64%c\tmvdx%12-15d, mvdx%16-19d, mvdx%0-3d"},
918   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_MAVERICK),
919     0x0e100500, 0x0ff00ff0, "cfmul32%c\tmvfx%12-15d, mvfx%16-19d, mvfx%0-3d"},
920   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_MAVERICK),
921     0x0e100520, 0x0ff00ff0, "cfmul64%c\tmvdx%12-15d, mvdx%16-19d, mvdx%0-3d"},
922   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_MAVERICK),
923     0x0e100540, 0x0ff00ff0, "cfmac32%c\tmvfx%12-15d, mvfx%16-19d, mvfx%0-3d"},
924   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_MAVERICK),
925     0x0e100560, 0x0ff00ff0, "cfmsc32%c\tmvfx%12-15d, mvfx%16-19d, mvfx%0-3d"},
926   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_MAVERICK),
927     0x0e000600, 0x0ff00f10,
928     "cfmadd32%c\tmvax%5-7d, mvfx%12-15d, mvfx%16-19d, mvfx%0-3d"},
929   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_MAVERICK),
930     0x0e100600, 0x0ff00f10,
931     "cfmsub32%c\tmvax%5-7d, mvfx%12-15d, mvfx%16-19d, mvfx%0-3d"},
932   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_MAVERICK),
933     0x0e200600, 0x0ff00f10,
934     "cfmadda32%c\tmvax%5-7d, mvax%12-15d, mvfx%16-19d, mvfx%0-3d"},
935   {ANY, ARM_FEATURE_COPROC (ARM_CEXT_MAVERICK),
936     0x0e300600, 0x0ff00f10,
937     "cfmsuba32%c\tmvax%5-7d, mvax%12-15d, mvfx%16-19d, mvfx%0-3d"},
938
939   /* VFP Fused multiply add instructions.  */
940   {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_FMA),
941     0x0ea00a00, 0x0fb00f50, "vfma%c.f32\t%y1, %y2, %y0"},
942   {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_FMA),
943     0x0ea00b00, 0x0fb00f50, "vfma%c.f64\t%z1, %z2, %z0"},
944   {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_FMA),
945     0x0ea00a40, 0x0fb00f50, "vfms%c.f32\t%y1, %y2, %y0"},
946   {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_FMA),
947     0x0ea00b40, 0x0fb00f50, "vfms%c.f64\t%z1, %z2, %z0"},
948   {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_FMA),
949     0x0e900a40, 0x0fb00f50, "vfnma%c.f32\t%y1, %y2, %y0"},
950   {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_FMA),
951     0x0e900b40, 0x0fb00f50, "vfnma%c.f64\t%z1, %z2, %z0"},
952   {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_FMA),
953     0x0e900a00, 0x0fb00f50, "vfnms%c.f32\t%y1, %y2, %y0"},
954   {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_FMA),
955     0x0e900b00, 0x0fb00f50, "vfnms%c.f64\t%z1, %z2, %z0"},
956
957   /* FP v5.  */
958   {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_ARMV8),
959     0xfe000a00, 0xff800f50, "vsel%20-21c%u.f32\t%y1, %y2, %y0"},
960   {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_ARMV8),
961     0xfe000b00, 0xff800f50, "vsel%20-21c%u.f64\t%z1, %z2, %z0"},
962   {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_ARMV8),
963     0xfe800a00, 0xffb00f50, "vmaxnm%u.f32\t%y1, %y2, %y0"},
964   {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_ARMV8),
965     0xfe800b00, 0xffb00f50, "vmaxnm%u.f64\t%z1, %z2, %z0"},
966   {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_ARMV8),
967     0xfe800a40, 0xffb00f50, "vminnm%u.f32\t%y1, %y2, %y0"},
968   {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_ARMV8),
969     0xfe800b40, 0xffb00f50, "vminnm%u.f64\t%z1, %z2, %z0"},
970   {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_ARMV8),
971     0xfebc0a40, 0xffbc0f50, "vcvt%16-17?mpna%u.%7?su32.f32\t%y1, %y0"},
972   {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_ARMV8),
973     0xfebc0b40, 0xffbc0f50, "vcvt%16-17?mpna%u.%7?su32.f64\t%y1, %z0"},
974   {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_ARMV8),
975     0x0eb60a40, 0x0fbe0f50, "vrint%7,16??xzr%c.f32\t%y1, %y0"},
976   {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_ARMV8),
977     0x0eb60b40, 0x0fbe0f50, "vrint%7,16??xzr%c.f64\t%z1, %z0"},
978   {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_ARMV8),
979     0xfeb80a40, 0xffbc0fd0, "vrint%16-17?mpna%u.f32\t%y1, %y0"},
980   {ANY, ARM_FEATURE_COPROC (FPU_VFP_EXT_ARMV8),
981     0xfeb80b40, 0xffbc0fd0, "vrint%16-17?mpna%u.f64\t%z1, %z0"},
982
983   /* Generic coprocessor instructions.  */
984   {ANY, ARM_FEATURE_CORE_LOW (0), SENTINEL_GENERIC_START, 0, "" },
985   {ANY, ARM_FEATURE_CORE_LOW (ARM_EXT_V5E),
986     0x0c400000, 0x0ff00000, "mcrr%c\t%8-11d, %4-7d, %12-15R, %16-19r, cr%0-3d"},
987   {ANY, ARM_FEATURE_CORE_LOW (ARM_EXT_V5E),
988     0x0c500000, 0x0ff00000,
989     "mrrc%c\t%8-11d, %4-7d, %12-15Ru, %16-19Ru, cr%0-3d"},
990   {ANY, ARM_FEATURE_CORE_LOW (ARM_EXT_V2),
991     0x0e000000, 0x0f000010,
992     "cdp%c\t%8-11d, %20-23d, cr%12-15d, cr%16-19d, cr%0-3d, {%5-7d}"},
993   {ANY, ARM_FEATURE_CORE_LOW (ARM_EXT_V2),
994     0x0e10f010, 0x0f10f010,
995     "mrc%c\t%8-11d, %21-23d, APSR_nzcv, cr%16-19d, cr%0-3d, {%5-7d}"},
996   {ANY, ARM_FEATURE_CORE_LOW (ARM_EXT_V2),
997     0x0e100010, 0x0f100010,
998     "mrc%c\t%8-11d, %21-23d, %12-15r, cr%16-19d, cr%0-3d, {%5-7d}"},
999   {ANY, ARM_FEATURE_CORE_LOW (ARM_EXT_V2),
1000     0x0e000010, 0x0f100010,
1001     "mcr%c\t%8-11d, %21-23d, %12-15R, cr%16-19d, cr%0-3d, {%5-7d}"},
1002   {ANY, ARM_FEATURE_CORE_LOW (ARM_EXT_V2),
1003     0x0c000000, 0x0e100000, "stc%22'l%c\t%8-11d, cr%12-15d, %A"},
1004   {ANY, ARM_FEATURE_CORE_LOW (ARM_EXT_V2),
1005     0x0c100000, 0x0e100000, "ldc%22'l%c\t%8-11d, cr%12-15d, %A"},
1006
1007   /* V6 coprocessor instructions.  */
1008   {ANY, ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
1009     0xfc500000, 0xfff00000,
1010     "mrrc2%c\t%8-11d, %4-7d, %12-15Ru, %16-19Ru, cr%0-3d"},
1011   {ANY, ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
1012     0xfc400000, 0xfff00000,
1013     "mcrr2%c\t%8-11d, %4-7d, %12-15R, %16-19R, cr%0-3d"},
1014
1015   /* ARMv8.3 AdvSIMD instructions in the space of coprocessor 8.  */
1016   {ANY, ARM_FEATURE_CORE_HIGH (ARM_EXT2_V8_3A),
1017     0xfc800800, 0xfeb00f10, "vcadd%c.f16\t%12-15,22V, %16-19,7V, %0-3,5V, #%24?29%24'70"},
1018   {ANY, ARM_FEATURE_CORE_HIGH (ARM_EXT2_V8_3A),
1019     0xfc900800, 0xfeb00f10, "vcadd%c.f32\t%12-15,22V, %16-19,7V, %0-3,5V, #%24?29%24'70"},
1020   {ANY, ARM_FEATURE_CORE_HIGH (ARM_EXT2_V8_3A),
1021     0xfc200800, 0xff300f10, "vcmla%c.f16\t%12-15,22V, %16-19,7V, %0-3,5V, #%23'90"},
1022   {ANY, ARM_FEATURE_CORE_HIGH (ARM_EXT2_V8_3A),
1023     0xfd200800, 0xff300f10, "vcmla%c.f16\t%12-15,22V, %16-19,7V, %0-3,5V, #%23?21%23?780"},
1024   {ANY, ARM_FEATURE_CORE_HIGH (ARM_EXT2_V8_3A),
1025     0xfc300800, 0xff300f10, "vcmla%c.f32\t%12-15,22V, %16-19,7V, %0-3,5V, #%23'90"},
1026   {ANY, ARM_FEATURE_CORE_HIGH (ARM_EXT2_V8_3A),
1027     0xfd300800, 0xff300f10, "vcmla%c.f32\t%12-15,22V, %16-19,7V, %0-3,5V, #%23?21%23?780"},
1028   {ANY, ARM_FEATURE_CORE_HIGH (ARM_EXT2_V8_3A),
1029     0xfe000800, 0xffa00f10, "vcmla%c.f16\t%12-15,22V, %16-19,7V, %0-3D[%5?10], #%20'90"},
1030   {ANY, ARM_FEATURE_CORE_HIGH (ARM_EXT2_V8_3A),
1031     0xfe200800, 0xffa00f10, "vcmla%c.f16\t%12-15,22V, %16-19,7V, %0-3D[%5?10], #%20?21%20?780"},
1032   {ANY, ARM_FEATURE_CORE_HIGH (ARM_EXT2_V8_3A),
1033     0xfe800800, 0xffa00f10, "vcmla%c.f32\t%12-15,22V, %16-19,7V, %0-3,5D[0], #%20'90"},
1034   {ANY, ARM_FEATURE_CORE_HIGH (ARM_EXT2_V8_3A),
1035     0xfea00800, 0xffa00f10, "vcmla%c.f32\t%12-15,22V, %16-19,7V, %0-3,5D[0], #%20?21%20?780"},
1036
1037   /* Dot Product instructions in the space of coprocessor 13.  */
1038   {ANY, ARM_FEATURE_COPROC (FPU_NEON_EXT_DOTPROD),
1039     0xfc200d00, 0xffb00f00, "v%4?usdot.%4?us8\t%12-15,22V, %16-19,7V, %0-3,5V"},
1040   {ANY, ARM_FEATURE_COPROC (FPU_NEON_EXT_DOTPROD),
1041     0xfe000d00, 0xff000f00, "v%4?usdot.%4?us8\t%12-15,22V, %16-19,7V, %0-3D[%5?10]"},
1042
1043   /* ARMv8.2 FMAC Long instructions in the space of coprocessor 8.  */
1044   {ANY, ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST | ARM_EXT2_V8_2A),
1045     0xfc200810, 0xffb00f50, "vfmal.f16\t%12-15,22D, s%7,16-19d, s%5,0-3d"},
1046   {ANY, ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST | ARM_EXT2_V8_2A),
1047     0xfca00810, 0xffb00f50, "vfmsl.f16\t%12-15,22D, s%7,16-19d, s%5,0-3d"},
1048   {ANY, ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST | ARM_EXT2_V8_2A),
1049     0xfc200850, 0xffb00f50, "vfmal.f16\t%12-15,22Q, d%16-19,7d, d%0-3,5d"},
1050   {ANY, ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST | ARM_EXT2_V8_2A),
1051     0xfca00850, 0xffb00f50, "vfmsl.f16\t%12-15,22Q, d%16-19,7d, d%0-3,5d"},
1052   {ANY, ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST | ARM_EXT2_V8_2A),
1053     0xfe000810, 0xffb00f50, "vfmal.f16\t%12-15,22D, s%7,16-19d, s%5,0-2d[%3d]"},
1054   {ANY, ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST | ARM_EXT2_V8_2A),
1055     0xfe100810, 0xffb00f50, "vfmsl.f16\t%12-15,22D, s%7,16-19d, s%5,0-2d[%3d]"},
1056   {ANY, ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST | ARM_EXT2_V8_2A),
1057     0xfe000850, 0xffb00f50, "vfmal.f16\t%12-15,22Q, d%16-19,7d, d%0-2d[%3,5d]"},
1058   {ANY, ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST | ARM_EXT2_V8_2A),
1059     0xfe100850, 0xffb00f50, "vfmsl.f16\t%12-15,22Q, d%16-19,7d, d%0-2d[%3,5d]"},
1060
1061   /* V5 coprocessor instructions.  */
1062   {ANY, ARM_FEATURE_CORE_LOW (ARM_EXT_V5),
1063     0xfc100000, 0xfe100000, "ldc2%22'l%c\t%8-11d, cr%12-15d, %A"},
1064   {ANY, ARM_FEATURE_CORE_LOW (ARM_EXT_V5),
1065     0xfc000000, 0xfe100000, "stc2%22'l%c\t%8-11d, cr%12-15d, %A"},
1066   {ANY, ARM_FEATURE_CORE_LOW (ARM_EXT_V5),
1067     0xfe000000, 0xff000010,
1068     "cdp2%c\t%8-11d, %20-23d, cr%12-15d, cr%16-19d, cr%0-3d, {%5-7d}"},
1069   {ANY, ARM_FEATURE_CORE_LOW (ARM_EXT_V5),
1070     0xfe000010, 0xff100010,
1071     "mcr2%c\t%8-11d, %21-23d, %12-15R, cr%16-19d, cr%0-3d, {%5-7d}"},
1072   {ANY, ARM_FEATURE_CORE_LOW (ARM_EXT_V5),
1073     0xfe100010, 0xff100010,
1074     "mrc2%c\t%8-11d, %21-23d, %12-15r, cr%16-19d, cr%0-3d, {%5-7d}"},
1075
1076   /* ARMv8.2 half-precision Floating point coprocessor 9 (VFP) instructions.
1077      cp_num: bit <11:8> == 0b1001.
1078      cond: bit <31:28> == 0b1110, otherwise, it's UNPREDICTABLE.  */
1079   {ANY, ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST),
1080     0x0eb009c0, 0x0fbf0fd0, "vabs%c.f16\t%y1, %y0"},
1081   {ANY, ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST),
1082     0x0e300900, 0x0fb00f50, "vadd%c.f16\t%y1, %y2, %y0"},
1083   {ANY, ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST),
1084     0x0eb40940, 0x0fbf0f50, "vcmp%7'e%c.f16\t%y1, %y0"},
1085   {ANY, ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST),
1086     0x0eb50940, 0x0fbf0f70, "vcmp%7'e%c.f16\t%y1, #0.0"},
1087   {ANY, ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST),
1088     0x0eba09c0, 0x0fbe0fd0, "vcvt%c.f16.%16?us%7?31%7?26\t%y1, %y1, #%5,0-3k"},
1089   {ANY, ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST),
1090     0x0ebe09c0, 0x0fbe0fd0, "vcvt%c.%16?us%7?31%7?26.f16\t%y1, %y1, #%5,0-3k"},
1091   {ANY, ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST),
1092     0x0ebc0940, 0x0fbe0f50, "vcvt%7`r%c.%16?su32.f16\t%y1, %y0"},
1093   {ANY, ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST),
1094     0x0eb80940, 0x0fbf0f50, "vcvt%c.f16.%7?su32\t%y1, %y0"},
1095   {ANY, ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST),
1096     0xfebc0940, 0xffbc0f50, "vcvt%16-17?mpna%u.%7?su32.f16\t%y1, %y0"},
1097   {ANY, ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST),
1098     0x0e800900, 0x0fb00f50, "vdiv%c.f16\t%y1, %y2, %y0"},
1099   {ANY, ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST),
1100     0x0ea00900, 0x0fb00f50, "vfma%c.f16\t%y1, %y2, %y0"},
1101   {ANY, ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST),
1102     0x0ea00940, 0x0fb00f50, "vfms%c.f16\t%y1, %y2, %y0"},
1103   {ANY, ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST),
1104     0x0e900940, 0x0fb00f50, "vfnma%c.f16\t%y1, %y2, %y0"},
1105   {ANY, ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST),
1106     0x0e900900, 0x0fb00f50, "vfnms%c.f16\t%y1, %y2, %y0"},
1107   {ANY, ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST),
1108     0xfeb00ac0, 0xffbf0fd0, "vins.f16\t%y1, %y0"},
1109   {ANY, ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST),
1110     0xfeb00a40, 0xffbf0fd0, "vmovx%c.f16\t%y1, %y0"},
1111   {ANY, ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST),
1112     0x0d100900, 0x0f300f00, "vldr%c.16\t%y1, %A"},
1113   {ANY, ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST),
1114     0x0d000900, 0x0f300f00, "vstr%c.16\t%y1, %A"},
1115   {ANY, ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST),
1116     0xfe800900, 0xffb00f50, "vmaxnm%c.f16\t%y1, %y2, %y0"},
1117   {ANY, ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST),
1118     0xfe800940, 0xffb00f50, "vminnm%c.f16\t%y1, %y2, %y0"},
1119   {ANY, ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST),
1120     0x0e000900, 0x0fb00f50, "vmla%c.f16\t%y1, %y2, %y0"},
1121   {ANY, ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST),
1122     0x0e000940, 0x0fb00f50, "vmls%c.f16\t%y1, %y2, %y0"},
1123   {ANY, ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST),
1124     0x0e100910, 0x0ff00f7f, "vmov%c.f16\t%12-15r, %y2"},
1125   {ANY, ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST),
1126     0x0e000910, 0x0ff00f7f, "vmov%c.f16\t%y2, %12-15r"},
1127   {ANY, ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST),
1128     0xeb00900, 0x0fb00ff0, "vmov%c.f16\t%y1, #%0-3,16-19E"},
1129   {ANY, ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST),
1130     0x0e200900, 0x0fb00f50, "vmul%c.f16\t%y1, %y2, %y0"},
1131   {ANY, ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST),
1132     0x0eb10940, 0x0fbf0fd0, "vneg%c.f16\t%y1, %y0"},
1133   {ANY, ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST),
1134     0x0e100940, 0x0fb00f50, "vnmla%c.f16\t%y1, %y2, %y0"},
1135   {ANY, ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST),
1136     0x0e100900, 0x0fb00f50, "vnmls%c.f16\t%y1, %y2, %y0"},
1137   {ANY, ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST),
1138     0x0e200940, 0x0fb00f50, "vnmul%c.f16\t%y1, %y2, %y0"},
1139   {ANY, ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST),
1140     0x0eb60940, 0x0fbe0f50, "vrint%7,16??xzr%c.f16\t%y1, %y0"},
1141   {ANY, ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST),
1142     0xfeb80940, 0xffbc0fd0, "vrint%16-17?mpna%u.f16\t%y1, %y0"},
1143   {ANY, ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST),
1144     0xfe000900, 0xff800f50, "vsel%20-21c%u.f16\t%y1, %y2, %y0"},
1145   {ANY, ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST),
1146     0x0eb109c0, 0x0fbf0fd0, "vsqrt%c.f16\t%y1, %y0"},
1147   {ANY, ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST),
1148     0x0e300940, 0x0fb00f50, "vsub%c.f16\t%y1, %y2, %y0"},
1149
1150   /* ARMv8.3 javascript conversion instruction.  */
1151   {ANY, ARM_FEATURE_CORE_HIGH (ARM_EXT2_V8_3A),
1152     0x0eb90bc0, 0x0fbf0fd0, "vjcvt%c.s32.f64\t%y1, %z0"},
1153
1154   {ANY, ARM_FEATURE_CORE_LOW (0), 0, 0, 0}
1155 };
1156
1157 /* Neon opcode table:  This does not encode the top byte -- that is
1158    checked by the print_insn_neon routine, as it depends on whether we are
1159    doing thumb32 or arm32 disassembly.  */
1160
1161 /* print_insn_neon recognizes the following format control codes:
1162
1163    %%                   %
1164
1165    %c                   print condition code
1166    %u                   print condition code (unconditional in ARM mode,
1167                           UNPREDICTABLE if not AL in Thumb)
1168    %A                   print v{st,ld}[1234] operands
1169    %B                   print v{st,ld}[1234] any one operands
1170    %C                   print v{st,ld}[1234] single->all operands
1171    %D                   print scalar
1172    %E                   print vmov, vmvn, vorr, vbic encoded constant
1173    %F                   print vtbl,vtbx register list
1174
1175    %<bitfield>r         print as an ARM register
1176    %<bitfield>d         print the bitfield in decimal
1177    %<bitfield>e         print the 2^N - bitfield in decimal
1178    %<bitfield>D         print as a NEON D register
1179    %<bitfield>Q         print as a NEON Q register
1180    %<bitfield>R         print as a NEON D or Q register
1181    %<bitfield>Sn        print byte scaled width limited by n
1182    %<bitfield>Tn        print short scaled width limited by n
1183    %<bitfield>Un        print long scaled width limited by n
1184
1185    %<bitfield>'c        print specified char iff bitfield is all ones
1186    %<bitfield>`c        print specified char iff bitfield is all zeroes
1187    %<bitfield>?ab...    select from array of values in big endian order.  */
1188
1189 static const struct opcode32 neon_opcodes[] =
1190 {
1191   /* Extract.  */
1192   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1193     0xf2b00840, 0xffb00850,
1194     "vext%c.8\t%12-15,22R, %16-19,7R, %0-3,5R, #%8-11d"},
1195   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1196     0xf2b00000, 0xffb00810,
1197     "vext%c.8\t%12-15,22R, %16-19,7R, %0-3,5R, #%8-11d"},
1198
1199   /* Data transfer between ARM and NEON registers.  */
1200   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1201     0x0e800b10, 0x1ff00f70, "vdup%c.32\t%16-19,7D, %12-15r"},
1202   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1203     0x0e800b30, 0x1ff00f70, "vdup%c.16\t%16-19,7D, %12-15r"},
1204   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1205     0x0ea00b10, 0x1ff00f70, "vdup%c.32\t%16-19,7Q, %12-15r"},
1206   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1207     0x0ea00b30, 0x1ff00f70, "vdup%c.16\t%16-19,7Q, %12-15r"},
1208   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1209     0x0ec00b10, 0x1ff00f70, "vdup%c.8\t%16-19,7D, %12-15r"},
1210   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1211     0x0ee00b10, 0x1ff00f70, "vdup%c.8\t%16-19,7Q, %12-15r"},
1212
1213   /* Move data element to all lanes.  */
1214   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1215     0xf3b40c00, 0xffb70f90, "vdup%c.32\t%12-15,22R, %0-3,5D[%19d]"},
1216   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1217     0xf3b20c00, 0xffb30f90, "vdup%c.16\t%12-15,22R, %0-3,5D[%18-19d]"},
1218   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1219     0xf3b10c00, 0xffb10f90, "vdup%c.8\t%12-15,22R, %0-3,5D[%17-19d]"},
1220
1221   /* Table lookup.  */
1222   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1223     0xf3b00800, 0xffb00c50, "vtbl%c.8\t%12-15,22D, %F, %0-3,5D"},
1224   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1225     0xf3b00840, 0xffb00c50, "vtbx%c.8\t%12-15,22D, %F, %0-3,5D"},
1226
1227   /* Half-precision conversions.  */
1228   {ARM_FEATURE_COPROC (FPU_VFP_EXT_FP16),
1229     0xf3b60600, 0xffbf0fd0, "vcvt%c.f16.f32\t%12-15,22D, %0-3,5Q"},
1230   {ARM_FEATURE_COPROC (FPU_VFP_EXT_FP16),
1231     0xf3b60700, 0xffbf0fd0, "vcvt%c.f32.f16\t%12-15,22Q, %0-3,5D"},
1232
1233   /* NEON fused multiply add instructions.  */
1234   {ARM_FEATURE_COPROC (FPU_NEON_EXT_FMA),
1235     0xf2000c10, 0xffb00f10, "vfma%c.f32\t%12-15,22R, %16-19,7R, %0-3,5R"},
1236   {ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST),
1237     0xf2100c10, 0xffb00f10, "vfma%c.f16\t%12-15,22R, %16-19,7R, %0-3,5R"},
1238   {ARM_FEATURE_COPROC (FPU_NEON_EXT_FMA),
1239     0xf2200c10, 0xffb00f10, "vfms%c.f32\t%12-15,22R, %16-19,7R, %0-3,5R"},
1240   {ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST),
1241     0xf2300c10, 0xffb00f10, "vfms%c.f16\t%12-15,22R, %16-19,7R, %0-3,5R"},
1242
1243   /* Two registers, miscellaneous.  */
1244   {ARM_FEATURE_COPROC (FPU_NEON_EXT_ARMV8),
1245     0xf3ba0400, 0xffbf0c10, "vrint%7-9?p?m?zaxn%u.f32\t%12-15,22R, %0-3,5R"},
1246   {ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST),
1247     0xf3b60400, 0xffbf0c10, "vrint%7-9?p?m?zaxn%u.f16\t%12-15,22R, %0-3,5R"},
1248   {ARM_FEATURE_COPROC (FPU_NEON_EXT_ARMV8),
1249     0xf3bb0000, 0xffbf0c10, "vcvt%8-9?mpna%u.%7?us32.f32\t%12-15,22R, %0-3,5R"},
1250   {ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST),
1251     0xf3b70000, 0xffbf0c10, "vcvt%8-9?mpna%u.%7?us16.f16\t%12-15,22R, %0-3,5R"},
1252   {ARM_FEATURE_COPROC (FPU_CRYPTO_EXT_ARMV8),
1253     0xf3b00300, 0xffbf0fd0, "aese%u.8\t%12-15,22Q, %0-3,5Q"},
1254   {ARM_FEATURE_COPROC (FPU_CRYPTO_EXT_ARMV8),
1255     0xf3b00340, 0xffbf0fd0, "aesd%u.8\t%12-15,22Q, %0-3,5Q"},
1256   {ARM_FEATURE_COPROC (FPU_CRYPTO_EXT_ARMV8),
1257     0xf3b00380, 0xffbf0fd0, "aesmc%u.8\t%12-15,22Q, %0-3,5Q"},
1258   {ARM_FEATURE_COPROC (FPU_CRYPTO_EXT_ARMV8),
1259     0xf3b003c0, 0xffbf0fd0, "aesimc%u.8\t%12-15,22Q, %0-3,5Q"},
1260   {ARM_FEATURE_COPROC (FPU_CRYPTO_EXT_ARMV8),
1261     0xf3b902c0, 0xffbf0fd0, "sha1h%u.32\t%12-15,22Q, %0-3,5Q"},
1262   {ARM_FEATURE_COPROC (FPU_CRYPTO_EXT_ARMV8),
1263     0xf3ba0380, 0xffbf0fd0, "sha1su1%u.32\t%12-15,22Q, %0-3,5Q"},
1264   {ARM_FEATURE_COPROC (FPU_CRYPTO_EXT_ARMV8),
1265     0xf3ba03c0, 0xffbf0fd0, "sha256su0%u.32\t%12-15,22Q, %0-3,5Q"},
1266   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1267     0xf2880a10, 0xfebf0fd0, "vmovl%c.%24?us8\t%12-15,22Q, %0-3,5D"},
1268   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1269     0xf2900a10, 0xfebf0fd0, "vmovl%c.%24?us16\t%12-15,22Q, %0-3,5D"},
1270   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1271     0xf2a00a10, 0xfebf0fd0, "vmovl%c.%24?us32\t%12-15,22Q, %0-3,5D"},
1272   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1273     0xf3b00500, 0xffbf0f90, "vcnt%c.8\t%12-15,22R, %0-3,5R"},
1274   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1275     0xf3b00580, 0xffbf0f90, "vmvn%c\t%12-15,22R, %0-3,5R"},
1276   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1277     0xf3b20000, 0xffbf0f90, "vswp%c\t%12-15,22R, %0-3,5R"},
1278   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1279     0xf3b20200, 0xffb30fd0, "vmovn%c.i%18-19T2\t%12-15,22D, %0-3,5Q"},
1280   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1281     0xf3b20240, 0xffb30fd0, "vqmovun%c.s%18-19T2\t%12-15,22D, %0-3,5Q"},
1282   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1283     0xf3b20280, 0xffb30fd0, "vqmovn%c.s%18-19T2\t%12-15,22D, %0-3,5Q"},
1284   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1285     0xf3b202c0, 0xffb30fd0, "vqmovn%c.u%18-19T2\t%12-15,22D, %0-3,5Q"},
1286   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1287     0xf3b20300, 0xffb30fd0,
1288     "vshll%c.i%18-19S2\t%12-15,22Q, %0-3,5D, #%18-19S2"},
1289   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1290     0xf3bb0400, 0xffbf0e90, "vrecpe%c.%8?fu%18-19S2\t%12-15,22R, %0-3,5R"},
1291   {ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST),
1292     0xf3b70400, 0xffbf0e90, "vrecpe%c.%8?fu16\t%12-15,22R, %0-3,5R"},
1293   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1294     0xf3bb0480, 0xffbf0e90, "vrsqrte%c.%8?fu%18-19S2\t%12-15,22R, %0-3,5R"},
1295   {ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST),
1296     0xf3b70480, 0xffbf0e90, "vrsqrte%c.%8?fu16\t%12-15,22R, %0-3,5R"},
1297   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1298     0xf3b00000, 0xffb30f90, "vrev64%c.%18-19S2\t%12-15,22R, %0-3,5R"},
1299   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1300     0xf3b00080, 0xffb30f90, "vrev32%c.%18-19S2\t%12-15,22R, %0-3,5R"},
1301   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1302     0xf3b00100, 0xffb30f90, "vrev16%c.%18-19S2\t%12-15,22R, %0-3,5R"},
1303   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1304     0xf3b00400, 0xffb30f90, "vcls%c.s%18-19S2\t%12-15,22R, %0-3,5R"},
1305   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1306     0xf3b00480, 0xffb30f90, "vclz%c.i%18-19S2\t%12-15,22R, %0-3,5R"},
1307   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1308     0xf3b00700, 0xffb30f90, "vqabs%c.s%18-19S2\t%12-15,22R, %0-3,5R"},
1309   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1310     0xf3b00780, 0xffb30f90, "vqneg%c.s%18-19S2\t%12-15,22R, %0-3,5R"},
1311   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1312     0xf3b20080, 0xffb30f90, "vtrn%c.%18-19S2\t%12-15,22R, %0-3,5R"},
1313   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1314     0xf3b20100, 0xffb30f90, "vuzp%c.%18-19S2\t%12-15,22R, %0-3,5R"},
1315   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1316     0xf3b20180, 0xffb30f90, "vzip%c.%18-19S2\t%12-15,22R, %0-3,5R"},
1317   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1318     0xf3b10000, 0xffb30b90, "vcgt%c.%10?fs%18-19S2\t%12-15,22R, %0-3,5R, #0"},
1319   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1320     0xf3b10080, 0xffb30b90, "vcge%c.%10?fs%18-19S2\t%12-15,22R, %0-3,5R, #0"},
1321   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1322     0xf3b10100, 0xffb30b90, "vceq%c.%10?fi%18-19S2\t%12-15,22R, %0-3,5R, #0"},
1323   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1324     0xf3b10180, 0xffb30b90, "vcle%c.%10?fs%18-19S2\t%12-15,22R, %0-3,5R, #0"},
1325   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1326     0xf3b10200, 0xffb30b90, "vclt%c.%10?fs%18-19S2\t%12-15,22R, %0-3,5R, #0"},
1327   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1328     0xf3b10300, 0xffb30b90, "vabs%c.%10?fs%18-19S2\t%12-15,22R, %0-3,5R"},
1329   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1330     0xf3b10380, 0xffb30b90, "vneg%c.%10?fs%18-19S2\t%12-15,22R, %0-3,5R"},
1331   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1332     0xf3b00200, 0xffb30f10, "vpaddl%c.%7?us%18-19S2\t%12-15,22R, %0-3,5R"},
1333   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1334     0xf3b00600, 0xffb30f10, "vpadal%c.%7?us%18-19S2\t%12-15,22R, %0-3,5R"},
1335   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1336     0xf3bb0600, 0xffbf0e10,
1337     "vcvt%c.%7-8?usff%18-19Sa.%7-8?ffus%18-19Sa\t%12-15,22R, %0-3,5R"},
1338   {ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST),
1339     0xf3b70600, 0xffbf0e10,
1340     "vcvt%c.%7-8?usff16.%7-8?ffus16\t%12-15,22R, %0-3,5R"},
1341
1342   /* Three registers of the same length.  */
1343   {ARM_FEATURE_COPROC (FPU_CRYPTO_EXT_ARMV8),
1344     0xf2000c40, 0xffb00f50, "sha1c%u.32\t%12-15,22Q, %16-19,7Q, %0-3,5Q"},
1345   {ARM_FEATURE_COPROC (FPU_CRYPTO_EXT_ARMV8),
1346     0xf2100c40, 0xffb00f50, "sha1p%u.32\t%12-15,22Q, %16-19,7Q, %0-3,5Q"},
1347   {ARM_FEATURE_COPROC (FPU_CRYPTO_EXT_ARMV8),
1348     0xf2200c40, 0xffb00f50, "sha1m%u.32\t%12-15,22Q, %16-19,7Q, %0-3,5Q"},
1349   {ARM_FEATURE_COPROC (FPU_CRYPTO_EXT_ARMV8),
1350     0xf2300c40, 0xffb00f50, "sha1su0%u.32\t%12-15,22Q, %16-19,7Q, %0-3,5Q"},
1351   {ARM_FEATURE_COPROC (FPU_CRYPTO_EXT_ARMV8),
1352     0xf3000c40, 0xffb00f50, "sha256h%u.32\t%12-15,22Q, %16-19,7Q, %0-3,5Q"},
1353   {ARM_FEATURE_COPROC (FPU_CRYPTO_EXT_ARMV8),
1354     0xf3100c40, 0xffb00f50, "sha256h2%u.32\t%12-15,22Q, %16-19,7Q, %0-3,5Q"},
1355   {ARM_FEATURE_COPROC (FPU_CRYPTO_EXT_ARMV8),
1356     0xf3200c40, 0xffb00f50, "sha256su1%u.32\t%12-15,22Q, %16-19,7Q, %0-3,5Q"},
1357   {ARM_FEATURE_COPROC (FPU_NEON_EXT_ARMV8),
1358     0xf3000f10, 0xffb00f10, "vmaxnm%u.f32\t%12-15,22R, %16-19,7R, %0-3,5R"},
1359   {ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST),
1360     0xf3100f10, 0xffb00f10, "vmaxnm%u.f16\t%12-15,22R, %16-19,7R, %0-3,5R"},
1361   {ARM_FEATURE_COPROC (FPU_NEON_EXT_ARMV8),
1362     0xf3200f10, 0xffb00f10, "vminnm%u.f32\t%12-15,22R, %16-19,7R, %0-3,5R"},
1363   {ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST),
1364     0xf3300f10, 0xffb00f10, "vminnm%u.f16\t%12-15,22R, %16-19,7R, %0-3,5R"},
1365   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1366     0xf2000110, 0xffb00f10, "vand%c\t%12-15,22R, %16-19,7R, %0-3,5R"},
1367   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1368     0xf2100110, 0xffb00f10, "vbic%c\t%12-15,22R, %16-19,7R, %0-3,5R"},
1369   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1370     0xf2200110, 0xffb00f10, "vorr%c\t%12-15,22R, %16-19,7R, %0-3,5R"},
1371   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1372     0xf2300110, 0xffb00f10, "vorn%c\t%12-15,22R, %16-19,7R, %0-3,5R"},
1373   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1374     0xf3000110, 0xffb00f10, "veor%c\t%12-15,22R, %16-19,7R, %0-3,5R"},
1375   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1376     0xf3100110, 0xffb00f10, "vbsl%c\t%12-15,22R, %16-19,7R, %0-3,5R"},
1377   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1378     0xf3200110, 0xffb00f10, "vbit%c\t%12-15,22R, %16-19,7R, %0-3,5R"},
1379   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1380     0xf3300110, 0xffb00f10, "vbif%c\t%12-15,22R, %16-19,7R, %0-3,5R"},
1381   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1382     0xf2000d00, 0xffb00f10, "vadd%c.f32\t%12-15,22R, %16-19,7R, %0-3,5R"},
1383   {ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST),
1384     0xf2100d00, 0xffb00f10, "vadd%c.f16\t%12-15,22R, %16-19,7R, %0-3,5R"},
1385   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1386     0xf2000d10, 0xffb00f10, "vmla%c.f32\t%12-15,22R, %16-19,7R, %0-3,5R"},
1387   {ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST),
1388     0xf2100d10, 0xffb00f10, "vmla%c.f16\t%12-15,22R, %16-19,7R, %0-3,5R"},
1389   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1390     0xf2000e00, 0xffb00f10, "vceq%c.f32\t%12-15,22R, %16-19,7R, %0-3,5R"},
1391   {ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST),
1392     0xf2100e00, 0xffb00f10, "vceq%c.f16\t%12-15,22R, %16-19,7R, %0-3,5R"},
1393   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1394     0xf2000f00, 0xffb00f10, "vmax%c.f32\t%12-15,22R, %16-19,7R, %0-3,5R"},
1395   {ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST),
1396     0xf2100f00, 0xffb00f10, "vmax%c.f16\t%12-15,22R, %16-19,7R, %0-3,5R"},
1397   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1398     0xf2000f10, 0xffb00f10, "vrecps%c.f32\t%12-15,22R, %16-19,7R, %0-3,5R"},
1399   {ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST),
1400     0xf2100f10, 0xffb00f10, "vrecps%c.f16\t%12-15,22R, %16-19,7R, %0-3,5R"},
1401   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1402     0xf2200d00, 0xffb00f10, "vsub%c.f32\t%12-15,22R, %16-19,7R, %0-3,5R"},
1403   {ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST),
1404     0xf2300d00, 0xffb00f10, "vsub%c.f16\t%12-15,22R, %16-19,7R, %0-3,5R"},
1405   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1406     0xf2200d10, 0xffb00f10, "vmls%c.f32\t%12-15,22R, %16-19,7R, %0-3,5R"},
1407   {ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST),
1408     0xf2300d10, 0xffb00f10, "vmls%c.f16\t%12-15,22R, %16-19,7R, %0-3,5R"},
1409   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1410     0xf2200f00, 0xffb00f10, "vmin%c.f32\t%12-15,22R, %16-19,7R, %0-3,5R"},
1411   {ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST),
1412     0xf2300f00, 0xffb00f10, "vmin%c.f16\t%12-15,22R, %16-19,7R, %0-3,5R"},
1413   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1414     0xf2200f10, 0xffb00f10, "vrsqrts%c.f32\t%12-15,22R, %16-19,7R, %0-3,5R"},
1415   {ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST),
1416     0xf2300f10, 0xffb00f10, "vrsqrts%c.f16\t%12-15,22R, %16-19,7R, %0-3,5R"},
1417   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1418     0xf3000d00, 0xffb00f10, "vpadd%c.f32\t%12-15,22R, %16-19,7R, %0-3,5R"},
1419   {ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST),
1420     0xf3100d00, 0xffb00f10, "vpadd%c.f16\t%12-15,22R, %16-19,7R, %0-3,5R"},
1421   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1422     0xf3000d10, 0xffb00f10, "vmul%c.f32\t%12-15,22R, %16-19,7R, %0-3,5R"},
1423   {ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST),
1424     0xf3100d10, 0xffb00f10, "vmul%c.f16\t%12-15,22R, %16-19,7R, %0-3,5R"},
1425   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1426     0xf3000e00, 0xffb00f10, "vcge%c.f32\t%12-15,22R, %16-19,7R, %0-3,5R"},
1427   {ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST),
1428     0xf3100e00, 0xffb00f10, "vcge%c.f16\t%12-15,22R, %16-19,7R, %0-3,5R"},
1429   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1430     0xf3000e10, 0xffb00f10, "vacge%c.f32\t%12-15,22R, %16-19,7R, %0-3,5R"},
1431   {ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST),
1432     0xf3100e10, 0xffb00f10, "vacge%c.f16\t%12-15,22R, %16-19,7R, %0-3,5R"},
1433   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1434     0xf3000f00, 0xffb00f10, "vpmax%c.f32\t%12-15,22R, %16-19,7R, %0-3,5R"},
1435   {ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST),
1436     0xf3100f00, 0xffb00f10, "vpmax%c.f16\t%12-15,22R, %16-19,7R, %0-3,5R"},
1437   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1438     0xf3200d00, 0xffb00f10, "vabd%c.f32\t%12-15,22R, %16-19,7R, %0-3,5R"},
1439   {ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST),
1440     0xf3300d00, 0xffb00f10, "vabd%c.f16\t%12-15,22R, %16-19,7R, %0-3,5R"},
1441   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1442     0xf3200e00, 0xffb00f10, "vcgt%c.f32\t%12-15,22R, %16-19,7R, %0-3,5R"},
1443   {ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST),
1444     0xf3300e00, 0xffb00f10, "vcgt%c.f16\t%12-15,22R, %16-19,7R, %0-3,5R"},
1445   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1446     0xf3200e10, 0xffb00f10, "vacgt%c.f32\t%12-15,22R, %16-19,7R, %0-3,5R"},
1447   {ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST),
1448     0xf3300e10, 0xffb00f10, "vacgt%c.f16\t%12-15,22R, %16-19,7R, %0-3,5R"},
1449   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1450     0xf3200f00, 0xffb00f10, "vpmin%c.f32\t%12-15,22R, %16-19,7R, %0-3,5R"},
1451   {ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST),
1452     0xf3300f00, 0xffb00f10, "vpmin%c.f16\t%12-15,22R, %16-19,7R, %0-3,5R"},
1453   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1454     0xf2000800, 0xff800f10, "vadd%c.i%20-21S3\t%12-15,22R, %16-19,7R, %0-3,5R"},
1455   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1456     0xf2000810, 0xff800f10, "vtst%c.%20-21S2\t%12-15,22R, %16-19,7R, %0-3,5R"},
1457   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1458     0xf2000900, 0xff800f10, "vmla%c.i%20-21S2\t%12-15,22R, %16-19,7R, %0-3,5R"},
1459   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1460     0xf2000b00, 0xff800f10,
1461     "vqdmulh%c.s%20-21S6\t%12-15,22R, %16-19,7R, %0-3,5R"},
1462   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1463     0xf2000b10, 0xff800f10,
1464     "vpadd%c.i%20-21S2\t%12-15,22R, %16-19,7R, %0-3,5R"},
1465   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1466     0xf3000800, 0xff800f10, "vsub%c.i%20-21S3\t%12-15,22R, %16-19,7R, %0-3,5R"},
1467   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1468     0xf3000810, 0xff800f10, "vceq%c.i%20-21S2\t%12-15,22R, %16-19,7R, %0-3,5R"},
1469   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1470     0xf3000900, 0xff800f10, "vmls%c.i%20-21S2\t%12-15,22R, %16-19,7R, %0-3,5R"},
1471   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1472     0xf3000b00, 0xff800f10,
1473     "vqrdmulh%c.s%20-21S6\t%12-15,22R, %16-19,7R, %0-3,5R"},
1474   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1475     0xf2000000, 0xfe800f10,
1476     "vhadd%c.%24?us%20-21S2\t%12-15,22R, %16-19,7R, %0-3,5R"},
1477   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1478     0xf2000010, 0xfe800f10,
1479     "vqadd%c.%24?us%20-21S3\t%12-15,22R, %16-19,7R, %0-3,5R"},
1480   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1481     0xf2000100, 0xfe800f10,
1482     "vrhadd%c.%24?us%20-21S2\t%12-15,22R, %16-19,7R, %0-3,5R"},
1483   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1484     0xf2000200, 0xfe800f10,
1485     "vhsub%c.%24?us%20-21S2\t%12-15,22R, %16-19,7R, %0-3,5R"},
1486   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1487     0xf2000210, 0xfe800f10,
1488     "vqsub%c.%24?us%20-21S3\t%12-15,22R, %16-19,7R, %0-3,5R"},
1489   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1490     0xf2000300, 0xfe800f10,
1491     "vcgt%c.%24?us%20-21S2\t%12-15,22R, %16-19,7R, %0-3,5R"},
1492   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1493     0xf2000310, 0xfe800f10,
1494     "vcge%c.%24?us%20-21S2\t%12-15,22R, %16-19,7R, %0-3,5R"},
1495   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1496     0xf2000400, 0xfe800f10,
1497     "vshl%c.%24?us%20-21S3\t%12-15,22R, %0-3,5R, %16-19,7R"},
1498   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1499     0xf2000410, 0xfe800f10,
1500     "vqshl%c.%24?us%20-21S3\t%12-15,22R, %0-3,5R, %16-19,7R"},
1501   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1502     0xf2000500, 0xfe800f10,
1503     "vrshl%c.%24?us%20-21S3\t%12-15,22R, %0-3,5R, %16-19,7R"},
1504   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1505     0xf2000510, 0xfe800f10,
1506     "vqrshl%c.%24?us%20-21S3\t%12-15,22R, %0-3,5R, %16-19,7R"},
1507   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1508     0xf2000600, 0xfe800f10,
1509     "vmax%c.%24?us%20-21S2\t%12-15,22R, %16-19,7R, %0-3,5R"},
1510   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1511     0xf2000610, 0xfe800f10,
1512     "vmin%c.%24?us%20-21S2\t%12-15,22R, %16-19,7R, %0-3,5R"},
1513   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1514     0xf2000700, 0xfe800f10,
1515     "vabd%c.%24?us%20-21S2\t%12-15,22R, %16-19,7R, %0-3,5R"},
1516   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1517     0xf2000710, 0xfe800f10,
1518     "vaba%c.%24?us%20-21S2\t%12-15,22R, %16-19,7R, %0-3,5R"},
1519   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1520     0xf2000910, 0xfe800f10,
1521     "vmul%c.%24?pi%20-21S2\t%12-15,22R, %16-19,7R, %0-3,5R"},
1522   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1523     0xf2000a00, 0xfe800f10,
1524     "vpmax%c.%24?us%20-21S2\t%12-15,22R, %16-19,7R, %0-3,5R"},
1525   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1526     0xf2000a10, 0xfe800f10,
1527     "vpmin%c.%24?us%20-21S2\t%12-15,22R, %16-19,7R, %0-3,5R"},
1528   {ARM_FEATURE_COPROC (FPU_NEON_EXT_RDMA),
1529     0xf3000b10, 0xff800f10,
1530     "vqrdmlah%c.s%20-21S6\t%12-15,22R, %16-19,7R, %0-3,5R"},
1531   {ARM_FEATURE_COPROC (FPU_NEON_EXT_RDMA),
1532     0xf3000c10, 0xff800f10,
1533     "vqrdmlsh%c.s%20-21S6\t%12-15,22R, %16-19,7R, %0-3,5R"},
1534
1535   /* One register and an immediate value.  */
1536   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1537     0xf2800e10, 0xfeb80fb0, "vmov%c.i8\t%12-15,22R, %E"},
1538   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1539     0xf2800e30, 0xfeb80fb0, "vmov%c.i64\t%12-15,22R, %E"},
1540   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1541     0xf2800f10, 0xfeb80fb0, "vmov%c.f32\t%12-15,22R, %E"},
1542   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1543     0xf2800810, 0xfeb80db0, "vmov%c.i16\t%12-15,22R, %E"},
1544   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1545     0xf2800830, 0xfeb80db0, "vmvn%c.i16\t%12-15,22R, %E"},
1546   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1547     0xf2800910, 0xfeb80db0, "vorr%c.i16\t%12-15,22R, %E"},
1548   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1549     0xf2800930, 0xfeb80db0, "vbic%c.i16\t%12-15,22R, %E"},
1550   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1551     0xf2800c10, 0xfeb80eb0, "vmov%c.i32\t%12-15,22R, %E"},
1552   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1553     0xf2800c30, 0xfeb80eb0, "vmvn%c.i32\t%12-15,22R, %E"},
1554   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1555     0xf2800110, 0xfeb809b0, "vorr%c.i32\t%12-15,22R, %E"},
1556   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1557     0xf2800130, 0xfeb809b0, "vbic%c.i32\t%12-15,22R, %E"},
1558   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1559     0xf2800010, 0xfeb808b0, "vmov%c.i32\t%12-15,22R, %E"},
1560   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1561     0xf2800030, 0xfeb808b0, "vmvn%c.i32\t%12-15,22R, %E"},
1562
1563   /* Two registers and a shift amount.  */
1564   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1565     0xf2880810, 0xffb80fd0, "vshrn%c.i16\t%12-15,22D, %0-3,5Q, #%16-18e"},
1566   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1567     0xf2880850, 0xffb80fd0, "vrshrn%c.i16\t%12-15,22D, %0-3,5Q, #%16-18e"},
1568   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1569     0xf2880810, 0xfeb80fd0, "vqshrun%c.s16\t%12-15,22D, %0-3,5Q, #%16-18e"},
1570   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1571     0xf2880850, 0xfeb80fd0, "vqrshrun%c.s16\t%12-15,22D, %0-3,5Q, #%16-18e"},
1572   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1573     0xf2880910, 0xfeb80fd0, "vqshrn%c.%24?us16\t%12-15,22D, %0-3,5Q, #%16-18e"},
1574   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1575     0xf2880950, 0xfeb80fd0,
1576     "vqrshrn%c.%24?us16\t%12-15,22D, %0-3,5Q, #%16-18e"},
1577   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1578     0xf2880a10, 0xfeb80fd0, "vshll%c.%24?us8\t%12-15,22Q, %0-3,5D, #%16-18d"},
1579   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1580     0xf2900810, 0xffb00fd0, "vshrn%c.i32\t%12-15,22D, %0-3,5Q, #%16-19e"},
1581   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1582     0xf2900850, 0xffb00fd0, "vrshrn%c.i32\t%12-15,22D, %0-3,5Q, #%16-19e"},
1583   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1584     0xf2880510, 0xffb80f90, "vshl%c.%24?us8\t%12-15,22R, %0-3,5R, #%16-18d"},
1585   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1586     0xf3880410, 0xffb80f90, "vsri%c.8\t%12-15,22R, %0-3,5R, #%16-18e"},
1587   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1588     0xf3880510, 0xffb80f90, "vsli%c.8\t%12-15,22R, %0-3,5R, #%16-18d"},
1589   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1590     0xf3880610, 0xffb80f90, "vqshlu%c.s8\t%12-15,22R, %0-3,5R, #%16-18d"},
1591   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1592     0xf2900810, 0xfeb00fd0, "vqshrun%c.s32\t%12-15,22D, %0-3,5Q, #%16-19e"},
1593   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1594     0xf2900850, 0xfeb00fd0, "vqrshrun%c.s32\t%12-15,22D, %0-3,5Q, #%16-19e"},
1595   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1596     0xf2900910, 0xfeb00fd0, "vqshrn%c.%24?us32\t%12-15,22D, %0-3,5Q, #%16-19e"},
1597   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1598     0xf2900950, 0xfeb00fd0,
1599     "vqrshrn%c.%24?us32\t%12-15,22D, %0-3,5Q, #%16-19e"},
1600   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1601     0xf2900a10, 0xfeb00fd0, "vshll%c.%24?us16\t%12-15,22Q, %0-3,5D, #%16-19d"},
1602   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1603     0xf2880010, 0xfeb80f90, "vshr%c.%24?us8\t%12-15,22R, %0-3,5R, #%16-18e"},
1604   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1605     0xf2880110, 0xfeb80f90, "vsra%c.%24?us8\t%12-15,22R, %0-3,5R, #%16-18e"},
1606   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1607     0xf2880210, 0xfeb80f90, "vrshr%c.%24?us8\t%12-15,22R, %0-3,5R, #%16-18e"},
1608   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1609     0xf2880310, 0xfeb80f90, "vrsra%c.%24?us8\t%12-15,22R, %0-3,5R, #%16-18e"},
1610   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1611     0xf2880710, 0xfeb80f90, "vqshl%c.%24?us8\t%12-15,22R, %0-3,5R, #%16-18d"},
1612   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1613     0xf2a00810, 0xffa00fd0, "vshrn%c.i64\t%12-15,22D, %0-3,5Q, #%16-20e"},
1614   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1615     0xf2a00850, 0xffa00fd0, "vrshrn%c.i64\t%12-15,22D, %0-3,5Q, #%16-20e"},
1616   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1617     0xf2900510, 0xffb00f90, "vshl%c.%24?us16\t%12-15,22R, %0-3,5R, #%16-19d"},
1618   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1619     0xf3900410, 0xffb00f90, "vsri%c.16\t%12-15,22R, %0-3,5R, #%16-19e"},
1620   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1621     0xf3900510, 0xffb00f90, "vsli%c.16\t%12-15,22R, %0-3,5R, #%16-19d"},
1622   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1623     0xf3900610, 0xffb00f90, "vqshlu%c.s16\t%12-15,22R, %0-3,5R, #%16-19d"},
1624   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1625     0xf2a00a10, 0xfea00fd0, "vshll%c.%24?us32\t%12-15,22Q, %0-3,5D, #%16-20d"},
1626   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1627     0xf2900010, 0xfeb00f90, "vshr%c.%24?us16\t%12-15,22R, %0-3,5R, #%16-19e"},
1628   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1629     0xf2900110, 0xfeb00f90, "vsra%c.%24?us16\t%12-15,22R, %0-3,5R, #%16-19e"},
1630   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1631     0xf2900210, 0xfeb00f90, "vrshr%c.%24?us16\t%12-15,22R, %0-3,5R, #%16-19e"},
1632   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1633     0xf2900310, 0xfeb00f90, "vrsra%c.%24?us16\t%12-15,22R, %0-3,5R, #%16-19e"},
1634   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1635     0xf2900710, 0xfeb00f90, "vqshl%c.%24?us16\t%12-15,22R, %0-3,5R, #%16-19d"},
1636   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1637     0xf2a00810, 0xfea00fd0, "vqshrun%c.s64\t%12-15,22D, %0-3,5Q, #%16-20e"},
1638   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1639     0xf2a00850, 0xfea00fd0, "vqrshrun%c.s64\t%12-15,22D, %0-3,5Q, #%16-20e"},
1640   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1641     0xf2a00910, 0xfea00fd0, "vqshrn%c.%24?us64\t%12-15,22D, %0-3,5Q, #%16-20e"},
1642   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1643     0xf2a00950, 0xfea00fd0,
1644     "vqrshrn%c.%24?us64\t%12-15,22D, %0-3,5Q, #%16-20e"},
1645   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1646     0xf2a00510, 0xffa00f90, "vshl%c.%24?us32\t%12-15,22R, %0-3,5R, #%16-20d"},
1647   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1648     0xf3a00410, 0xffa00f90, "vsri%c.32\t%12-15,22R, %0-3,5R, #%16-20e"},
1649   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1650     0xf3a00510, 0xffa00f90, "vsli%c.32\t%12-15,22R, %0-3,5R, #%16-20d"},
1651   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1652     0xf3a00610, 0xffa00f90, "vqshlu%c.s32\t%12-15,22R, %0-3,5R, #%16-20d"},
1653   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1654     0xf2a00010, 0xfea00f90, "vshr%c.%24?us32\t%12-15,22R, %0-3,5R, #%16-20e"},
1655   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1656     0xf2a00110, 0xfea00f90, "vsra%c.%24?us32\t%12-15,22R, %0-3,5R, #%16-20e"},
1657   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1658     0xf2a00210, 0xfea00f90, "vrshr%c.%24?us32\t%12-15,22R, %0-3,5R, #%16-20e"},
1659   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1660     0xf2a00310, 0xfea00f90, "vrsra%c.%24?us32\t%12-15,22R, %0-3,5R, #%16-20e"},
1661   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1662     0xf2a00710, 0xfea00f90, "vqshl%c.%24?us32\t%12-15,22R, %0-3,5R, #%16-20d"},
1663   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1664     0xf2800590, 0xff800f90, "vshl%c.%24?us64\t%12-15,22R, %0-3,5R, #%16-21d"},
1665   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1666     0xf3800490, 0xff800f90, "vsri%c.64\t%12-15,22R, %0-3,5R, #%16-21e"},
1667   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1668     0xf3800590, 0xff800f90, "vsli%c.64\t%12-15,22R, %0-3,5R, #%16-21d"},
1669   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1670     0xf3800690, 0xff800f90, "vqshlu%c.s64\t%12-15,22R, %0-3,5R, #%16-21d"},
1671   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1672     0xf2800090, 0xfe800f90, "vshr%c.%24?us64\t%12-15,22R, %0-3,5R, #%16-21e"},
1673   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1674     0xf2800190, 0xfe800f90, "vsra%c.%24?us64\t%12-15,22R, %0-3,5R, #%16-21e"},
1675   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1676     0xf2800290, 0xfe800f90, "vrshr%c.%24?us64\t%12-15,22R, %0-3,5R, #%16-21e"},
1677   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1678     0xf2800390, 0xfe800f90, "vrsra%c.%24?us64\t%12-15,22R, %0-3,5R, #%16-21e"},
1679   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1680     0xf2800790, 0xfe800f90, "vqshl%c.%24?us64\t%12-15,22R, %0-3,5R, #%16-21d"},
1681   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1682     0xf2a00e10, 0xfea00e90,
1683     "vcvt%c.%24,8?usff32.%24,8?ffus32\t%12-15,22R, %0-3,5R, #%16-20e"},
1684   {ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST),
1685     0xf2a00c10, 0xfea00e90,
1686     "vcvt%c.%24,8?usff16.%24,8?ffus16\t%12-15,22R, %0-3,5R, #%16-20e"},
1687
1688   /* Three registers of different lengths.  */
1689   {ARM_FEATURE_COPROC (FPU_CRYPTO_EXT_ARMV8),
1690     0xf2a00e00, 0xfeb00f50, "vmull%c.p64\t%12-15,22Q, %16-19,7D, %0-3,5D"},
1691   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1692     0xf2800e00, 0xfea00f50, "vmull%c.p%20S0\t%12-15,22Q, %16-19,7D, %0-3,5D"},
1693   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1694     0xf2800400, 0xff800f50,
1695     "vaddhn%c.i%20-21T2\t%12-15,22D, %16-19,7Q, %0-3,5Q"},
1696   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1697     0xf2800600, 0xff800f50,
1698     "vsubhn%c.i%20-21T2\t%12-15,22D, %16-19,7Q, %0-3,5Q"},
1699   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1700     0xf2800900, 0xff800f50,
1701     "vqdmlal%c.s%20-21S6\t%12-15,22Q, %16-19,7D, %0-3,5D"},
1702   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1703     0xf2800b00, 0xff800f50,
1704     "vqdmlsl%c.s%20-21S6\t%12-15,22Q, %16-19,7D, %0-3,5D"},
1705   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1706     0xf2800d00, 0xff800f50,
1707     "vqdmull%c.s%20-21S6\t%12-15,22Q, %16-19,7D, %0-3,5D"},
1708   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1709     0xf3800400, 0xff800f50,
1710     "vraddhn%c.i%20-21T2\t%12-15,22D, %16-19,7Q, %0-3,5Q"},
1711   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1712     0xf3800600, 0xff800f50,
1713     "vrsubhn%c.i%20-21T2\t%12-15,22D, %16-19,7Q, %0-3,5Q"},
1714   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1715     0xf2800000, 0xfe800f50,
1716     "vaddl%c.%24?us%20-21S2\t%12-15,22Q, %16-19,7D, %0-3,5D"},
1717   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1718     0xf2800100, 0xfe800f50,
1719     "vaddw%c.%24?us%20-21S2\t%12-15,22Q, %16-19,7Q, %0-3,5D"},
1720   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1721     0xf2800200, 0xfe800f50,
1722     "vsubl%c.%24?us%20-21S2\t%12-15,22Q, %16-19,7D, %0-3,5D"},
1723   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1724     0xf2800300, 0xfe800f50,
1725     "vsubw%c.%24?us%20-21S2\t%12-15,22Q, %16-19,7Q, %0-3,5D"},
1726   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1727     0xf2800500, 0xfe800f50,
1728     "vabal%c.%24?us%20-21S2\t%12-15,22Q, %16-19,7D, %0-3,5D"},
1729   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1730     0xf2800700, 0xfe800f50,
1731     "vabdl%c.%24?us%20-21S2\t%12-15,22Q, %16-19,7D, %0-3,5D"},
1732   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1733     0xf2800800, 0xfe800f50,
1734     "vmlal%c.%24?us%20-21S2\t%12-15,22Q, %16-19,7D, %0-3,5D"},
1735   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1736     0xf2800a00, 0xfe800f50,
1737     "vmlsl%c.%24?us%20-21S2\t%12-15,22Q, %16-19,7D, %0-3,5D"},
1738   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1739     0xf2800c00, 0xfe800f50,
1740     "vmull%c.%24?us%20-21S2\t%12-15,22Q, %16-19,7D, %0-3,5D"},
1741
1742   /* Two registers and a scalar.  */
1743   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1744     0xf2800040, 0xff800f50, "vmla%c.i%20-21S6\t%12-15,22D, %16-19,7D, %D"},
1745   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1746     0xf2800140, 0xff900f50, "vmla%c.f%20-21Sa\t%12-15,22D, %16-19,7D, %D"},
1747   {ARM_FEATURE_COPROC (ARM_EXT2_FP16_INST),
1748     0xf2900140, 0xffb00f50, "vmla%c.f16\t%12-15,22D, %16-19,7D, %D"},
1749   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1750     0xf2800340, 0xff800f50, "vqdmlal%c.s%20-21S6\t%12-15,22Q, %16-19,7D, %D"},
1751   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1752     0xf2800440, 0xff800f50, "vmls%c.i%20-21S6\t%12-15,22D, %16-19,7D, %D"},
1753   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1754     0xf2800540, 0xff900f50, "vmls%c.f%20-21S6\t%12-15,22D, %16-19,7D, %D"},
1755   {ARM_FEATURE_COPROC (ARM_EXT2_FP16_INST),
1756     0xf2900540, 0xffb00f50, "vmls%c.f16\t%12-15,22D, %16-19,7D, %D"},
1757   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1758     0xf2800740, 0xff800f50, "vqdmlsl%c.s%20-21S6\t%12-15,22Q, %16-19,7D, %D"},
1759   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1760     0xf2800840, 0xff800f50, "vmul%c.i%20-21S6\t%12-15,22D, %16-19,7D, %D"},
1761   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1762     0xf2800940, 0xff900f50, "vmul%c.f%20-21Sa\t%12-15,22D, %16-19,7D, %D"},
1763   {ARM_FEATURE_COPROC (ARM_EXT2_FP16_INST),
1764     0xf2900940, 0xffb00f50, "vmul%c.f16\t%12-15,22D, %16-19,7D, %D"},
1765   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1766     0xf2800b40, 0xff800f50, "vqdmull%c.s%20-21S6\t%12-15,22Q, %16-19,7D, %D"},
1767   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1768     0xf2800c40, 0xff800f50, "vqdmulh%c.s%20-21S6\t%12-15,22D, %16-19,7D, %D"},
1769   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1770     0xf2800d40, 0xff800f50, "vqrdmulh%c.s%20-21S6\t%12-15,22D, %16-19,7D, %D"},
1771   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1772     0xf3800040, 0xff800f50, "vmla%c.i%20-21S6\t%12-15,22Q, %16-19,7Q, %D"},
1773   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1774     0xf3800140, 0xff900f50, "vmla%c.f%20-21Sa\t%12-15,22Q, %16-19,7Q, %D"},
1775   {ARM_FEATURE_COPROC (ARM_EXT2_FP16_INST),
1776     0xf3900140, 0xffb00f50, "vmla%c.f16\t%12-15,22Q, %16-19,7Q, %D"},
1777   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1778     0xf3800440, 0xff800f50, "vmls%c.i%20-21S6\t%12-15,22Q, %16-19,7Q, %D"},
1779   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1780     0xf3800540, 0xff900f50, "vmls%c.f%20-21Sa\t%12-15,22Q, %16-19,7Q, %D"},
1781   {ARM_FEATURE_COPROC (ARM_EXT2_FP16_INST),
1782     0xf3900540, 0xffb00f50, "vmls%c.f16\t%12-15,22Q, %16-19,7Q, %D"},
1783   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1784     0xf3800840, 0xff800f50, "vmul%c.i%20-21S6\t%12-15,22Q, %16-19,7Q, %D"},
1785   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1786     0xf3800940, 0xff900f50, "vmul%c.f%20-21Sa\t%12-15,22Q, %16-19,7Q, %D"},
1787   {ARM_FEATURE_COPROC (ARM_EXT2_FP16_INST),
1788     0xf3900940, 0xffb00f50, "vmul%c.f16\t%12-15,22Q, %16-19,7Q, %D"},
1789   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1790     0xf3800c40, 0xff800f50, "vqdmulh%c.s%20-21S6\t%12-15,22Q, %16-19,7Q, %D"},
1791   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1792     0xf3800d40, 0xff800f50, "vqrdmulh%c.s%20-21S6\t%12-15,22Q, %16-19,7Q, %D"},
1793   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1794     0xf2800240, 0xfe800f50,
1795     "vmlal%c.%24?us%20-21S6\t%12-15,22Q, %16-19,7D, %D"},
1796   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1797     0xf2800640, 0xfe800f50,
1798     "vmlsl%c.%24?us%20-21S6\t%12-15,22Q, %16-19,7D, %D"},
1799   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1800     0xf2800a40, 0xfe800f50,
1801     "vmull%c.%24?us%20-21S6\t%12-15,22Q, %16-19,7D, %D"},
1802   {ARM_FEATURE_COPROC (FPU_NEON_EXT_RDMA),
1803     0xf2800e40, 0xff800f50,
1804    "vqrdmlah%c.s%20-21S6\t%12-15,22D, %16-19,7D, %D"},
1805   {ARM_FEATURE_COPROC (FPU_NEON_EXT_RDMA),
1806     0xf2800f40, 0xff800f50,
1807    "vqrdmlsh%c.s%20-21S6\t%12-15,22D, %16-19,7D, %D"},
1808   {ARM_FEATURE_COPROC (FPU_NEON_EXT_RDMA),
1809     0xf3800e40, 0xff800f50,
1810    "vqrdmlah%c.s%20-21S6\t%12-15,22Q, %16-19,7Q, %D"},
1811   {ARM_FEATURE_COPROC (FPU_NEON_EXT_RDMA),
1812     0xf3800f40, 0xff800f50,
1813    "vqrdmlsh%c.s%20-21S6\t%12-15,22Q, %16-19,7Q, %D"
1814   },
1815
1816   /* Element and structure load/store.  */
1817   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1818     0xf4a00fc0, 0xffb00fc0, "vld4%c.32\t%C"},
1819   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1820     0xf4a00c00, 0xffb00f00, "vld1%c.%6-7S2\t%C"},
1821   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1822     0xf4a00d00, 0xffb00f00, "vld2%c.%6-7S2\t%C"},
1823   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1824     0xf4a00e00, 0xffb00f00, "vld3%c.%6-7S2\t%C"},
1825   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1826     0xf4a00f00, 0xffb00f00, "vld4%c.%6-7S2\t%C"},
1827   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1828     0xf4000200, 0xff900f00, "v%21?ls%21?dt1%c.%6-7S3\t%A"},
1829   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1830     0xf4000300, 0xff900f00, "v%21?ls%21?dt2%c.%6-7S2\t%A"},
1831   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1832     0xf4000400, 0xff900f00, "v%21?ls%21?dt3%c.%6-7S2\t%A"},
1833   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1834     0xf4000500, 0xff900f00, "v%21?ls%21?dt3%c.%6-7S2\t%A"},
1835   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1836     0xf4000600, 0xff900f00, "v%21?ls%21?dt1%c.%6-7S3\t%A"},
1837   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1838     0xf4000700, 0xff900f00, "v%21?ls%21?dt1%c.%6-7S3\t%A"},
1839   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1840     0xf4000800, 0xff900f00, "v%21?ls%21?dt2%c.%6-7S2\t%A"},
1841   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1842     0xf4000900, 0xff900f00, "v%21?ls%21?dt2%c.%6-7S2\t%A"},
1843   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1844     0xf4000a00, 0xff900f00, "v%21?ls%21?dt1%c.%6-7S3\t%A"},
1845   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1846     0xf4000000, 0xff900e00, "v%21?ls%21?dt4%c.%6-7S2\t%A"},
1847   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1848     0xf4800000, 0xff900300, "v%21?ls%21?dt1%c.%10-11S2\t%B"},
1849   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1850     0xf4800100, 0xff900300, "v%21?ls%21?dt2%c.%10-11S2\t%B"},
1851   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1852     0xf4800200, 0xff900300, "v%21?ls%21?dt3%c.%10-11S2\t%B"},
1853   {ARM_FEATURE_COPROC (FPU_NEON_EXT_V1),
1854     0xf4800300, 0xff900300, "v%21?ls%21?dt4%c.%10-11S2\t%B"},
1855
1856   {ARM_FEATURE_CORE_LOW (0), 0 ,0, 0}
1857 };
1858
1859 /* mve opcode table.  */
1860
1861 /* print_insn_mve recognizes the following format control codes:
1862
1863    %%                   %
1864
1865    %a                   print '+' or '-' or imm offset in vldr[bhwd] and
1866                         vstr[bhwd]
1867    %c                   print condition code
1868    %d                   print addr mode of MVE vldr[bhw] and vstr[bhw]
1869    %u                   print 'U' (unsigned) or 'S' for various mve instructions
1870    %i                   print MVE predicate(s) for vpt and vpst
1871    %n                   print vector comparison code for predicated instruction
1872    %v                   print vector predicate for instruction in predicated
1873                         block
1874    %o                   print offset scaled for vldr[hwd] and vstr[hwd]
1875    %w                   print writeback mode for MVE v{st,ld}[24]
1876    %B                   print v{st,ld}[24] any one operands
1877
1878    %<bitfield>r         print as an ARM register
1879    %<bitfield>d         print the bitfield in decimal
1880    %<bitfield>Q         print as a MVE Q register
1881    %<bitfield>Z         as %<>r but r15 is ZR instead of PC and r13 is
1882                         UNPREDICTABLE
1883    %<bitfield>s         print size for vector predicate & non VMOV instructions
1884    %<bitfield>i         print immediate for vstr/vldr reg +/- imm
1885    */
1886
1887 static const struct mopcode32 mve_opcodes[] =
1888 {
1889   /* MVE.  */
1890
1891   {ARM_FEATURE_COPROC (FPU_MVE),
1892    MVE_VPST,
1893    0xfe310f4d, 0xffbf1fff,
1894    "vpst%i"
1895   },
1896
1897   /* Floating point VPT T1.  */
1898   {ARM_FEATURE_COPROC (FPU_MVE_FP),
1899    MVE_VPT_FP_T1,
1900    0xee310f00, 0xefb10f50,
1901    "vpt%i.f%28s\t%n, %17-19Q, %1-3,5Q"},
1902   /* Floating point VPT T2.  */
1903   {ARM_FEATURE_COPROC (FPU_MVE_FP),
1904    MVE_VPT_FP_T2,
1905    0xee310f40, 0xefb10f50,
1906    "vpt%i.f%28s\t%n, %17-19Q, %0-3Z"},
1907
1908   /* Vector VPT T1.  */
1909   {ARM_FEATURE_COPROC (FPU_MVE),
1910    MVE_VPT_VEC_T1,
1911    0xfe010f00, 0xff811f51,
1912    "vpt%i.i%20-21s\t%n, %17-19Q, %1-3,5Q"},
1913   /* Vector VPT T2.  */
1914   {ARM_FEATURE_COPROC (FPU_MVE),
1915    MVE_VPT_VEC_T2,
1916    0xfe010f01, 0xff811f51,
1917    "vpt%i.u%20-21s\t%n, %17-19Q, %1-3,5Q"},
1918   /* Vector VPT T3.  */
1919   {ARM_FEATURE_COPROC (FPU_MVE),
1920    MVE_VPT_VEC_T3,
1921    0xfe011f00, 0xff811f50,
1922    "vpt%i.s%20-21s\t%n, %17-19Q, %1-3,5Q"},
1923   /* Vector VPT T4.  */
1924   {ARM_FEATURE_COPROC (FPU_MVE),
1925    MVE_VPT_VEC_T4,
1926    0xfe010f40, 0xff811f70,
1927    "vpt%i.i%20-21s\t%n, %17-19Q, %0-3Z"},
1928   /* Vector VPT T5.  */
1929   {ARM_FEATURE_COPROC (FPU_MVE),
1930    MVE_VPT_VEC_T5,
1931    0xfe010f60, 0xff811f70,
1932    "vpt%i.u%20-21s\t%n, %17-19Q, %0-3Z"},
1933   /* Vector VPT T6.  */
1934   {ARM_FEATURE_COPROC (FPU_MVE),
1935    MVE_VPT_VEC_T6,
1936    0xfe011f40, 0xff811f50,
1937    "vpt%i.s%20-21s\t%n, %17-19Q, %0-3Z"},
1938
1939   /* Vector VCMP floating point T1.  */
1940   {ARM_FEATURE_COPROC (FPU_MVE_FP),
1941    MVE_VCMP_FP_T1,
1942    0xee310f00, 0xeff1ef50,
1943    "vcmp%v.f%28s\t%n, %17-19Q, %1-3,5Q"},
1944
1945   /* Vector VCMP floating point T2.  */
1946   {ARM_FEATURE_COPROC (FPU_MVE_FP),
1947    MVE_VCMP_FP_T2,
1948    0xee310f40, 0xeff1ef50,
1949    "vcmp%v.f%28s\t%n, %17-19Q, %0-3Z"},
1950
1951   /* Vector VCMP T1.  */
1952   {ARM_FEATURE_COPROC (FPU_MVE),
1953    MVE_VCMP_VEC_T1,
1954    0xfe010f00, 0xffc1ff51,
1955    "vcmp%v.i%20-21s\t%n, %17-19Q, %1-3,5Q"},
1956   /* Vector VCMP T2.  */
1957   {ARM_FEATURE_COPROC (FPU_MVE),
1958    MVE_VCMP_VEC_T2,
1959    0xfe010f01, 0xffc1ff51,
1960    "vcmp%v.u%20-21s\t%n, %17-19Q, %1-3,5Q"},
1961   /* Vector VCMP T3.  */
1962   {ARM_FEATURE_COPROC (FPU_MVE),
1963    MVE_VCMP_VEC_T3,
1964    0xfe011f00, 0xffc1ff50,
1965    "vcmp%v.s%20-21s\t%n, %17-19Q, %1-3,5Q"},
1966   /* Vector VCMP T4.  */
1967   {ARM_FEATURE_COPROC (FPU_MVE),
1968    MVE_VCMP_VEC_T4,
1969    0xfe010f40, 0xffc1ff70,
1970    "vcmp%v.i%20-21s\t%n, %17-19Q, %0-3Z"},
1971   /* Vector VCMP T5.  */
1972   {ARM_FEATURE_COPROC (FPU_MVE),
1973    MVE_VCMP_VEC_T5,
1974    0xfe010f60, 0xffc1ff70,
1975    "vcmp%v.u%20-21s\t%n, %17-19Q, %0-3Z"},
1976   /* Vector VCMP T6.  */
1977   {ARM_FEATURE_COPROC (FPU_MVE),
1978    MVE_VCMP_VEC_T6,
1979    0xfe011f40, 0xffc1ff50,
1980    "vcmp%v.s%20-21s\t%n, %17-19Q, %0-3Z"},
1981
1982   /* Vector VDUP.  */
1983   {ARM_FEATURE_COPROC (FPU_MVE),
1984    MVE_VDUP,
1985    0xeea00b10, 0xffb10f5f,
1986    "vdup%v.%5,22s\t%17-19,7Q, %12-15r"},
1987
1988   /* Vector VEOR.  */
1989   {ARM_FEATURE_COPROC (FPU_MVE),
1990    MVE_VEOR,
1991    0xff000150, 0xffd11f51,
1992    "veor%v\t%13-15,22Q, %17-19,7Q, %1-3,5Q"},
1993
1994   /* Vector VFMA, vector * scalar.  */
1995   {ARM_FEATURE_COPROC (FPU_MVE_FP),
1996    MVE_VFMA_FP_SCALAR,
1997    0xee310e40, 0xefb11f70,
1998    "vfma%v.f%28s\t%13-15,22Q, %17-19,7Q, %0-3r"},
1999
2000   /* Vector VFMA floating point.  */
2001   {ARM_FEATURE_COPROC (FPU_MVE_FP),
2002    MVE_VFMA_FP,
2003    0xef000c50, 0xffa11f51,
2004    "vfma%v.f%20s\t%13-15,22Q, %17-19,7Q, %1-3,5Q"},
2005
2006   /* Vector VFMS floating point.  */
2007   {ARM_FEATURE_COPROC (FPU_MVE_FP),
2008    MVE_VFMS_FP,
2009    0xef200c50, 0xffa11f51,
2010    "vfms%v.f%20s\t%13-15,22Q, %17-19,7Q, %1-3,5Q"},
2011
2012   /* Vector VFMAS, vector * scalar.  */
2013   {ARM_FEATURE_COPROC (FPU_MVE_FP),
2014    MVE_VFMAS_FP_SCALAR,
2015    0xee311e40, 0xefb11f70,
2016    "vfmas%v.f%28s\t%13-15,22Q, %17-19,7Q, %0-3r"},
2017
2018   /* Vector VHADD T1.  */
2019   {ARM_FEATURE_COPROC (FPU_MVE),
2020    MVE_VHADD_T1,
2021    0xef000040, 0xef811f51,
2022    "vhadd%v.%u%20-21s\t%13-15,22Q, %17-19,7Q, %1-3,5Q"},
2023
2024   /* Vector VHADD T2.  */
2025   {ARM_FEATURE_COPROC (FPU_MVE),
2026    MVE_VHADD_T2,
2027    0xee000f40, 0xef811f70,
2028    "vhadd%v.%u%20-21s\t%13-15,22Q, %17-19,7Q, %0-3r"},
2029
2030   /* Vector VHSUB T1.  */
2031   {ARM_FEATURE_COPROC (FPU_MVE),
2032    MVE_VHSUB_T1,
2033    0xef000240, 0xef811f51,
2034    "vhsub%v.%u%20-21s\t%13-15,22Q, %17-19,7Q, %1-3,5Q"},
2035
2036   /* Vector VHSUB T2.  */
2037   {ARM_FEATURE_COPROC (FPU_MVE),
2038    MVE_VHSUB_T2,
2039    0xee001f40, 0xef811f70,
2040    "vhsub%v.%u%20-21s\t%13-15,22Q, %17-19,7Q, %0-3r"},
2041
2042   /* Vector VDUP.  */
2043   {ARM_FEATURE_COPROC (FPU_MVE),
2044    MVE_VDUP,
2045    0xeea00b10, 0xffb10f5f,
2046    "vdup%v.%5,22s\t%17-19,7Q, %12-15r"},
2047
2048   /* Vector VRHADD.  */
2049   {ARM_FEATURE_COPROC (FPU_MVE),
2050    MVE_VRHADD,
2051    0xef000140, 0xef811f51,
2052    "vrhadd%v.%u%20-21s\t%13-15,22Q, %17-19,7Q, %1-3,5Q"},
2053
2054   /* Vector VLD2.  */
2055   {ARM_FEATURE_COPROC (FPU_MVE),
2056    MVE_VLD2,
2057    0xfc901e00, 0xff901e5f,
2058    "vld2%5d.%7-8s\t%B, [%16-19r]%w"},
2059
2060   /* Vector VLD4.  */
2061   {ARM_FEATURE_COPROC (FPU_MVE),
2062    MVE_VLD4,
2063    0xfc901e01, 0xff901e1f,
2064    "vld4%5-6d.%7-8s\t%B, [%16-19r]%w"},
2065
2066   /* Vector VLDRB gather load.  */
2067   {ARM_FEATURE_COPROC (FPU_MVE),
2068    MVE_VLDRB_GATHER_T1,
2069    0xec900e00, 0xefb01e50,
2070    "vldrb%v.%u%7-8s\t%13-15,22Q, [%16-19r, %1-3,5Q]"},
2071
2072   /* Vector VLDRH gather load.  */
2073   {ARM_FEATURE_COPROC (FPU_MVE),
2074    MVE_VLDRH_GATHER_T2,
2075    0xec900e10, 0xefb01e50,
2076    "vldrh%v.%u%7-8s\t%13-15,22Q, [%16-19r, %1-3,5Q%o]"},
2077
2078   /* Vector VLDRW gather load.  */
2079   {ARM_FEATURE_COPROC (FPU_MVE),
2080    MVE_VLDRW_GATHER_T3,
2081    0xfc900f40, 0xffb01fd0,
2082    "vldrw%v.u32\t%13-15,22Q, [%16-19r, %1-3,5Q%o]"},
2083
2084   /* Vector VLDRD gather load.  */
2085   {ARM_FEATURE_COPROC (FPU_MVE),
2086    MVE_VLDRD_GATHER_T4,
2087    0xec900fd0, 0xefb01fd0,
2088    "vldrd%v.u64\t%13-15,22Q, [%16-19r, %1-3,5Q%o]"},
2089
2090   /* Vector VLDRW gather load.  */
2091   {ARM_FEATURE_COPROC (FPU_MVE),
2092    MVE_VLDRW_GATHER_T5,
2093    0xfd101e00, 0xff111f00,
2094    "vldrw%v.u32\t%13-15,22Q, [%17-19,7Q, #%a%0-6i]%w"},
2095
2096   /* Vector VLDRD gather load, variant T6.  */
2097   {ARM_FEATURE_COPROC (FPU_MVE),
2098    MVE_VLDRD_GATHER_T6,
2099    0xfd101f00, 0xff111f00,
2100    "vldrd%v.u64\t%13-15,22Q, [%17-19,7Q, #%a%0-6i]%w"},
2101
2102   /* Vector VLDRB.  */
2103   {ARM_FEATURE_COPROC (FPU_MVE),
2104    MVE_VLDRB_T1,
2105    0xec100e00, 0xee581e00,
2106    "vldrb%v.%u%7-8s\t%13-15Q, %d"},
2107
2108   /* Vector VLDRH.  */
2109   {ARM_FEATURE_COPROC (FPU_MVE),
2110    MVE_VLDRH_T2,
2111    0xec180e00, 0xee581e00,
2112    "vldrh%v.%u%7-8s\t%13-15Q, %d"},
2113
2114   /* Vector VLDRB unsigned, variant T5.  */
2115   {ARM_FEATURE_COPROC (FPU_MVE),
2116    MVE_VLDRB_T5,
2117    0xec101e00, 0xfe101f80,
2118    "vldrb%v.u8\t%13-15,22Q, %d"},
2119
2120   /* Vector VLDRH unsigned, variant T6.  */
2121   {ARM_FEATURE_COPROC (FPU_MVE),
2122    MVE_VLDRH_T6,
2123    0xec101e80, 0xfe101f80,
2124    "vldrh%v.u16\t%13-15,22Q, %d"},
2125
2126   /* Vector VLDRW unsigned, variant T7.  */
2127   {ARM_FEATURE_COPROC (FPU_MVE),
2128    MVE_VLDRW_T7,
2129    0xec101f00, 0xfe101f80,
2130    "vldrw%v.u32\t%13-15,22Q, %d"},
2131
2132   /* Vector VST2 no writeback.  */
2133   {ARM_FEATURE_COPROC (FPU_MVE),
2134    MVE_VST2,
2135    0xfc801e00, 0xffb01e5f,
2136    "vst2%5d.%7-8s\t%B, [%16-19r]"},
2137
2138   /* Vector VST2 writeback.  */
2139   {ARM_FEATURE_COPROC (FPU_MVE),
2140    MVE_VST2,
2141    0xfca01e00, 0xffb01e5f,
2142    "vst2%5d.%7-8s\t%B, [%16-19r]!"},
2143
2144   /* Vector VST4 no writeback.  */
2145   {ARM_FEATURE_COPROC (FPU_MVE),
2146    MVE_VST4,
2147    0xfc801e01, 0xffb01e1f,
2148    "vst4%5-6d.%7-8s\t%B, [%16-19r]"},
2149
2150   /* Vector VST4 writeback.  */
2151   {ARM_FEATURE_COPROC (FPU_MVE),
2152    MVE_VST4,
2153    0xfca01e01, 0xffb01e1f,
2154    "vst4%5-6d.%7-8s\t%B, [%16-19r]!"},
2155
2156   /* Vector VSTRB scatter store, T1 variant.  */
2157   {ARM_FEATURE_COPROC (FPU_MVE),
2158    MVE_VSTRB_SCATTER_T1,
2159    0xec800e00, 0xffb01e50,
2160    "vstrb%v.%7-8s\t%13-15,22Q, [%16-19r, %1-3,5Q]"},
2161
2162   /* Vector VSTRH scatter store, T2 variant.  */
2163   {ARM_FEATURE_COPROC (FPU_MVE),
2164    MVE_VSTRH_SCATTER_T2,
2165    0xec800e10, 0xffb01e50,
2166    "vstrh%v.%7-8s\t%13-15,22Q, [%16-19r, %1-3,5Q%o]"},
2167
2168   /* Vector VSTRW scatter store, T3 variant.  */
2169   {ARM_FEATURE_COPROC (FPU_MVE),
2170    MVE_VSTRW_SCATTER_T3,
2171    0xec800e40, 0xffb01e50,
2172    "vstrw%v.%7-8s\t%13-15,22Q, [%16-19r, %1-3,5Q%o]"},
2173
2174   /* Vector VSTRD scatter store, T4 variant.  */
2175   {ARM_FEATURE_COPROC (FPU_MVE),
2176    MVE_VSTRD_SCATTER_T4,
2177    0xec800fd0, 0xffb01fd0,
2178    "vstrd%v.64\t%13-15,22Q, [%16-19r, %1-3,5Q%o]"},
2179
2180   /* Vector VSTRW scatter store, T5 variant.  */
2181   {ARM_FEATURE_COPROC (FPU_MVE),
2182    MVE_VSTRW_SCATTER_T5,
2183    0xfd001e00, 0xff111f00,
2184    "vstrw%v.32\t%13-15,22Q, [%17-19,7Q, #%a%0-6i]%w"},
2185
2186   /* Vector VSTRD scatter store, T6 variant.  */
2187   {ARM_FEATURE_COPROC (FPU_MVE),
2188    MVE_VSTRD_SCATTER_T6,
2189    0xfd001f00, 0xff111f00,
2190    "vstrd%v.64\t%13-15,22Q, [%17-19,7Q, #%a%0-6i]%w"},
2191
2192   /* Vector VSTRB.  */
2193   {ARM_FEATURE_COPROC (FPU_MVE),
2194    MVE_VSTRB_T1,
2195    0xec000e00, 0xfe581e00,
2196    "vstrb%v.%7-8s\t%13-15Q, %d"},
2197
2198   /* Vector VSTRH.  */
2199   {ARM_FEATURE_COPROC (FPU_MVE),
2200    MVE_VSTRH_T2,
2201    0xec080e00, 0xfe581e00,
2202    "vstrh%v.%7-8s\t%13-15Q, %d"},
2203
2204   /* Vector VSTRB variant T5.  */
2205   {ARM_FEATURE_COPROC (FPU_MVE),
2206    MVE_VSTRB_T5,
2207    0xec001e00, 0xfe101f80,
2208    "vstrb%v.8\t%13-15,22Q, %d"},
2209
2210   /* Vector VSTRH variant T6.  */
2211   {ARM_FEATURE_COPROC (FPU_MVE),
2212    MVE_VSTRH_T6,
2213    0xec001e80, 0xfe101f80,
2214    "vstrh%v.16\t%13-15,22Q, %d"},
2215
2216   /* Vector VSTRW variant T7.  */
2217   {ARM_FEATURE_COPROC (FPU_MVE),
2218    MVE_VSTRW_T7,
2219    0xec001f00, 0xfe101f80,
2220    "vstrw%v.32\t%13-15,22Q, %d"},
2221
2222   {ARM_FEATURE_CORE_LOW (0),
2223    MVE_NONE,
2224    0x00000000, 0x00000000, 0}
2225 };
2226
2227 /* Opcode tables: ARM, 16-bit Thumb, 32-bit Thumb.  All three are partially
2228    ordered: they must be searched linearly from the top to obtain a correct
2229    match.  */
2230
2231 /* print_insn_arm recognizes the following format control codes:
2232
2233    %%                   %
2234
2235    %a                   print address for ldr/str instruction
2236    %s                   print address for ldr/str halfword/signextend instruction
2237    %S                   like %s but allow UNPREDICTABLE addressing
2238    %b                   print branch destination
2239    %c                   print condition code (always bits 28-31)
2240    %m                   print register mask for ldm/stm instruction
2241    %o                   print operand2 (immediate or register + shift)
2242    %p                   print 'p' iff bits 12-15 are 15
2243    %t                   print 't' iff bit 21 set and bit 24 clear
2244    %B                   print arm BLX(1) destination
2245    %C                   print the PSR sub type.
2246    %U                   print barrier type.
2247    %P                   print address for pli instruction.
2248
2249    %<bitfield>r         print as an ARM register
2250    %<bitfield>T         print as an ARM register + 1
2251    %<bitfield>R         as %r but r15 is UNPREDICTABLE
2252    %<bitfield>{r|R}u    as %{r|R} but if matches the other %u field then is UNPREDICTABLE
2253    %<bitfield>{r|R}U    as %{r|R} but if matches the other %U field then is UNPREDICTABLE
2254    %<bitfield>d         print the bitfield in decimal
2255    %<bitfield>W         print the bitfield plus one in decimal
2256    %<bitfield>x         print the bitfield in hex
2257    %<bitfield>X         print the bitfield as 1 hex digit without leading "0x"
2258
2259    %<bitfield>'c        print specified char iff bitfield is all ones
2260    %<bitfield>`c        print specified char iff bitfield is all zeroes
2261    %<bitfield>?ab...    select from array of values in big endian order
2262
2263    %e                   print arm SMI operand (bits 0..7,8..19).
2264    %E                   print the LSB and WIDTH fields of a BFI or BFC instruction.
2265    %V                   print the 16-bit immediate field of a MOVT or MOVW instruction.
2266    %R                   print the SPSR/CPSR or banked register of an MRS.  */
2267
2268 static const struct opcode32 arm_opcodes[] =
2269 {
2270   /* ARM instructions.  */
2271   {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
2272     0xe1a00000, 0xffffffff, "nop\t\t\t; (mov r0, r0)"},
2273   {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
2274     0xe7f000f0, 0xfff000f0, "udf\t#%e"},
2275
2276   {ARM_FEATURE_CORE_LOW (ARM_EXT_V4T | ARM_EXT_V5),
2277     0x012FFF10, 0x0ffffff0, "bx%c\t%0-3r"},
2278   {ARM_FEATURE_CORE_LOW (ARM_EXT_V2),
2279     0x00000090, 0x0fe000f0, "mul%20's%c\t%16-19R, %0-3R, %8-11R"},
2280   {ARM_FEATURE_CORE_LOW (ARM_EXT_V2),
2281     0x00200090, 0x0fe000f0, "mla%20's%c\t%16-19R, %0-3R, %8-11R, %12-15R"},
2282   {ARM_FEATURE_CORE_LOW (ARM_EXT_V2S),
2283     0x01000090, 0x0fb00ff0, "swp%22'b%c\t%12-15RU, %0-3Ru, [%16-19RuU]"},
2284   {ARM_FEATURE_CORE_LOW (ARM_EXT_V3M),
2285     0x00800090, 0x0fa000f0,
2286     "%22?sumull%20's%c\t%12-15Ru, %16-19Ru, %0-3R, %8-11R"},
2287   {ARM_FEATURE_CORE_LOW (ARM_EXT_V3M),
2288     0x00a00090, 0x0fa000f0,
2289     "%22?sumlal%20's%c\t%12-15Ru, %16-19Ru, %0-3R, %8-11R"},
2290
2291   /* V8.2 RAS extension instructions.  */
2292   {ARM_FEATURE_CORE_HIGH (ARM_EXT2_RAS),
2293     0xe320f010, 0xffffffff, "esb"},
2294
2295   /* V8 instructions.  */
2296   {ARM_FEATURE_CORE_LOW (ARM_EXT_V8),
2297     0x0320f005, 0x0fffffff, "sevl"},
2298   /* Defined in V8 but is in NOP space so available to all arch.  */
2299   {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
2300     0xe1000070, 0xfff000f0, "hlt\t0x%16-19X%12-15X%8-11X%0-3X"},
2301   {ARM_FEATURE_CORE_HIGH (ARM_EXT2_ATOMICS),
2302     0x01800e90, 0x0ff00ff0, "stlex%c\t%12-15r, %0-3r, [%16-19R]"},
2303   {ARM_FEATURE_CORE_LOW (ARM_EXT2_ATOMICS),
2304     0x01900e9f, 0x0ff00fff, "ldaex%c\t%12-15r, [%16-19R]"},
2305   {ARM_FEATURE_CORE_LOW (ARM_EXT_V8),
2306     0x01a00e90, 0x0ff00ff0, "stlexd%c\t%12-15r, %0-3r, %0-3T, [%16-19R]"},
2307   {ARM_FEATURE_CORE_LOW (ARM_EXT_V8),
2308     0x01b00e9f, 0x0ff00fff, "ldaexd%c\t%12-15r, %12-15T, [%16-19R]"},
2309   {ARM_FEATURE_CORE_LOW (ARM_EXT2_ATOMICS),
2310     0x01c00e90, 0x0ff00ff0, "stlexb%c\t%12-15r, %0-3r, [%16-19R]"},
2311   {ARM_FEATURE_CORE_LOW (ARM_EXT2_ATOMICS),
2312     0x01d00e9f, 0x0ff00fff, "ldaexb%c\t%12-15r, [%16-19R]"},
2313   {ARM_FEATURE_CORE_LOW (ARM_EXT2_ATOMICS),
2314     0x01e00e90, 0x0ff00ff0, "stlexh%c\t%12-15r, %0-3r, [%16-19R]"},
2315   {ARM_FEATURE_CORE_LOW (ARM_EXT2_ATOMICS),
2316     0x01f00e9f, 0x0ff00fff, "ldaexh%c\t%12-15r, [%16-19R]"},
2317   {ARM_FEATURE_CORE_LOW (ARM_EXT2_ATOMICS),
2318     0x0180fc90, 0x0ff0fff0, "stl%c\t%0-3r, [%16-19R]"},
2319   {ARM_FEATURE_CORE_LOW (ARM_EXT2_ATOMICS),
2320     0x01900c9f, 0x0ff00fff, "lda%c\t%12-15r, [%16-19R]"},
2321   {ARM_FEATURE_CORE_LOW (ARM_EXT2_ATOMICS),
2322     0x01c0fc90, 0x0ff0fff0, "stlb%c\t%0-3r, [%16-19R]"},
2323   {ARM_FEATURE_CORE_LOW (ARM_EXT2_ATOMICS),
2324     0x01d00c9f, 0x0ff00fff, "ldab%c\t%12-15r, [%16-19R]"},
2325   {ARM_FEATURE_CORE_LOW (ARM_EXT2_ATOMICS),
2326     0x01e0fc90, 0x0ff0fff0, "stlh%c\t%0-3r, [%16-19R]"},
2327   {ARM_FEATURE_CORE_LOW (ARM_EXT2_ATOMICS),
2328     0x01f00c9f, 0x0ff00fff, "ldah%c\t%12-15r, [%16-19R]"},
2329   /* CRC32 instructions.  */
2330   {ARM_FEATURE_COPROC (CRC_EXT_ARMV8),
2331     0xe1000040, 0xfff00ff0, "crc32b\t%12-15R, %16-19R, %0-3R"},
2332   {ARM_FEATURE_COPROC (CRC_EXT_ARMV8),
2333     0xe1200040, 0xfff00ff0, "crc32h\t%12-15R, %16-19R, %0-3R"},
2334   {ARM_FEATURE_COPROC (CRC_EXT_ARMV8),
2335     0xe1400040, 0xfff00ff0, "crc32w\t%12-15R, %16-19R, %0-3R"},
2336   {ARM_FEATURE_COPROC (CRC_EXT_ARMV8),
2337     0xe1000240, 0xfff00ff0, "crc32cb\t%12-15R, %16-19R, %0-3R"},
2338   {ARM_FEATURE_COPROC (CRC_EXT_ARMV8),
2339     0xe1200240, 0xfff00ff0, "crc32ch\t%12-15R, %16-19R, %0-3R"},
2340   {ARM_FEATURE_COPROC (CRC_EXT_ARMV8),
2341     0xe1400240, 0xfff00ff0, "crc32cw\t%12-15R, %16-19R, %0-3R"},
2342
2343   /* Privileged Access Never extension instructions.  */
2344   {ARM_FEATURE_CORE_HIGH (ARM_EXT2_PAN),
2345     0xf1100000, 0xfffffdff, "setpan\t#%9-9d"},
2346
2347   /* Virtualization Extension instructions.  */
2348   {ARM_FEATURE_CORE_LOW (ARM_EXT_VIRT), 0x0160006e, 0x0fffffff, "eret%c"},
2349   {ARM_FEATURE_CORE_LOW (ARM_EXT_VIRT), 0x01400070, 0x0ff000f0, "hvc%c\t%e"},
2350
2351   /* Integer Divide Extension instructions.  */
2352   {ARM_FEATURE_CORE_LOW (ARM_EXT_ADIV),
2353     0x0710f010, 0x0ff0f0f0, "sdiv%c\t%16-19r, %0-3r, %8-11r"},
2354   {ARM_FEATURE_CORE_LOW (ARM_EXT_ADIV),
2355     0x0730f010, 0x0ff0f0f0, "udiv%c\t%16-19r, %0-3r, %8-11r"},
2356
2357   /* MP Extension instructions.  */
2358   {ARM_FEATURE_CORE_LOW (ARM_EXT_MP), 0xf410f000, 0xfc70f000, "pldw\t%a"},
2359
2360   /* Speculation Barriers.  */
2361   {ARM_FEATURE_CORE_LOW (ARM_EXT_V3), 0xe320f014, 0xffffffff, "csdb"},
2362   {ARM_FEATURE_CORE_LOW (ARM_EXT_V3), 0xf57ff040, 0xffffffff, "ssbb"},
2363   {ARM_FEATURE_CORE_LOW (ARM_EXT_V3), 0xf57ff044, 0xffffffff, "pssbb"},
2364
2365   /* V7 instructions.  */
2366   {ARM_FEATURE_CORE_LOW (ARM_EXT_V7), 0xf450f000, 0xfd70f000, "pli\t%P"},
2367   {ARM_FEATURE_CORE_LOW (ARM_EXT_V7), 0x0320f0f0, 0x0ffffff0, "dbg%c\t#%0-3d"},
2368   {ARM_FEATURE_CORE_LOW (ARM_EXT_V8), 0xf57ff051, 0xfffffff3, "dmb\t%U"},
2369   {ARM_FEATURE_CORE_LOW (ARM_EXT_V8), 0xf57ff041, 0xfffffff3, "dsb\t%U"},
2370   {ARM_FEATURE_CORE_LOW (ARM_EXT_V7), 0xf57ff050, 0xfffffff0, "dmb\t%U"},
2371   {ARM_FEATURE_CORE_LOW (ARM_EXT_V7), 0xf57ff040, 0xfffffff0, "dsb\t%U"},
2372   {ARM_FEATURE_CORE_LOW (ARM_EXT_V7), 0xf57ff060, 0xfffffff0, "isb\t%U"},
2373    {ARM_FEATURE_CORE_LOW (ARM_EXT_V7),
2374     0x0320f000, 0x0fffffff, "nop%c\t{%0-7d}"},
2375
2376   /* ARM V6T2 instructions.  */
2377   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
2378     0x07c0001f, 0x0fe0007f, "bfc%c\t%12-15R, %E"},
2379   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
2380     0x07c00010, 0x0fe00070, "bfi%c\t%12-15R, %0-3r, %E"},
2381   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
2382     0x00600090, 0x0ff000f0, "mls%c\t%16-19R, %0-3R, %8-11R, %12-15R"},
2383   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
2384     0x002000b0, 0x0f3000f0, "strht%c\t%12-15R, %S"},
2385
2386   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
2387     0x00300090, 0x0f3000f0, UNDEFINED_INSTRUCTION },
2388   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
2389     0x00300090, 0x0f300090, "ldr%6's%5?hbt%c\t%12-15R, %S"},
2390
2391   {ARM_FEATURE_CORE_HIGH (ARM_EXT2_V6T2_V8M),
2392     0x03000000, 0x0ff00000, "movw%c\t%12-15R, %V"},
2393   {ARM_FEATURE_CORE_HIGH (ARM_EXT2_V6T2_V8M),
2394     0x03400000, 0x0ff00000, "movt%c\t%12-15R, %V"},
2395   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
2396     0x06ff0f30, 0x0fff0ff0, "rbit%c\t%12-15R, %0-3R"},
2397   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
2398     0x07a00050, 0x0fa00070, "%22?usbfx%c\t%12-15r, %0-3r, #%7-11d, #%16-20W"},
2399
2400   /* ARM Security extension instructions.  */
2401   {ARM_FEATURE_CORE_LOW (ARM_EXT_SEC),
2402     0x01600070, 0x0ff000f0, "smc%c\t%e"},
2403
2404   /* ARM V6K instructions.  */
2405   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6K),
2406     0xf57ff01f, 0xffffffff, "clrex"},
2407   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6K),
2408     0x01d00f9f, 0x0ff00fff, "ldrexb%c\t%12-15R, [%16-19R]"},
2409   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6K),
2410     0x01b00f9f, 0x0ff00fff, "ldrexd%c\t%12-15r, [%16-19R]"},
2411   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6K),
2412     0x01f00f9f, 0x0ff00fff, "ldrexh%c\t%12-15R, [%16-19R]"},
2413   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6K),
2414     0x01c00f90, 0x0ff00ff0, "strexb%c\t%12-15R, %0-3R, [%16-19R]"},
2415   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6K),
2416     0x01a00f90, 0x0ff00ff0, "strexd%c\t%12-15R, %0-3r, [%16-19R]"},
2417   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6K),
2418     0x01e00f90, 0x0ff00ff0, "strexh%c\t%12-15R, %0-3R, [%16-19R]"},
2419
2420   /* ARMv8.5-A instructions.  */
2421   {ARM_FEATURE_CORE_HIGH (ARM_EXT2_SB), 0xf57ff070, 0xffffffff, "sb"},
2422
2423   /* ARM V6K NOP hints.  */
2424   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6K),
2425     0x0320f001, 0x0fffffff, "yield%c"},
2426   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6K),
2427     0x0320f002, 0x0fffffff, "wfe%c"},
2428   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6K),
2429     0x0320f003, 0x0fffffff, "wfi%c"},
2430   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6K),
2431     0x0320f004, 0x0fffffff, "sev%c"},
2432   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6K),
2433     0x0320f000, 0x0fffff00, "nop%c\t{%0-7d}"},
2434
2435   /* ARM V6 instructions.  */
2436   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
2437     0xf1080000, 0xfffffe3f, "cpsie\t%8'a%7'i%6'f"},
2438   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
2439     0xf10a0000, 0xfffffe20, "cpsie\t%8'a%7'i%6'f,#%0-4d"},
2440   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
2441     0xf10C0000, 0xfffffe3f, "cpsid\t%8'a%7'i%6'f"},
2442   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
2443     0xf10e0000, 0xfffffe20, "cpsid\t%8'a%7'i%6'f,#%0-4d"},
2444   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
2445     0xf1000000, 0xfff1fe20, "cps\t#%0-4d"},
2446   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
2447     0x06800010, 0x0ff00ff0, "pkhbt%c\t%12-15R, %16-19R, %0-3R"},
2448   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
2449     0x06800010, 0x0ff00070, "pkhbt%c\t%12-15R, %16-19R, %0-3R, lsl #%7-11d"},
2450   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
2451     0x06800050, 0x0ff00ff0, "pkhtb%c\t%12-15R, %16-19R, %0-3R, asr #32"},
2452   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
2453     0x06800050, 0x0ff00070, "pkhtb%c\t%12-15R, %16-19R, %0-3R, asr #%7-11d"},
2454   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
2455     0x01900f9f, 0x0ff00fff, "ldrex%c\tr%12-15d, [%16-19R]"},
2456   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
2457     0x06200f10, 0x0ff00ff0, "qadd16%c\t%12-15R, %16-19R, %0-3R"},
2458   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
2459     0x06200f90, 0x0ff00ff0, "qadd8%c\t%12-15R, %16-19R, %0-3R"},
2460   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
2461     0x06200f30, 0x0ff00ff0, "qasx%c\t%12-15R, %16-19R, %0-3R"},
2462   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
2463     0x06200f70, 0x0ff00ff0, "qsub16%c\t%12-15R, %16-19R, %0-3R"},
2464   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
2465     0x06200ff0, 0x0ff00ff0, "qsub8%c\t%12-15R, %16-19R, %0-3R"},
2466   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
2467     0x06200f50, 0x0ff00ff0, "qsax%c\t%12-15R, %16-19R, %0-3R"},
2468   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
2469     0x06100f10, 0x0ff00ff0, "sadd16%c\t%12-15R, %16-19R, %0-3R"},
2470   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
2471     0x06100f90, 0x0ff00ff0, "sadd8%c\t%12-15R, %16-19R, %0-3R"},
2472   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
2473     0x06100f30, 0x0ff00ff0, "sasx%c\t%12-15R, %16-19R, %0-3R"},
2474   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
2475     0x06300f10, 0x0ff00ff0, "shadd16%c\t%12-15R, %16-19R, %0-3R"},
2476   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
2477     0x06300f90, 0x0ff00ff0, "shadd8%c\t%12-15R, %16-19R, %0-3R"},
2478   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
2479     0x06300f30, 0x0ff00ff0, "shasx%c\t%12-15R, %16-19R, %0-3R"},
2480   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
2481     0x06300f70, 0x0ff00ff0, "shsub16%c\t%12-15R, %16-19R, %0-3R"},
2482   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
2483     0x06300ff0, 0x0ff00ff0, "shsub8%c\t%12-15R, %16-19R, %0-3R"},
2484   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
2485     0x06300f50, 0x0ff00ff0, "shsax%c\t%12-15R, %16-19R, %0-3R"},
2486   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
2487     0x06100f70, 0x0ff00ff0, "ssub16%c\t%12-15R, %16-19R, %0-3R"},
2488   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
2489     0x06100ff0, 0x0ff00ff0, "ssub8%c\t%12-15R, %16-19R, %0-3R"},
2490   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
2491     0x06100f50, 0x0ff00ff0, "ssax%c\t%12-15R, %16-19R, %0-3R"},
2492   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
2493     0x06500f10, 0x0ff00ff0, "uadd16%c\t%12-15R, %16-19R, %0-3R"},
2494   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
2495     0x06500f90, 0x0ff00ff0, "uadd8%c\t%12-15R, %16-19R, %0-3R"},
2496   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
2497     0x06500f30, 0x0ff00ff0, "uasx%c\t%12-15R, %16-19R, %0-3R"},
2498   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
2499     0x06700f10, 0x0ff00ff0, "uhadd16%c\t%12-15R, %16-19R, %0-3R"},
2500   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
2501     0x06700f90, 0x0ff00ff0, "uhadd8%c\t%12-15R, %16-19R, %0-3R"},
2502   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
2503     0x06700f30, 0x0ff00ff0, "uhasx%c\t%12-15R, %16-19R, %0-3R"},
2504   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
2505     0x06700f70, 0x0ff00ff0, "uhsub16%c\t%12-15R, %16-19R, %0-3R"},
2506   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
2507     0x06700ff0, 0x0ff00ff0, "uhsub8%c\t%12-15R, %16-19R, %0-3R"},
2508   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
2509     0x06700f50, 0x0ff00ff0, "uhsax%c\t%12-15R, %16-19R, %0-3R"},
2510   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
2511     0x06600f10, 0x0ff00ff0, "uqadd16%c\t%12-15R, %16-19R, %0-3R"},
2512   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
2513     0x06600f90, 0x0ff00ff0, "uqadd8%c\t%12-15R, %16-19R, %0-3R"},
2514   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
2515     0x06600f30, 0x0ff00ff0, "uqasx%c\t%12-15R, %16-19R, %0-3R"},
2516   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
2517     0x06600f70, 0x0ff00ff0, "uqsub16%c\t%12-15R, %16-19R, %0-3R"},
2518   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
2519     0x06600ff0, 0x0ff00ff0, "uqsub8%c\t%12-15R, %16-19R, %0-3R"},
2520   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
2521     0x06600f50, 0x0ff00ff0, "uqsax%c\t%12-15R, %16-19R, %0-3R"},
2522   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
2523     0x06500f70, 0x0ff00ff0, "usub16%c\t%12-15R, %16-19R, %0-3R"},
2524   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
2525     0x06500ff0, 0x0ff00ff0, "usub8%c\t%12-15R, %16-19R, %0-3R"},
2526   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
2527     0x06500f50, 0x0ff00ff0, "usax%c\t%12-15R, %16-19R, %0-3R"},
2528   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
2529     0x06bf0f30, 0x0fff0ff0, "rev%c\t%12-15R, %0-3R"},
2530   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
2531     0x06bf0fb0, 0x0fff0ff0, "rev16%c\t%12-15R, %0-3R"},
2532   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
2533     0x06ff0fb0, 0x0fff0ff0, "revsh%c\t%12-15R, %0-3R"},
2534   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
2535     0xf8100a00, 0xfe50ffff, "rfe%23?id%24?ba\t%16-19r%21'!"},
2536   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
2537     0x06bf0070, 0x0fff0ff0, "sxth%c\t%12-15R, %0-3R"},
2538   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
2539     0x06bf0470, 0x0fff0ff0, "sxth%c\t%12-15R, %0-3R, ror #8"},
2540   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
2541     0x06bf0870, 0x0fff0ff0, "sxth%c\t%12-15R, %0-3R, ror #16"},
2542   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
2543     0x06bf0c70, 0x0fff0ff0, "sxth%c\t%12-15R, %0-3R, ror #24"},
2544   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
2545     0x068f0070, 0x0fff0ff0, "sxtb16%c\t%12-15R, %0-3R"},
2546   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
2547     0x068f0470, 0x0fff0ff0, "sxtb16%c\t%12-15R, %0-3R, ror #8"},
2548   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
2549     0x068f0870, 0x0fff0ff0, "sxtb16%c\t%12-15R, %0-3R, ror #16"},
2550   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
2551     0x068f0c70, 0x0fff0ff0, "sxtb16%c\t%12-15R, %0-3R, ror #24"},
2552   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
2553     0x06af0070, 0x0fff0ff0, "sxtb%c\t%12-15R, %0-3R"},
2554   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
2555     0x06af0470, 0x0fff0ff0, "sxtb%c\t%12-15R, %0-3R, ror #8"},
2556   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
2557     0x06af0870, 0x0fff0ff0, "sxtb%c\t%12-15R, %0-3R, ror #16"},
2558   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
2559     0x06af0c70, 0x0fff0ff0, "sxtb%c\t%12-15R, %0-3R, ror #24"},
2560   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
2561     0x06ff0070, 0x0fff0ff0, "uxth%c\t%12-15R, %0-3R"},
2562   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
2563     0x06ff0470, 0x0fff0ff0, "uxth%c\t%12-15R, %0-3R, ror #8"},
2564   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
2565     0x06ff0870, 0x0fff0ff0, "uxth%c\t%12-15R, %0-3R, ror #16"},
2566   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
2567     0x06ff0c70, 0x0fff0ff0, "uxth%c\t%12-15R, %0-3R, ror #24"},
2568   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
2569     0x06cf0070, 0x0fff0ff0, "uxtb16%c\t%12-15R, %0-3R"},
2570   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
2571     0x06cf0470, 0x0fff0ff0, "uxtb16%c\t%12-15R, %0-3R, ror #8"},
2572   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
2573     0x06cf0870, 0x0fff0ff0, "uxtb16%c\t%12-15R, %0-3R, ror #16"},
2574   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
2575     0x06cf0c70, 0x0fff0ff0, "uxtb16%c\t%12-15R, %0-3R, ror #24"},
2576   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
2577     0x06ef0070, 0x0fff0ff0, "uxtb%c\t%12-15R, %0-3R"},
2578   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
2579     0x06ef0470, 0x0fff0ff0, "uxtb%c\t%12-15R, %0-3R, ror #8"},
2580   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
2581     0x06ef0870, 0x0fff0ff0, "uxtb%c\t%12-15R, %0-3R, ror #16"},
2582   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
2583     0x06ef0c70, 0x0fff0ff0, "uxtb%c\t%12-15R, %0-3R, ror #24"},
2584   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
2585     0x06b00070, 0x0ff00ff0, "sxtah%c\t%12-15R, %16-19r, %0-3R"},
2586   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
2587     0x06b00470, 0x0ff00ff0, "sxtah%c\t%12-15R, %16-19r, %0-3R, ror #8"},
2588   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
2589     0x06b00870, 0x0ff00ff0, "sxtah%c\t%12-15R, %16-19r, %0-3R, ror #16"},
2590   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
2591     0x06b00c70, 0x0ff00ff0, "sxtah%c\t%12-15R, %16-19r, %0-3R, ror #24"},
2592   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
2593     0x06800070, 0x0ff00ff0, "sxtab16%c\t%12-15R, %16-19r, %0-3R"},
2594   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
2595     0x06800470, 0x0ff00ff0, "sxtab16%c\t%12-15R, %16-19r, %0-3R, ror #8"},
2596   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
2597     0x06800870, 0x0ff00ff0, "sxtab16%c\t%12-15R, %16-19r, %0-3R, ror #16"},
2598   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
2599     0x06800c70, 0x0ff00ff0, "sxtab16%c\t%12-15R, %16-19r, %0-3R, ror #24"},
2600   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
2601     0x06a00070, 0x0ff00ff0, "sxtab%c\t%12-15R, %16-19r, %0-3R"},
2602   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
2603     0x06a00470, 0x0ff00ff0, "sxtab%c\t%12-15R, %16-19r, %0-3R, ror #8"},
2604   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
2605     0x06a00870, 0x0ff00ff0, "sxtab%c\t%12-15R, %16-19r, %0-3R, ror #16"},
2606   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
2607     0x06a00c70, 0x0ff00ff0, "sxtab%c\t%12-15R, %16-19r, %0-3R, ror #24"},
2608   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
2609     0x06f00070, 0x0ff00ff0, "uxtah%c\t%12-15R, %16-19r, %0-3R"},
2610   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
2611     0x06f00470, 0x0ff00ff0, "uxtah%c\t%12-15R, %16-19r, %0-3R, ror #8"},
2612   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
2613     0x06f00870, 0x0ff00ff0, "uxtah%c\t%12-15R, %16-19r, %0-3R, ror #16"},
2614   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
2615     0x06f00c70, 0x0ff00ff0, "uxtah%c\t%12-15R, %16-19r, %0-3R, ror #24"},
2616   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
2617     0x06c00070, 0x0ff00ff0, "uxtab16%c\t%12-15R, %16-19r, %0-3R"},
2618   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
2619     0x06c00470, 0x0ff00ff0, "uxtab16%c\t%12-15R, %16-19r, %0-3R, ror #8"},
2620   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
2621     0x06c00870, 0x0ff00ff0, "uxtab16%c\t%12-15R, %16-19r, %0-3R, ror #16"},
2622   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
2623     0x06c00c70, 0x0ff00ff0, "uxtab16%c\t%12-15R, %16-19r, %0-3R, ROR #24"},
2624   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
2625     0x06e00070, 0x0ff00ff0, "uxtab%c\t%12-15R, %16-19r, %0-3R"},
2626   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
2627     0x06e00470, 0x0ff00ff0, "uxtab%c\t%12-15R, %16-19r, %0-3R, ror #8"},
2628   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
2629     0x06e00870, 0x0ff00ff0, "uxtab%c\t%12-15R, %16-19r, %0-3R, ror #16"},
2630   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
2631     0x06e00c70, 0x0ff00ff0, "uxtab%c\t%12-15R, %16-19r, %0-3R, ror #24"},
2632   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
2633     0x06800fb0, 0x0ff00ff0, "sel%c\t%12-15R, %16-19R, %0-3R"},
2634   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
2635     0xf1010000, 0xfffffc00, "setend\t%9?ble"},
2636   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
2637     0x0700f010, 0x0ff0f0d0, "smuad%5'x%c\t%16-19R, %0-3R, %8-11R"},
2638   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
2639     0x0700f050, 0x0ff0f0d0, "smusd%5'x%c\t%16-19R, %0-3R, %8-11R"},
2640   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
2641     0x07000010, 0x0ff000d0, "smlad%5'x%c\t%16-19R, %0-3R, %8-11R, %12-15R"},
2642   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
2643     0x07400010, 0x0ff000d0, "smlald%5'x%c\t%12-15Ru, %16-19Ru, %0-3R, %8-11R"},
2644   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
2645     0x07000050, 0x0ff000d0, "smlsd%5'x%c\t%16-19R, %0-3R, %8-11R, %12-15R"},
2646   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
2647     0x07400050, 0x0ff000d0, "smlsld%5'x%c\t%12-15Ru, %16-19Ru, %0-3R, %8-11R"},
2648   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
2649     0x0750f010, 0x0ff0f0d0, "smmul%5'r%c\t%16-19R, %0-3R, %8-11R"},
2650   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
2651     0x07500010, 0x0ff000d0, "smmla%5'r%c\t%16-19R, %0-3R, %8-11R, %12-15R"},
2652   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
2653     0x075000d0, 0x0ff000d0, "smmls%5'r%c\t%16-19R, %0-3R, %8-11R, %12-15R"},
2654   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
2655     0xf84d0500, 0xfe5fffe0, "srs%23?id%24?ba\t%16-19r%21'!, #%0-4d"},
2656   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
2657     0x06a00010, 0x0fe00ff0, "ssat%c\t%12-15R, #%16-20W, %0-3R"},
2658   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
2659     0x06a00010, 0x0fe00070, "ssat%c\t%12-15R, #%16-20W, %0-3R, lsl #%7-11d"},
2660   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
2661     0x06a00050, 0x0fe00070, "ssat%c\t%12-15R, #%16-20W, %0-3R, asr #%7-11d"},
2662   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
2663     0x06a00f30, 0x0ff00ff0, "ssat16%c\t%12-15r, #%16-19W, %0-3r"},
2664   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
2665     0x01800f90, 0x0ff00ff0, "strex%c\t%12-15R, %0-3R, [%16-19R]"},
2666   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
2667     0x00400090, 0x0ff000f0, "umaal%c\t%12-15R, %16-19R, %0-3R, %8-11R"},
2668   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
2669     0x0780f010, 0x0ff0f0f0, "usad8%c\t%16-19R, %0-3R, %8-11R"},
2670   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
2671     0x07800010, 0x0ff000f0, "usada8%c\t%16-19R, %0-3R, %8-11R, %12-15R"},
2672   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
2673     0x06e00010, 0x0fe00ff0, "usat%c\t%12-15R, #%16-20d, %0-3R"},
2674   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
2675     0x06e00010, 0x0fe00070, "usat%c\t%12-15R, #%16-20d, %0-3R, lsl #%7-11d"},
2676   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
2677     0x06e00050, 0x0fe00070, "usat%c\t%12-15R, #%16-20d, %0-3R, asr #%7-11d"},
2678   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6),
2679     0x06e00f30, 0x0ff00ff0, "usat16%c\t%12-15R, #%16-19d, %0-3R"},
2680
2681   /* V5J instruction.  */
2682   {ARM_FEATURE_CORE_LOW (ARM_EXT_V5J),
2683     0x012fff20, 0x0ffffff0, "bxj%c\t%0-3R"},
2684
2685   /* V5 Instructions.  */
2686   {ARM_FEATURE_CORE_LOW (ARM_EXT_V5),
2687     0xe1200070, 0xfff000f0,
2688     "bkpt\t0x%16-19X%12-15X%8-11X%0-3X"},
2689   {ARM_FEATURE_CORE_LOW (ARM_EXT_V5),
2690     0xfa000000, 0xfe000000, "blx\t%B"},
2691   {ARM_FEATURE_CORE_LOW (ARM_EXT_V5),
2692     0x012fff30, 0x0ffffff0, "blx%c\t%0-3R"},
2693   {ARM_FEATURE_CORE_LOW (ARM_EXT_V5),
2694     0x016f0f10, 0x0fff0ff0, "clz%c\t%12-15R, %0-3R"},
2695
2696   /* V5E "El Segundo" Instructions.  */
2697   {ARM_FEATURE_CORE_LOW (ARM_EXT_V5E),
2698     0x000000d0, 0x0e1000f0, "ldrd%c\t%12-15r, %s"},
2699   {ARM_FEATURE_CORE_LOW (ARM_EXT_V5E),
2700     0x000000f0, 0x0e1000f0, "strd%c\t%12-15r, %s"},
2701   {ARM_FEATURE_CORE_LOW (ARM_EXT_V5E),
2702     0xf450f000, 0xfc70f000, "pld\t%a"},
2703   {ARM_FEATURE_CORE_LOW (ARM_EXT_V5ExP),
2704     0x01000080, 0x0ff000f0, "smlabb%c\t%16-19R, %0-3R, %8-11R, %12-15R"},
2705   {ARM_FEATURE_CORE_LOW (ARM_EXT_V5ExP),
2706     0x010000a0, 0x0ff000f0, "smlatb%c\t%16-19R, %0-3R, %8-11R, %12-15R"},
2707   {ARM_FEATURE_CORE_LOW (ARM_EXT_V5ExP),
2708     0x010000c0, 0x0ff000f0, "smlabt%c\t%16-19R, %0-3R, %8-11R, %12-15R"},
2709   {ARM_FEATURE_CORE_LOW (ARM_EXT_V5ExP),
2710     0x010000e0, 0x0ff000f0, "smlatt%c\t%16-19r, %0-3r, %8-11R, %12-15R"},
2711
2712   {ARM_FEATURE_CORE_LOW (ARM_EXT_V5ExP),
2713     0x01200080, 0x0ff000f0, "smlawb%c\t%16-19R, %0-3R, %8-11R, %12-15R"},
2714   {ARM_FEATURE_CORE_LOW (ARM_EXT_V5ExP),
2715     0x012000c0, 0x0ff000f0, "smlawt%c\t%16-19R, %0-3r, %8-11R, %12-15R"},
2716
2717   {ARM_FEATURE_CORE_LOW (ARM_EXT_V5ExP),
2718     0x01400080, 0x0ff000f0, "smlalbb%c\t%12-15Ru, %16-19Ru, %0-3R, %8-11R"},
2719   {ARM_FEATURE_CORE_LOW (ARM_EXT_V5ExP),
2720     0x014000a0, 0x0ff000f0, "smlaltb%c\t%12-15Ru, %16-19Ru, %0-3R, %8-11R"},
2721   {ARM_FEATURE_CORE_LOW (ARM_EXT_V5ExP),
2722     0x014000c0, 0x0ff000f0, "smlalbt%c\t%12-15Ru, %16-19Ru, %0-3R, %8-11R"},
2723   {ARM_FEATURE_CORE_LOW (ARM_EXT_V5ExP),
2724     0x014000e0, 0x0ff000f0, "smlaltt%c\t%12-15Ru, %16-19Ru, %0-3R, %8-11R"},
2725
2726   {ARM_FEATURE_CORE_LOW (ARM_EXT_V5ExP),
2727     0x01600080, 0x0ff0f0f0, "smulbb%c\t%16-19R, %0-3R, %8-11R"},
2728   {ARM_FEATURE_CORE_LOW (ARM_EXT_V5ExP),
2729     0x016000a0, 0x0ff0f0f0, "smultb%c\t%16-19R, %0-3R, %8-11R"},
2730   {ARM_FEATURE_CORE_LOW (ARM_EXT_V5ExP),
2731     0x016000c0, 0x0ff0f0f0, "smulbt%c\t%16-19R, %0-3R, %8-11R"},
2732   {ARM_FEATURE_CORE_LOW (ARM_EXT_V5ExP),
2733     0x016000e0, 0x0ff0f0f0, "smultt%c\t%16-19R, %0-3R, %8-11R"},
2734
2735   {ARM_FEATURE_CORE_LOW (ARM_EXT_V5ExP),
2736     0x012000a0, 0x0ff0f0f0, "smulwb%c\t%16-19R, %0-3R, %8-11R"},
2737   {ARM_FEATURE_CORE_LOW (ARM_EXT_V5ExP),
2738     0x012000e0, 0x0ff0f0f0, "smulwt%c\t%16-19R, %0-3R, %8-11R"},
2739
2740   {ARM_FEATURE_CORE_LOW (ARM_EXT_V5ExP),
2741     0x01000050, 0x0ff00ff0,  "qadd%c\t%12-15R, %0-3R, %16-19R"},
2742   {ARM_FEATURE_CORE_LOW (ARM_EXT_V5ExP),
2743     0x01400050, 0x0ff00ff0, "qdadd%c\t%12-15R, %0-3R, %16-19R"},
2744   {ARM_FEATURE_CORE_LOW (ARM_EXT_V5ExP),
2745     0x01200050, 0x0ff00ff0,  "qsub%c\t%12-15R, %0-3R, %16-19R"},
2746   {ARM_FEATURE_CORE_LOW (ARM_EXT_V5ExP),
2747     0x01600050, 0x0ff00ff0, "qdsub%c\t%12-15R, %0-3R, %16-19R"},
2748
2749   /* ARM Instructions.  */
2750   {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
2751     0x052d0004, 0x0fff0fff, "push%c\t{%12-15r}\t\t; (str%c %12-15r, %a)"},
2752
2753   {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
2754     0x04400000, 0x0e500000, "strb%t%c\t%12-15R, %a"},
2755   {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
2756     0x04000000, 0x0e500000, "str%t%c\t%12-15r, %a"},
2757   {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
2758     0x06400000, 0x0e500ff0, "strb%t%c\t%12-15R, %a"},
2759   {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
2760     0x06000000, 0x0e500ff0, "str%t%c\t%12-15r, %a"},
2761   {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
2762     0x04400000, 0x0c500010, "strb%t%c\t%12-15R, %a"},
2763   {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
2764     0x04000000, 0x0c500010, "str%t%c\t%12-15r, %a"},
2765
2766   {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
2767     0x04400000, 0x0e500000, "strb%c\t%12-15R, %a"},
2768   {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
2769     0x06400000, 0x0e500010, "strb%c\t%12-15R, %a"},
2770   {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
2771     0x004000b0, 0x0e5000f0, "strh%c\t%12-15R, %s"},
2772   {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
2773     0x000000b0, 0x0e500ff0, "strh%c\t%12-15R, %s"},
2774
2775   {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
2776     0x00500090, 0x0e5000f0, UNDEFINED_INSTRUCTION},
2777   {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
2778     0x00500090, 0x0e500090, "ldr%6's%5?hb%c\t%12-15R, %s"},
2779   {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
2780     0x00100090, 0x0e500ff0, UNDEFINED_INSTRUCTION},
2781   {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
2782     0x00100090, 0x0e500f90, "ldr%6's%5?hb%c\t%12-15R, %s"},
2783
2784   {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
2785     0x02000000, 0x0fe00000, "and%20's%c\t%12-15r, %16-19r, %o"},
2786   {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
2787     0x00000000, 0x0fe00010, "and%20's%c\t%12-15r, %16-19r, %o"},
2788   {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
2789     0x00000010, 0x0fe00090, "and%20's%c\t%12-15R, %16-19R, %o"},
2790
2791   {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
2792     0x02200000, 0x0fe00000, "eor%20's%c\t%12-15r, %16-19r, %o"},
2793   {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
2794     0x00200000, 0x0fe00010, "eor%20's%c\t%12-15r, %16-19r, %o"},
2795   {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
2796     0x00200010, 0x0fe00090, "eor%20's%c\t%12-15R, %16-19R, %o"},
2797
2798   {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
2799     0x02400000, 0x0fe00000, "sub%20's%c\t%12-15r, %16-19r, %o"},
2800   {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
2801     0x00400000, 0x0fe00010, "sub%20's%c\t%12-15r, %16-19r, %o"},
2802   {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
2803     0x00400010, 0x0fe00090, "sub%20's%c\t%12-15R, %16-19R, %o"},
2804
2805   {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
2806     0x02600000, 0x0fe00000, "rsb%20's%c\t%12-15r, %16-19r, %o"},
2807   {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
2808     0x00600000, 0x0fe00010, "rsb%20's%c\t%12-15r, %16-19r, %o"},
2809   {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
2810     0x00600010, 0x0fe00090, "rsb%20's%c\t%12-15R, %16-19R, %o"},
2811
2812   {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
2813     0x02800000, 0x0fe00000, "add%20's%c\t%12-15r, %16-19r, %o"},
2814   {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
2815     0x00800000, 0x0fe00010, "add%20's%c\t%12-15r, %16-19r, %o"},
2816   {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
2817     0x00800010, 0x0fe00090, "add%20's%c\t%12-15R, %16-19R, %o"},
2818
2819   {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
2820     0x02a00000, 0x0fe00000, "adc%20's%c\t%12-15r, %16-19r, %o"},
2821   {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
2822     0x00a00000, 0x0fe00010, "adc%20's%c\t%12-15r, %16-19r, %o"},
2823   {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
2824     0x00a00010, 0x0fe00090, "adc%20's%c\t%12-15R, %16-19R, %o"},
2825
2826   {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
2827     0x02c00000, 0x0fe00000, "sbc%20's%c\t%12-15r, %16-19r, %o"},
2828   {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
2829     0x00c00000, 0x0fe00010, "sbc%20's%c\t%12-15r, %16-19r, %o"},
2830   {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
2831     0x00c00010, 0x0fe00090, "sbc%20's%c\t%12-15R, %16-19R, %o"},
2832
2833   {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
2834     0x02e00000, 0x0fe00000, "rsc%20's%c\t%12-15r, %16-19r, %o"},
2835   {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
2836     0x00e00000, 0x0fe00010, "rsc%20's%c\t%12-15r, %16-19r, %o"},
2837   {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
2838     0x00e00010, 0x0fe00090, "rsc%20's%c\t%12-15R, %16-19R, %o"},
2839
2840   {ARM_FEATURE_CORE_LOW (ARM_EXT_VIRT),
2841     0x0120f200, 0x0fb0f200, "msr%c\t%C, %0-3r"},
2842   {ARM_FEATURE_CORE_LOW (ARM_EXT_V3),
2843     0x0120f000, 0x0db0f000, "msr%c\t%C, %o"},
2844   {ARM_FEATURE_CORE_LOW (ARM_EXT_V3),
2845     0x01000000, 0x0fb00cff, "mrs%c\t%12-15R, %R"},
2846
2847   {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
2848     0x03000000, 0x0fe00000, "tst%p%c\t%16-19r, %o"},
2849   {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
2850     0x01000000, 0x0fe00010, "tst%p%c\t%16-19r, %o"},
2851   {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
2852     0x01000010, 0x0fe00090, "tst%p%c\t%16-19R, %o"},
2853
2854   {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
2855     0x03300000, 0x0ff00000, "teq%p%c\t%16-19r, %o"},
2856   {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
2857     0x01300000, 0x0ff00010, "teq%p%c\t%16-19r, %o"},
2858   {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
2859     0x01300010, 0x0ff00010, "teq%p%c\t%16-19R, %o"},
2860
2861   {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
2862     0x03400000, 0x0fe00000, "cmp%p%c\t%16-19r, %o"},
2863   {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
2864     0x01400000, 0x0fe00010, "cmp%p%c\t%16-19r, %o"},
2865   {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
2866     0x01400010, 0x0fe00090, "cmp%p%c\t%16-19R, %o"},
2867
2868   {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
2869     0x03600000, 0x0fe00000, "cmn%p%c\t%16-19r, %o"},
2870   {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
2871     0x01600000, 0x0fe00010, "cmn%p%c\t%16-19r, %o"},
2872   {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
2873     0x01600010, 0x0fe00090, "cmn%p%c\t%16-19R, %o"},
2874
2875   {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
2876     0x03800000, 0x0fe00000, "orr%20's%c\t%12-15r, %16-19r, %o"},
2877   {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
2878     0x01800000, 0x0fe00010, "orr%20's%c\t%12-15r, %16-19r, %o"},
2879   {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
2880     0x01800010, 0x0fe00090, "orr%20's%c\t%12-15R, %16-19R, %o"},
2881
2882   {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
2883     0x03a00000, 0x0fef0000, "mov%20's%c\t%12-15r, %o"},
2884   {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
2885     0x01a00000, 0x0def0ff0, "mov%20's%c\t%12-15r, %0-3r"},
2886   {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
2887     0x01a00000, 0x0def0060, "lsl%20's%c\t%12-15R, %q"},
2888   {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
2889     0x01a00020, 0x0def0060, "lsr%20's%c\t%12-15R, %q"},
2890   {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
2891     0x01a00040, 0x0def0060, "asr%20's%c\t%12-15R, %q"},
2892   {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
2893     0x01a00060, 0x0def0ff0, "rrx%20's%c\t%12-15r, %0-3r"},
2894   {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
2895     0x01a00060, 0x0def0060, "ror%20's%c\t%12-15R, %q"},
2896
2897   {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
2898     0x03c00000, 0x0fe00000, "bic%20's%c\t%12-15r, %16-19r, %o"},
2899   {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
2900     0x01c00000, 0x0fe00010, "bic%20's%c\t%12-15r, %16-19r, %o"},
2901   {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
2902     0x01c00010, 0x0fe00090, "bic%20's%c\t%12-15R, %16-19R, %o"},
2903
2904   {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
2905     0x03e00000, 0x0fe00000, "mvn%20's%c\t%12-15r, %o"},
2906   {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
2907     0x01e00000, 0x0fe00010, "mvn%20's%c\t%12-15r, %o"},
2908   {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
2909     0x01e00010, 0x0fe00090, "mvn%20's%c\t%12-15R, %o"},
2910
2911   {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
2912     0x06000010, 0x0e000010, UNDEFINED_INSTRUCTION},
2913   {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
2914     0x049d0004, 0x0fff0fff, "pop%c\t{%12-15r}\t\t; (ldr%c %12-15r, %a)"},
2915
2916   {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
2917     0x04500000, 0x0c500000, "ldrb%t%c\t%12-15R, %a"},
2918
2919   {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
2920     0x04300000, 0x0d700000, "ldrt%c\t%12-15R, %a"},
2921   {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
2922     0x04100000, 0x0c500000, "ldr%c\t%12-15r, %a"},
2923
2924   {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
2925     0x092d0001, 0x0fffffff, "stmfd%c\t%16-19R!, %m"},
2926   {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
2927     0x092d0002, 0x0fffffff, "stmfd%c\t%16-19R!, %m"},
2928   {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
2929     0x092d0004, 0x0fffffff, "stmfd%c\t%16-19R!, %m"},
2930   {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
2931     0x092d0008, 0x0fffffff, "stmfd%c\t%16-19R!, %m"},
2932   {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
2933     0x092d0010, 0x0fffffff, "stmfd%c\t%16-19R!, %m"},
2934   {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
2935     0x092d0020, 0x0fffffff, "stmfd%c\t%16-19R!, %m"},
2936   {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
2937     0x092d0040, 0x0fffffff, "stmfd%c\t%16-19R!, %m"},
2938   {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
2939     0x092d0080, 0x0fffffff, "stmfd%c\t%16-19R!, %m"},
2940   {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
2941     0x092d0100, 0x0fffffff, "stmfd%c\t%16-19R!, %m"},
2942   {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
2943     0x092d0200, 0x0fffffff, "stmfd%c\t%16-19R!, %m"},
2944   {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
2945     0x092d0400, 0x0fffffff, "stmfd%c\t%16-19R!, %m"},
2946   {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
2947     0x092d0800, 0x0fffffff, "stmfd%c\t%16-19R!, %m"},
2948   {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
2949     0x092d1000, 0x0fffffff, "stmfd%c\t%16-19R!, %m"},
2950   {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
2951     0x092d2000, 0x0fffffff, "stmfd%c\t%16-19R!, %m"},
2952   {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
2953     0x092d4000, 0x0fffffff, "stmfd%c\t%16-19R!, %m"},
2954   {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
2955     0x092d8000, 0x0fffffff, "stmfd%c\t%16-19R!, %m"},
2956   {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
2957     0x092d0000, 0x0fff0000, "push%c\t%m"},
2958   {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
2959     0x08800000, 0x0ff00000, "stm%c\t%16-19R%21'!, %m%22'^"},
2960   {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
2961     0x08000000, 0x0e100000, "stm%23?id%24?ba%c\t%16-19R%21'!, %m%22'^"},
2962
2963   {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
2964     0x08bd0001, 0x0fffffff, "ldmfd%c\t%16-19R!, %m"},
2965   {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
2966     0x08bd0002, 0x0fffffff, "ldmfd%c\t%16-19R!, %m"},
2967   {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
2968     0x08bd0004, 0x0fffffff, "ldmfd%c\t%16-19R!, %m"},
2969   {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
2970     0x08bd0008, 0x0fffffff, "ldmfd%c\t%16-19R!, %m"},
2971   {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
2972     0x08bd0010, 0x0fffffff, "ldmfd%c\t%16-19R!, %m"},
2973   {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
2974     0x08bd0020, 0x0fffffff, "ldmfd%c\t%16-19R!, %m"},
2975   {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
2976     0x08bd0040, 0x0fffffff, "ldmfd%c\t%16-19R!, %m"},
2977   {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
2978     0x08bd0080, 0x0fffffff, "ldmfd%c\t%16-19R!, %m"},
2979   {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
2980     0x08bd0100, 0x0fffffff, "ldmfd%c\t%16-19R!, %m"},
2981   {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
2982     0x08bd0200, 0x0fffffff, "ldmfd%c\t%16-19R!, %m"},
2983   {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
2984     0x08bd0400, 0x0fffffff, "ldmfd%c\t%16-19R!, %m"},
2985   {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
2986     0x08bd0800, 0x0fffffff, "ldmfd%c\t%16-19R!, %m"},
2987   {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
2988     0x08bd1000, 0x0fffffff, "ldmfd%c\t%16-19R!, %m"},
2989   {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
2990     0x08bd2000, 0x0fffffff, "ldmfd%c\t%16-19R!, %m"},
2991   {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
2992     0x08bd4000, 0x0fffffff, "ldmfd%c\t%16-19R!, %m"},
2993   {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
2994     0x08bd8000, 0x0fffffff, "ldmfd%c\t%16-19R!, %m"},
2995   {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
2996     0x08bd0000, 0x0fff0000, "pop%c\t%m"},
2997   {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
2998     0x08900000, 0x0f900000, "ldm%c\t%16-19R%21'!, %m%22'^"},
2999   {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
3000     0x08100000, 0x0e100000, "ldm%23?id%24?ba%c\t%16-19R%21'!, %m%22'^"},
3001
3002   {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
3003     0x0a000000, 0x0e000000, "b%24'l%c\t%b"},
3004   {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
3005     0x0f000000, 0x0f000000, "svc%c\t%0-23x"},
3006
3007   /* The rest.  */
3008   {ARM_FEATURE_CORE_LOW (ARM_EXT_V7),
3009     0x03200000, 0x0fff00ff, "nop%c\t{%0-7d}" UNPREDICTABLE_INSTRUCTION},
3010   {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
3011     0x00000000, 0x00000000, UNDEFINED_INSTRUCTION},
3012   {ARM_FEATURE_CORE_LOW (0),
3013     0x00000000, 0x00000000, 0}
3014 };
3015
3016 /* print_insn_thumb16 recognizes the following format control codes:
3017
3018    %S                   print Thumb register (bits 3..5 as high number if bit 6 set)
3019    %D                   print Thumb register (bits 0..2 as high number if bit 7 set)
3020    %<bitfield>I         print bitfield as a signed decimal
3021                                 (top bit of range being the sign bit)
3022    %N                   print Thumb register mask (with LR)
3023    %O                   print Thumb register mask (with PC)
3024    %M                   print Thumb register mask
3025    %b                   print CZB's 6-bit unsigned branch destination
3026    %s                   print Thumb right-shift immediate (6..10; 0 == 32).
3027    %c                   print the condition code
3028    %C                   print the condition code, or "s" if not conditional
3029    %x                   print warning if conditional an not at end of IT block"
3030    %X                   print "\t; unpredictable <IT:code>" if conditional
3031    %I                   print IT instruction suffix and operands
3032    %W                   print Thumb Writeback indicator for LDMIA
3033    %<bitfield>r         print bitfield as an ARM register
3034    %<bitfield>d         print bitfield as a decimal
3035    %<bitfield>H         print (bitfield * 2) as a decimal
3036    %<bitfield>W         print (bitfield * 4) as a decimal
3037    %<bitfield>a         print (bitfield * 4) as a pc-rel offset + decoded symbol
3038    %<bitfield>B         print Thumb branch destination (signed displacement)
3039    %<bitfield>c         print bitfield as a condition code
3040    %<bitnum>'c          print specified char iff bit is one
3041    %<bitnum>?ab         print a if bit is one else print b.  */
3042
3043 static const struct opcode16 thumb_opcodes[] =
3044 {
3045   /* Thumb instructions.  */
3046
3047   /* ARMv8-M Security Extensions instructions.  */
3048   {ARM_FEATURE_CORE_HIGH (ARM_EXT2_V8M), 0x4784, 0xff87, "blxns\t%3-6r"},
3049   {ARM_FEATURE_CORE_HIGH (ARM_EXT2_V8M), 0x4704, 0xff87, "bxns\t%3-6r"},
3050
3051   /* ARM V8 instructions.  */
3052   {ARM_FEATURE_CORE_LOW (ARM_EXT_V8),  0xbf50, 0xffff, "sevl%c"},
3053   {ARM_FEATURE_CORE_LOW (ARM_EXT_V8),  0xba80, 0xffc0, "hlt\t%0-5x"},
3054   {ARM_FEATURE_CORE_HIGH (ARM_EXT2_PAN),  0xb610, 0xfff7, "setpan\t#%3-3d"},
3055
3056   /* ARM V6K no-argument instructions.  */
3057   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6K), 0xbf00, 0xffff, "nop%c"},
3058   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6K), 0xbf10, 0xffff, "yield%c"},
3059   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6K), 0xbf20, 0xffff, "wfe%c"},
3060   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6K), 0xbf30, 0xffff, "wfi%c"},
3061   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6K), 0xbf40, 0xffff, "sev%c"},
3062   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6K), 0xbf00, 0xff0f, "nop%c\t{%4-7d}"},
3063
3064   /* ARM V6T2 instructions.  */
3065   {ARM_FEATURE_CORE_HIGH (ARM_EXT2_V6T2_V8M),
3066     0xb900, 0xfd00, "cbnz\t%0-2r, %b%X"},
3067   {ARM_FEATURE_CORE_HIGH (ARM_EXT2_V6T2_V8M),
3068     0xb100, 0xfd00, "cbz\t%0-2r, %b%X"},
3069   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2), 0xbf00, 0xff00, "it%I%X"},
3070
3071   /* ARM V6.  */
3072   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6), 0xb660, 0xfff8, "cpsie\t%2'a%1'i%0'f%X"},
3073   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6), 0xb670, 0xfff8, "cpsid\t%2'a%1'i%0'f%X"},
3074   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6), 0x4600, 0xffc0, "mov%c\t%0-2r, %3-5r"},
3075   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6), 0xba00, 0xffc0, "rev%c\t%0-2r, %3-5r"},
3076   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6), 0xba40, 0xffc0, "rev16%c\t%0-2r, %3-5r"},
3077   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6), 0xbac0, 0xffc0, "revsh%c\t%0-2r, %3-5r"},
3078   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6), 0xb650, 0xfff7, "setend\t%3?ble%X"},
3079   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6), 0xb200, 0xffc0, "sxth%c\t%0-2r, %3-5r"},
3080   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6), 0xb240, 0xffc0, "sxtb%c\t%0-2r, %3-5r"},
3081   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6), 0xb280, 0xffc0, "uxth%c\t%0-2r, %3-5r"},
3082   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6), 0xb2c0, 0xffc0, "uxtb%c\t%0-2r, %3-5r"},
3083
3084   /* ARM V5 ISA extends Thumb.  */
3085   {ARM_FEATURE_CORE_LOW (ARM_EXT_V5T),
3086     0xbe00, 0xff00, "bkpt\t%0-7x"}, /* Is always unconditional.  */
3087   /* This is BLX(2).  BLX(1) is a 32-bit instruction.  */
3088   {ARM_FEATURE_CORE_LOW (ARM_EXT_V5T),
3089     0x4780, 0xff87, "blx%c\t%3-6r%x"},  /* note: 4 bit register number.  */
3090   /* ARM V4T ISA (Thumb v1).  */
3091   {ARM_FEATURE_CORE_LOW (ARM_EXT_V4T),
3092     0x46C0, 0xFFFF, "nop%c\t\t\t; (mov r8, r8)"},
3093   /* Format 4.  */
3094   {ARM_FEATURE_CORE_LOW (ARM_EXT_V4T), 0x4000, 0xFFC0, "and%C\t%0-2r, %3-5r"},
3095   {ARM_FEATURE_CORE_LOW (ARM_EXT_V4T), 0x4040, 0xFFC0, "eor%C\t%0-2r, %3-5r"},
3096   {ARM_FEATURE_CORE_LOW (ARM_EXT_V4T), 0x4080, 0xFFC0, "lsl%C\t%0-2r, %3-5r"},
3097   {ARM_FEATURE_CORE_LOW (ARM_EXT_V4T), 0x40C0, 0xFFC0, "lsr%C\t%0-2r, %3-5r"},
3098   {ARM_FEATURE_CORE_LOW (ARM_EXT_V4T), 0x4100, 0xFFC0, "asr%C\t%0-2r, %3-5r"},
3099   {ARM_FEATURE_CORE_LOW (ARM_EXT_V4T), 0x4140, 0xFFC0, "adc%C\t%0-2r, %3-5r"},
3100   {ARM_FEATURE_CORE_LOW (ARM_EXT_V4T), 0x4180, 0xFFC0, "sbc%C\t%0-2r, %3-5r"},
3101   {ARM_FEATURE_CORE_LOW (ARM_EXT_V4T), 0x41C0, 0xFFC0, "ror%C\t%0-2r, %3-5r"},
3102   {ARM_FEATURE_CORE_LOW (ARM_EXT_V4T), 0x4200, 0xFFC0, "tst%c\t%0-2r, %3-5r"},
3103   {ARM_FEATURE_CORE_LOW (ARM_EXT_V4T), 0x4240, 0xFFC0, "neg%C\t%0-2r, %3-5r"},
3104   {ARM_FEATURE_CORE_LOW (ARM_EXT_V4T), 0x4280, 0xFFC0, "cmp%c\t%0-2r, %3-5r"},
3105   {ARM_FEATURE_CORE_LOW (ARM_EXT_V4T), 0x42C0, 0xFFC0, "cmn%c\t%0-2r, %3-5r"},
3106   {ARM_FEATURE_CORE_LOW (ARM_EXT_V4T), 0x4300, 0xFFC0, "orr%C\t%0-2r, %3-5r"},
3107   {ARM_FEATURE_CORE_LOW (ARM_EXT_V4T), 0x4340, 0xFFC0, "mul%C\t%0-2r, %3-5r"},
3108   {ARM_FEATURE_CORE_LOW (ARM_EXT_V4T), 0x4380, 0xFFC0, "bic%C\t%0-2r, %3-5r"},
3109   {ARM_FEATURE_CORE_LOW (ARM_EXT_V4T), 0x43C0, 0xFFC0, "mvn%C\t%0-2r, %3-5r"},
3110   /* format 13 */
3111   {ARM_FEATURE_CORE_LOW (ARM_EXT_V4T), 0xB000, 0xFF80, "add%c\tsp, #%0-6W"},
3112   {ARM_FEATURE_CORE_LOW (ARM_EXT_V4T), 0xB080, 0xFF80, "sub%c\tsp, #%0-6W"},
3113   /* format 5 */
3114   {ARM_FEATURE_CORE_LOW (ARM_EXT_V4T), 0x4700, 0xFF80, "bx%c\t%S%x"},
3115   {ARM_FEATURE_CORE_LOW (ARM_EXT_V4T), 0x4400, 0xFF00, "add%c\t%D, %S"},
3116   {ARM_FEATURE_CORE_LOW (ARM_EXT_V4T), 0x4500, 0xFF00, "cmp%c\t%D, %S"},
3117   {ARM_FEATURE_CORE_LOW (ARM_EXT_V4T), 0x4600, 0xFF00, "mov%c\t%D, %S"},
3118   /* format 14 */
3119   {ARM_FEATURE_CORE_LOW (ARM_EXT_V4T), 0xB400, 0xFE00, "push%c\t%N"},
3120   {ARM_FEATURE_CORE_LOW (ARM_EXT_V4T), 0xBC00, 0xFE00, "pop%c\t%O"},
3121   /* format 2 */
3122   {ARM_FEATURE_CORE_LOW (ARM_EXT_V4T),
3123     0x1800, 0xFE00, "add%C\t%0-2r, %3-5r, %6-8r"},
3124   {ARM_FEATURE_CORE_LOW (ARM_EXT_V4T),
3125     0x1A00, 0xFE00, "sub%C\t%0-2r, %3-5r, %6-8r"},
3126   {ARM_FEATURE_CORE_LOW (ARM_EXT_V4T),
3127     0x1C00, 0xFE00, "add%C\t%0-2r, %3-5r, #%6-8d"},
3128   {ARM_FEATURE_CORE_LOW (ARM_EXT_V4T),
3129     0x1E00, 0xFE00, "sub%C\t%0-2r, %3-5r, #%6-8d"},
3130   /* format 8 */
3131   {ARM_FEATURE_CORE_LOW (ARM_EXT_V4T),
3132     0x5200, 0xFE00, "strh%c\t%0-2r, [%3-5r, %6-8r]"},
3133   {ARM_FEATURE_CORE_LOW (ARM_EXT_V4T),
3134     0x5A00, 0xFE00, "ldrh%c\t%0-2r, [%3-5r, %6-8r]"},
3135   {ARM_FEATURE_CORE_LOW (ARM_EXT_V4T),
3136     0x5600, 0xF600, "ldrs%11?hb%c\t%0-2r, [%3-5r, %6-8r]"},
3137   /* format 7 */
3138   {ARM_FEATURE_CORE_LOW (ARM_EXT_V4T),
3139     0x5000, 0xFA00, "str%10'b%c\t%0-2r, [%3-5r, %6-8r]"},
3140   {ARM_FEATURE_CORE_LOW (ARM_EXT_V4T),
3141     0x5800, 0xFA00, "ldr%10'b%c\t%0-2r, [%3-5r, %6-8r]"},
3142   /* format 1 */
3143   {ARM_FEATURE_CORE_LOW (ARM_EXT_V4T), 0x0000, 0xFFC0, "mov%C\t%0-2r, %3-5r"},
3144   {ARM_FEATURE_CORE_LOW (ARM_EXT_V4T),
3145     0x0000, 0xF800, "lsl%C\t%0-2r, %3-5r, #%6-10d"},
3146   {ARM_FEATURE_CORE_LOW (ARM_EXT_V4T), 0x0800, 0xF800, "lsr%C\t%0-2r, %3-5r, %s"},
3147   {ARM_FEATURE_CORE_LOW (ARM_EXT_V4T), 0x1000, 0xF800, "asr%C\t%0-2r, %3-5r, %s"},
3148   /* format 3 */
3149   {ARM_FEATURE_CORE_LOW (ARM_EXT_V4T), 0x2000, 0xF800, "mov%C\t%8-10r, #%0-7d"},
3150   {ARM_FEATURE_CORE_LOW (ARM_EXT_V4T), 0x2800, 0xF800, "cmp%c\t%8-10r, #%0-7d"},
3151   {ARM_FEATURE_CORE_LOW (ARM_EXT_V4T), 0x3000, 0xF800, "add%C\t%8-10r, #%0-7d"},
3152   {ARM_FEATURE_CORE_LOW (ARM_EXT_V4T), 0x3800, 0xF800, "sub%C\t%8-10r, #%0-7d"},
3153   /* format 6 */
3154   /* TODO: Disassemble PC relative "LDR rD,=<symbolic>" */
3155   {ARM_FEATURE_CORE_LOW (ARM_EXT_V4T),
3156     0x4800, 0xF800,
3157     "ldr%c\t%8-10r, [pc, #%0-7W]\t; (%0-7a)"},
3158   /* format 9 */
3159   {ARM_FEATURE_CORE_LOW (ARM_EXT_V4T),
3160     0x6000, 0xF800, "str%c\t%0-2r, [%3-5r, #%6-10W]"},
3161   {ARM_FEATURE_CORE_LOW (ARM_EXT_V4T),
3162     0x6800, 0xF800, "ldr%c\t%0-2r, [%3-5r, #%6-10W]"},
3163   {ARM_FEATURE_CORE_LOW (ARM_EXT_V4T),
3164     0x7000, 0xF800, "strb%c\t%0-2r, [%3-5r, #%6-10d]"},
3165   {ARM_FEATURE_CORE_LOW (ARM_EXT_V4T),
3166     0x7800, 0xF800, "ldrb%c\t%0-2r, [%3-5r, #%6-10d]"},
3167   /* format 10 */
3168   {ARM_FEATURE_CORE_LOW (ARM_EXT_V4T),
3169     0x8000, 0xF800, "strh%c\t%0-2r, [%3-5r, #%6-10H]"},
3170   {ARM_FEATURE_CORE_LOW (ARM_EXT_V4T),
3171     0x8800, 0xF800, "ldrh%c\t%0-2r, [%3-5r, #%6-10H]"},
3172   /* format 11 */
3173   {ARM_FEATURE_CORE_LOW (ARM_EXT_V4T),
3174     0x9000, 0xF800, "str%c\t%8-10r, [sp, #%0-7W]"},
3175   {ARM_FEATURE_CORE_LOW (ARM_EXT_V4T),
3176     0x9800, 0xF800, "ldr%c\t%8-10r, [sp, #%0-7W]"},
3177   /* format 12 */
3178   {ARM_FEATURE_CORE_LOW (ARM_EXT_V4T),
3179     0xA000, 0xF800, "add%c\t%8-10r, pc, #%0-7W\t; (adr %8-10r, %0-7a)"},
3180   {ARM_FEATURE_CORE_LOW (ARM_EXT_V4T),
3181     0xA800, 0xF800, "add%c\t%8-10r, sp, #%0-7W"},
3182   /* format 15 */
3183   {ARM_FEATURE_CORE_LOW (ARM_EXT_V4T), 0xC000, 0xF800, "stmia%c\t%8-10r!, %M"},
3184   {ARM_FEATURE_CORE_LOW (ARM_EXT_V4T), 0xC800, 0xF800, "ldmia%c\t%8-10r%W, %M"},
3185   /* format 17 */
3186   {ARM_FEATURE_CORE_LOW (ARM_EXT_V4T), 0xDF00, 0xFF00, "svc%c\t%0-7d"},
3187   /* format 16 */
3188   {ARM_FEATURE_CORE_LOW (ARM_EXT_V4T), 0xDE00, 0xFF00, "udf%c\t#%0-7d"},
3189   {ARM_FEATURE_CORE_LOW (ARM_EXT_V4T), 0xDE00, 0xFE00, UNDEFINED_INSTRUCTION},
3190   {ARM_FEATURE_CORE_LOW (ARM_EXT_V4T), 0xD000, 0xF000, "b%8-11c.n\t%0-7B%X"},
3191   /* format 18 */
3192   {ARM_FEATURE_CORE_LOW (ARM_EXT_V4T), 0xE000, 0xF800, "b%c.n\t%0-10B%x"},
3193
3194   /* The E800 .. FFFF range is unconditionally redirected to the
3195      32-bit table, because even in pre-V6T2 ISAs, BL and BLX(1) pairs
3196      are processed via that table.  Thus, we can never encounter a
3197      bare "second half of BL/BLX(1)" instruction here.  */
3198   {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),  0x0000, 0x0000, UNDEFINED_INSTRUCTION},
3199   {ARM_FEATURE_CORE_LOW (0), 0, 0, 0}
3200 };
3201
3202 /* Thumb32 opcodes use the same table structure as the ARM opcodes.
3203    We adopt the convention that hw1 is the high 16 bits of .value and
3204    .mask, hw2 the low 16 bits.
3205
3206    print_insn_thumb32 recognizes the following format control codes:
3207
3208        %%               %
3209
3210        %I               print a 12-bit immediate from hw1[10],hw2[14:12,7:0]
3211        %M               print a modified 12-bit immediate (same location)
3212        %J               print a 16-bit immediate from hw1[3:0,10],hw2[14:12,7:0]
3213        %K               print a 16-bit immediate from hw2[3:0],hw1[3:0],hw2[11:4]
3214        %H               print a 16-bit immediate from hw2[3:0],hw1[11:0]
3215        %S               print a possibly-shifted Rm
3216
3217        %L               print address for a ldrd/strd instruction
3218        %a               print the address of a plain load/store
3219        %w               print the width and signedness of a core load/store
3220        %m               print register mask for ldm/stm
3221        %n               print register mask for clrm
3222
3223        %E               print the lsb and width fields of a bfc/bfi instruction
3224        %F               print the lsb and width fields of a sbfx/ubfx instruction
3225        %G               print a fallback offset for Branch Future instructions
3226        %W               print an offset for BF instruction
3227        %Y               print an offset for BFL instruction
3228        %Z               print an offset for BFCSEL instruction
3229        %Q               print an offset for Low Overhead Loop instructions
3230        %P               print an offset for Low Overhead Loop end instructions
3231        %b               print a conditional branch offset
3232        %B               print an unconditional branch offset
3233        %s               print the shift field of an SSAT instruction
3234        %R               print the rotation field of an SXT instruction
3235        %U               print barrier type.
3236        %P               print address for pli instruction.
3237        %c               print the condition code
3238        %x               print warning if conditional an not at end of IT block"
3239        %X               print "\t; unpredictable <IT:code>" if conditional
3240
3241        %<bitfield>d     print bitfield in decimal
3242        %<bitfield>D     print bitfield plus one in decimal
3243        %<bitfield>W     print bitfield*4 in decimal
3244        %<bitfield>r     print bitfield as an ARM register
3245        %<bitfield>R     as %<>r but r15 is UNPREDICTABLE
3246        %<bitfield>S     as %<>r but r13 and r15 is UNPREDICTABLE
3247        %<bitfield>c     print bitfield as a condition code
3248
3249        %<bitfield>'c    print specified char iff bitfield is all ones
3250        %<bitfield>`c    print specified char iff bitfield is all zeroes
3251        %<bitfield>?ab... select from array of values in big endian order
3252
3253    With one exception at the bottom (done because BL and BLX(1) need
3254    to come dead last), this table was machine-sorted first in
3255    decreasing order of number of bits set in the mask, then in
3256    increasing numeric order of mask, then in increasing numeric order
3257    of opcode.  This order is not the clearest for a human reader, but
3258    is guaranteed never to catch a special-case bit pattern with a more
3259    general mask, which is important, because this instruction encoding
3260    makes heavy use of special-case bit patterns.  */
3261 static const struct opcode32 thumb32_opcodes[] =
3262 {
3263   /* Armv8.1-M Mainline and Armv8.1-M Mainline Security Extensions
3264      instructions.  */
3265   {ARM_FEATURE_CORE_HIGH (ARM_EXT2_V8_1M_MAIN),
3266     0xf040c001, 0xfff0f001, "wls\tlr, %16-19S, %Q"},
3267   {ARM_FEATURE_CORE_HIGH (ARM_EXT2_V8_1M_MAIN),
3268     0xf040e001, 0xfff0ffff, "dls\tlr, %16-19S"},
3269   {ARM_FEATURE_CORE_HIGH (ARM_EXT2_V8_1M_MAIN),
3270     0xf02fc001, 0xfffff001, "le\t%P"},
3271   {ARM_FEATURE_CORE_HIGH (ARM_EXT2_V8_1M_MAIN),
3272     0xf00fc001, 0xfffff001, "le\tlr, %P"},
3273
3274   {ARM_FEATURE_CORE_HIGH (ARM_EXT2_V8_1M_MAIN),
3275     0xf040e001, 0xf860f001, "bf%c\t%G, %W"},
3276   {ARM_FEATURE_CORE_HIGH (ARM_EXT2_V8_1M_MAIN),
3277     0xf060e001, 0xf8f0f001, "bfx%c\t%G, %16-19S"},
3278   {ARM_FEATURE_CORE_HIGH (ARM_EXT2_V8_1M_MAIN),
3279     0xf000c001, 0xf800f001, "bfl%c\t%G, %Y"},
3280   {ARM_FEATURE_CORE_HIGH (ARM_EXT2_V8_1M_MAIN),
3281     0xf070e001, 0xf8f0f001, "bflx%c\t%G, %16-19S"},
3282   {ARM_FEATURE_CORE_HIGH (ARM_EXT2_V8_1M_MAIN),
3283     0xf000e001, 0xf840f001, "bfcsel\t%G, %Z, %18-21c"},
3284
3285   {ARM_FEATURE_CORE_HIGH (ARM_EXT2_V8_1M_MAIN),
3286     0xe89f0000, 0xffff2000, "clrm%c\t%n"},
3287
3288   /* ARMv8-M and ARMv8-M Security Extensions instructions.  */
3289   {ARM_FEATURE_CORE_HIGH (ARM_EXT2_V8M), 0xe97fe97f, 0xffffffff, "sg"},
3290   {ARM_FEATURE_CORE_HIGH (ARM_EXT2_V8M),
3291     0xe840f000, 0xfff0f0ff, "tt\t%8-11r, %16-19r"},
3292   {ARM_FEATURE_CORE_HIGH (ARM_EXT2_V8M),
3293     0xe840f040, 0xfff0f0ff, "ttt\t%8-11r, %16-19r"},
3294   {ARM_FEATURE_CORE_HIGH (ARM_EXT2_V8M),
3295     0xe840f080, 0xfff0f0ff, "tta\t%8-11r, %16-19r"},
3296   {ARM_FEATURE_CORE_HIGH (ARM_EXT2_V8M),
3297     0xe840f0c0, 0xfff0f0ff, "ttat\t%8-11r, %16-19r"},
3298
3299   /* ARM V8.2 RAS extension instructions.  */
3300   {ARM_FEATURE_CORE_HIGH (ARM_EXT2_RAS),
3301     0xf3af8010, 0xffffffff, "esb"},
3302
3303   /* V8 instructions.  */
3304   {ARM_FEATURE_CORE_LOW (ARM_EXT_V8),
3305     0xf3af8005, 0xffffffff, "sevl%c.w"},
3306   {ARM_FEATURE_CORE_LOW (ARM_EXT_V8),
3307     0xf78f8000, 0xfffffffc, "dcps%0-1d"},
3308   {ARM_FEATURE_CORE_LOW (ARM_EXT_V8),
3309     0xe8c00f8f, 0xfff00fff, "stlb%c\t%12-15r, [%16-19R]"},
3310   {ARM_FEATURE_CORE_LOW (ARM_EXT_V8),
3311     0xe8c00f9f, 0xfff00fff, "stlh%c\t%12-15r, [%16-19R]"},
3312   {ARM_FEATURE_CORE_LOW (ARM_EXT_V8),
3313     0xe8c00faf, 0xfff00fff, "stl%c\t%12-15r, [%16-19R]"},
3314   {ARM_FEATURE_CORE_LOW (ARM_EXT_V8),
3315     0xe8c00fc0, 0xfff00ff0, "stlexb%c\t%0-3r, %12-15r, [%16-19R]"},
3316   {ARM_FEATURE_CORE_LOW (ARM_EXT_V8),
3317     0xe8c00fd0, 0xfff00ff0, "stlexh%c\t%0-3r, %12-15r, [%16-19R]"},
3318   {ARM_FEATURE_CORE_LOW (ARM_EXT_V8),
3319     0xe8c00fe0, 0xfff00ff0, "stlex%c\t%0-3r, %12-15r, [%16-19R]"},
3320   {ARM_FEATURE_CORE_LOW (ARM_EXT_V8),
3321     0xe8c000f0, 0xfff000f0, "stlexd%c\t%0-3r, %12-15r, %8-11r, [%16-19R]"},
3322   {ARM_FEATURE_CORE_LOW (ARM_EXT_V8),
3323     0xe8d00f8f, 0xfff00fff, "ldab%c\t%12-15r, [%16-19R]"},
3324   {ARM_FEATURE_CORE_LOW (ARM_EXT_V8),
3325     0xe8d00f9f, 0xfff00fff, "ldah%c\t%12-15r, [%16-19R]"},
3326   {ARM_FEATURE_CORE_LOW (ARM_EXT_V8),
3327     0xe8d00faf, 0xfff00fff, "lda%c\t%12-15r, [%16-19R]"},
3328   {ARM_FEATURE_CORE_LOW (ARM_EXT_V8),
3329     0xe8d00fcf, 0xfff00fff, "ldaexb%c\t%12-15r, [%16-19R]"},
3330   {ARM_FEATURE_CORE_LOW (ARM_EXT_V8),
3331     0xe8d00fdf, 0xfff00fff, "ldaexh%c\t%12-15r, [%16-19R]"},
3332   {ARM_FEATURE_CORE_LOW (ARM_EXT_V8),
3333     0xe8d00fef, 0xfff00fff, "ldaex%c\t%12-15r, [%16-19R]"},
3334   {ARM_FEATURE_CORE_LOW (ARM_EXT_V8),
3335     0xe8d000ff, 0xfff000ff, "ldaexd%c\t%12-15r, %8-11r, [%16-19R]"},
3336
3337   /* CRC32 instructions.  */
3338   {ARM_FEATURE_COPROC (CRC_EXT_ARMV8),
3339     0xfac0f080, 0xfff0f0f0, "crc32b\t%8-11R, %16-19R, %0-3R"},
3340   {ARM_FEATURE_COPROC (CRC_EXT_ARMV8),
3341     0xfac0f090, 0xfff0f0f0, "crc32h\t%9-11R, %16-19R, %0-3R"},
3342   {ARM_FEATURE_COPROC (CRC_EXT_ARMV8),
3343     0xfac0f0a0, 0xfff0f0f0, "crc32w\t%8-11R, %16-19R, %0-3R"},
3344   {ARM_FEATURE_COPROC (CRC_EXT_ARMV8),
3345     0xfad0f080, 0xfff0f0f0, "crc32cb\t%8-11R, %16-19R, %0-3R"},
3346   {ARM_FEATURE_COPROC (CRC_EXT_ARMV8),
3347     0xfad0f090, 0xfff0f0f0, "crc32ch\t%8-11R, %16-19R, %0-3R"},
3348   {ARM_FEATURE_COPROC (CRC_EXT_ARMV8),
3349     0xfad0f0a0, 0xfff0f0f0, "crc32cw\t%8-11R, %16-19R, %0-3R"},
3350
3351   /* Speculation Barriers.  */
3352   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2), 0xf3af8014, 0xffffffff, "csdb"},
3353   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2), 0xf3bf8f40, 0xffffffff, "ssbb"},
3354   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2), 0xf3bf8f44, 0xffffffff, "pssbb"},
3355
3356   /* V7 instructions.  */
3357   {ARM_FEATURE_CORE_LOW (ARM_EXT_V7), 0xf910f000, 0xff70f000, "pli%c\t%a"},
3358   {ARM_FEATURE_CORE_LOW (ARM_EXT_V7), 0xf3af80f0, 0xfffffff0, "dbg%c\t#%0-3d"},
3359   {ARM_FEATURE_CORE_LOW (ARM_EXT_V8), 0xf3bf8f51, 0xfffffff3, "dmb%c\t%U"},
3360   {ARM_FEATURE_CORE_LOW (ARM_EXT_V8), 0xf3bf8f41, 0xfffffff3, "dsb%c\t%U"},
3361   {ARM_FEATURE_CORE_LOW (ARM_EXT_V7), 0xf3bf8f50, 0xfffffff0, "dmb%c\t%U"},
3362   {ARM_FEATURE_CORE_LOW (ARM_EXT_V7), 0xf3bf8f40, 0xfffffff0, "dsb%c\t%U"},
3363   {ARM_FEATURE_CORE_LOW (ARM_EXT_V7), 0xf3bf8f60, 0xfffffff0, "isb%c\t%U"},
3364   {ARM_FEATURE_CORE_LOW (ARM_EXT_DIV),
3365     0xfb90f0f0, 0xfff0f0f0, "sdiv%c\t%8-11r, %16-19r, %0-3r"},
3366   {ARM_FEATURE_CORE_LOW (ARM_EXT_DIV),
3367     0xfbb0f0f0, 0xfff0f0f0, "udiv%c\t%8-11r, %16-19r, %0-3r"},
3368
3369   /* Virtualization Extension instructions.  */
3370   {ARM_FEATURE_CORE_LOW (ARM_EXT_VIRT), 0xf7e08000, 0xfff0f000, "hvc%c\t%V"},
3371   /* We skip ERET as that is SUBS pc, lr, #0.  */
3372
3373   /* MP Extension instructions.  */
3374   {ARM_FEATURE_CORE_LOW (ARM_EXT_MP),   0xf830f000, 0xff70f000, "pldw%c\t%a"},
3375
3376   /* Security extension instructions.  */
3377   {ARM_FEATURE_CORE_LOW (ARM_EXT_SEC),  0xf7f08000, 0xfff0f000, "smc%c\t%K"},
3378
3379   /* ARMv8.5-A instructions.  */
3380   {ARM_FEATURE_CORE_HIGH (ARM_EXT2_SB), 0xf3bf8f70, 0xffffffff, "sb"},
3381
3382   /* Instructions defined in the basic V6T2 set.  */
3383   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2), 0xf3af8000, 0xffffffff, "nop%c.w"},
3384   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2), 0xf3af8001, 0xffffffff, "yield%c.w"},
3385   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2), 0xf3af8002, 0xffffffff, "wfe%c.w"},
3386   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2), 0xf3af8003, 0xffffffff, "wfi%c.w"},
3387   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2), 0xf3af8004, 0xffffffff, "sev%c.w"},
3388   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3389     0xf3af8000, 0xffffff00, "nop%c.w\t{%0-7d}"},
3390   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2), 0xf7f0a000, 0xfff0f000, "udf%c.w\t%H"},
3391
3392   {ARM_FEATURE_CORE_HIGH (ARM_EXT2_V6T2_V8M),
3393     0xf3bf8f2f, 0xffffffff, "clrex%c"},
3394   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3395     0xf3af8400, 0xffffff1f, "cpsie.w\t%7'a%6'i%5'f%X"},
3396   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3397     0xf3af8600, 0xffffff1f, "cpsid.w\t%7'a%6'i%5'f%X"},
3398   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3399     0xf3c08f00, 0xfff0ffff, "bxj%c\t%16-19r%x"},
3400   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3401     0xe810c000, 0xffd0ffff, "rfedb%c\t%16-19r%21'!"},
3402   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3403     0xe990c000, 0xffd0ffff, "rfeia%c\t%16-19r%21'!"},
3404   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3405     0xf3e08000, 0xffe0f000, "mrs%c\t%8-11r, %D"},
3406   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3407     0xf3af8100, 0xffffffe0, "cps\t#%0-4d%X"},
3408   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3409     0xe8d0f000, 0xfff0fff0, "tbb%c\t[%16-19r, %0-3r]%x"},
3410   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3411     0xe8d0f010, 0xfff0fff0, "tbh%c\t[%16-19r, %0-3r, lsl #1]%x"},
3412   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3413     0xf3af8500, 0xffffff00, "cpsie\t%7'a%6'i%5'f, #%0-4d%X"},
3414   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3415     0xf3af8700, 0xffffff00, "cpsid\t%7'a%6'i%5'f, #%0-4d%X"},
3416   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3417     0xf3de8f00, 0xffffff00, "subs%c\tpc, lr, #%0-7d"},
3418   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3419     0xf3808000, 0xffe0f000, "msr%c\t%C, %16-19r"},
3420   {ARM_FEATURE_CORE_HIGH (ARM_EXT2_V6T2_V8M),
3421     0xe8500f00, 0xfff00fff, "ldrex%c\t%12-15r, [%16-19r]"},
3422   {ARM_FEATURE_CORE_HIGH (ARM_EXT2_V6T2_V8M),
3423     0xe8d00f4f, 0xfff00fef, "ldrex%4?hb%c\t%12-15r, [%16-19r]"},
3424   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3425     0xe800c000, 0xffd0ffe0, "srsdb%c\t%16-19r%21'!, #%0-4d"},
3426   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3427     0xe980c000, 0xffd0ffe0, "srsia%c\t%16-19r%21'!, #%0-4d"},
3428   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3429     0xfa0ff080, 0xfffff0c0, "sxth%c.w\t%8-11r, %0-3r%R"},
3430   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3431     0xfa1ff080, 0xfffff0c0, "uxth%c.w\t%8-11r, %0-3r%R"},
3432   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3433     0xfa2ff080, 0xfffff0c0, "sxtb16%c\t%8-11r, %0-3r%R"},
3434   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3435     0xfa3ff080, 0xfffff0c0, "uxtb16%c\t%8-11r, %0-3r%R"},
3436   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3437     0xfa4ff080, 0xfffff0c0, "sxtb%c.w\t%8-11r, %0-3r%R"},
3438   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3439     0xfa5ff080, 0xfffff0c0, "uxtb%c.w\t%8-11r, %0-3r%R"},
3440   {ARM_FEATURE_CORE_HIGH (ARM_EXT2_V6T2_V8M),
3441     0xe8400000, 0xfff000ff, "strex%c\t%8-11r, %12-15r, [%16-19r]"},
3442   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3443     0xe8d0007f, 0xfff000ff, "ldrexd%c\t%12-15r, %8-11r, [%16-19r]"},
3444   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3445     0xfa80f000, 0xfff0f0f0, "sadd8%c\t%8-11r, %16-19r, %0-3r"},
3446   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3447     0xfa80f010, 0xfff0f0f0, "qadd8%c\t%8-11r, %16-19r, %0-3r"},
3448   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3449     0xfa80f020, 0xfff0f0f0, "shadd8%c\t%8-11r, %16-19r, %0-3r"},
3450   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3451     0xfa80f040, 0xfff0f0f0, "uadd8%c\t%8-11r, %16-19r, %0-3r"},
3452   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3453     0xfa80f050, 0xfff0f0f0, "uqadd8%c\t%8-11r, %16-19r, %0-3r"},
3454   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3455     0xfa80f060, 0xfff0f0f0, "uhadd8%c\t%8-11r, %16-19r, %0-3r"},
3456   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3457     0xfa80f080, 0xfff0f0f0, "qadd%c\t%8-11r, %0-3r, %16-19r"},
3458   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3459     0xfa80f090, 0xfff0f0f0, "qdadd%c\t%8-11r, %0-3r, %16-19r"},
3460   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3461     0xfa80f0a0, 0xfff0f0f0, "qsub%c\t%8-11r, %0-3r, %16-19r"},
3462   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3463     0xfa80f0b0, 0xfff0f0f0, "qdsub%c\t%8-11r, %0-3r, %16-19r"},
3464   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3465     0xfa90f000, 0xfff0f0f0, "sadd16%c\t%8-11r, %16-19r, %0-3r"},
3466   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3467     0xfa90f010, 0xfff0f0f0, "qadd16%c\t%8-11r, %16-19r, %0-3r"},
3468   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3469     0xfa90f020, 0xfff0f0f0, "shadd16%c\t%8-11r, %16-19r, %0-3r"},
3470   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3471     0xfa90f040, 0xfff0f0f0, "uadd16%c\t%8-11r, %16-19r, %0-3r"},
3472   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3473     0xfa90f050, 0xfff0f0f0, "uqadd16%c\t%8-11r, %16-19r, %0-3r"},
3474   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3475     0xfa90f060, 0xfff0f0f0, "uhadd16%c\t%8-11r, %16-19r, %0-3r"},
3476   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3477     0xfa90f080, 0xfff0f0f0, "rev%c.w\t%8-11r, %16-19r"},
3478   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3479     0xfa90f090, 0xfff0f0f0, "rev16%c.w\t%8-11r, %16-19r"},
3480   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3481     0xfa90f0a0, 0xfff0f0f0, "rbit%c\t%8-11r, %16-19r"},
3482   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3483     0xfa90f0b0, 0xfff0f0f0, "revsh%c.w\t%8-11r, %16-19r"},
3484   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3485     0xfaa0f000, 0xfff0f0f0, "sasx%c\t%8-11r, %16-19r, %0-3r"},
3486   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3487     0xfaa0f010, 0xfff0f0f0, "qasx%c\t%8-11r, %16-19r, %0-3r"},
3488   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3489     0xfaa0f020, 0xfff0f0f0, "shasx%c\t%8-11r, %16-19r, %0-3r"},
3490   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3491     0xfaa0f040, 0xfff0f0f0, "uasx%c\t%8-11r, %16-19r, %0-3r"},
3492   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3493     0xfaa0f050, 0xfff0f0f0, "uqasx%c\t%8-11r, %16-19r, %0-3r"},
3494   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3495     0xfaa0f060, 0xfff0f0f0, "uhasx%c\t%8-11r, %16-19r, %0-3r"},
3496   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3497     0xfaa0f080, 0xfff0f0f0, "sel%c\t%8-11r, %16-19r, %0-3r"},
3498   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3499     0xfab0f080, 0xfff0f0f0, "clz%c\t%8-11r, %16-19r"},
3500   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3501     0xfac0f000, 0xfff0f0f0, "ssub8%c\t%8-11r, %16-19r, %0-3r"},
3502   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3503     0xfac0f010, 0xfff0f0f0, "qsub8%c\t%8-11r, %16-19r, %0-3r"},
3504   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3505     0xfac0f020, 0xfff0f0f0, "shsub8%c\t%8-11r, %16-19r, %0-3r"},
3506   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3507     0xfac0f040, 0xfff0f0f0, "usub8%c\t%8-11r, %16-19r, %0-3r"},
3508   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3509     0xfac0f050, 0xfff0f0f0, "uqsub8%c\t%8-11r, %16-19r, %0-3r"},
3510   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3511     0xfac0f060, 0xfff0f0f0, "uhsub8%c\t%8-11r, %16-19r, %0-3r"},
3512   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3513     0xfad0f000, 0xfff0f0f0, "ssub16%c\t%8-11r, %16-19r, %0-3r"},
3514   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3515     0xfad0f010, 0xfff0f0f0, "qsub16%c\t%8-11r, %16-19r, %0-3r"},
3516   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3517     0xfad0f020, 0xfff0f0f0, "shsub16%c\t%8-11r, %16-19r, %0-3r"},
3518   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3519     0xfad0f040, 0xfff0f0f0, "usub16%c\t%8-11r, %16-19r, %0-3r"},
3520   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3521     0xfad0f050, 0xfff0f0f0, "uqsub16%c\t%8-11r, %16-19r, %0-3r"},
3522   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3523     0xfad0f060, 0xfff0f0f0, "uhsub16%c\t%8-11r, %16-19r, %0-3r"},
3524   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3525     0xfae0f000, 0xfff0f0f0, "ssax%c\t%8-11r, %16-19r, %0-3r"},
3526   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3527     0xfae0f010, 0xfff0f0f0, "qsax%c\t%8-11r, %16-19r, %0-3r"},
3528   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3529     0xfae0f020, 0xfff0f0f0, "shsax%c\t%8-11r, %16-19r, %0-3r"},
3530   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3531     0xfae0f040, 0xfff0f0f0, "usax%c\t%8-11r, %16-19r, %0-3r"},
3532   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3533     0xfae0f050, 0xfff0f0f0, "uqsax%c\t%8-11r, %16-19r, %0-3r"},
3534   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3535     0xfae0f060, 0xfff0f0f0, "uhsax%c\t%8-11r, %16-19r, %0-3r"},
3536   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3537     0xfb00f000, 0xfff0f0f0, "mul%c.w\t%8-11r, %16-19r, %0-3r"},
3538   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3539     0xfb70f000, 0xfff0f0f0, "usad8%c\t%8-11r, %16-19r, %0-3r"},
3540   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3541     0xfa00f000, 0xffe0f0f0, "lsl%20's%c.w\t%8-11R, %16-19R, %0-3R"},
3542   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3543     0xfa20f000, 0xffe0f0f0, "lsr%20's%c.w\t%8-11R, %16-19R, %0-3R"},
3544   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3545     0xfa40f000, 0xffe0f0f0, "asr%20's%c.w\t%8-11R, %16-19R, %0-3R"},
3546   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3547     0xfa60f000, 0xffe0f0f0, "ror%20's%c.w\t%8-11r, %16-19r, %0-3r"},
3548   {ARM_FEATURE_CORE_HIGH (ARM_EXT2_V6T2_V8M),
3549     0xe8c00f40, 0xfff00fe0, "strex%4?hb%c\t%0-3r, %12-15r, [%16-19r]"},
3550   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3551     0xf3200000, 0xfff0f0e0, "ssat16%c\t%8-11r, #%0-4D, %16-19r"},
3552   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3553     0xf3a00000, 0xfff0f0e0, "usat16%c\t%8-11r, #%0-4d, %16-19r"},
3554   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3555     0xfb20f000, 0xfff0f0e0, "smuad%4'x%c\t%8-11r, %16-19r, %0-3r"},
3556   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3557     0xfb30f000, 0xfff0f0e0, "smulw%4?tb%c\t%8-11r, %16-19r, %0-3r"},
3558   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3559     0xfb40f000, 0xfff0f0e0, "smusd%4'x%c\t%8-11r, %16-19r, %0-3r"},
3560   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3561     0xfb50f000, 0xfff0f0e0, "smmul%4'r%c\t%8-11r, %16-19r, %0-3r"},
3562   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3563     0xfa00f080, 0xfff0f0c0, "sxtah%c\t%8-11r, %16-19r, %0-3r%R"},
3564   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3565     0xfa10f080, 0xfff0f0c0, "uxtah%c\t%8-11r, %16-19r, %0-3r%R"},
3566   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3567     0xfa20f080, 0xfff0f0c0, "sxtab16%c\t%8-11r, %16-19r, %0-3r%R"},
3568   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3569     0xfa30f080, 0xfff0f0c0, "uxtab16%c\t%8-11r, %16-19r, %0-3r%R"},
3570   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3571     0xfa40f080, 0xfff0f0c0, "sxtab%c\t%8-11r, %16-19r, %0-3r%R"},
3572   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3573     0xfa50f080, 0xfff0f0c0, "uxtab%c\t%8-11r, %16-19r, %0-3r%R"},
3574   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3575     0xfb10f000, 0xfff0f0c0, "smul%5?tb%4?tb%c\t%8-11r, %16-19r, %0-3r"},
3576   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3577     0xf36f0000, 0xffff8020, "bfc%c\t%8-11r, %E"},
3578   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3579     0xea100f00, 0xfff08f00, "tst%c.w\t%16-19r, %S"},
3580   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3581     0xea900f00, 0xfff08f00, "teq%c\t%16-19r, %S"},
3582   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3583     0xeb100f00, 0xfff08f00, "cmn%c.w\t%16-19r, %S"},
3584   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3585     0xebb00f00, 0xfff08f00, "cmp%c.w\t%16-19r, %S"},
3586   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3587     0xf0100f00, 0xfbf08f00, "tst%c.w\t%16-19r, %M"},
3588   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3589     0xf0900f00, 0xfbf08f00, "teq%c\t%16-19r, %M"},
3590   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3591     0xf1100f00, 0xfbf08f00, "cmn%c.w\t%16-19r, %M"},
3592   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3593     0xf1b00f00, 0xfbf08f00, "cmp%c.w\t%16-19r, %M"},
3594   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3595     0xea4f0000, 0xffef8000, "mov%20's%c.w\t%8-11r, %S"},
3596   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3597     0xea6f0000, 0xffef8000, "mvn%20's%c.w\t%8-11r, %S"},
3598   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3599     0xe8c00070, 0xfff000f0, "strexd%c\t%0-3r, %12-15r, %8-11r, [%16-19r]"},
3600   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3601     0xfb000000, 0xfff000f0, "mla%c\t%8-11r, %16-19r, %0-3r, %12-15r"},
3602   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3603     0xfb000010, 0xfff000f0, "mls%c\t%8-11r, %16-19r, %0-3r, %12-15r"},
3604   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3605     0xfb700000, 0xfff000f0, "usada8%c\t%8-11R, %16-19R, %0-3R, %12-15R"},
3606   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3607     0xfb800000, 0xfff000f0, "smull%c\t%12-15R, %8-11R, %16-19R, %0-3R"},
3608   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3609     0xfba00000, 0xfff000f0, "umull%c\t%12-15R, %8-11R, %16-19R, %0-3R"},
3610   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3611     0xfbc00000, 0xfff000f0, "smlal%c\t%12-15R, %8-11R, %16-19R, %0-3R"},
3612   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3613     0xfbe00000, 0xfff000f0, "umlal%c\t%12-15R, %8-11R, %16-19R, %0-3R"},
3614   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3615     0xfbe00060, 0xfff000f0, "umaal%c\t%12-15R, %8-11R, %16-19R, %0-3R"},
3616   {ARM_FEATURE_CORE_HIGH (ARM_EXT2_V6T2_V8M),
3617     0xe8500f00, 0xfff00f00, "ldrex%c\t%12-15r, [%16-19r, #%0-7W]"},
3618   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3619     0xf04f0000, 0xfbef8000, "mov%20's%c.w\t%8-11r, %M"},
3620   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3621     0xf06f0000, 0xfbef8000, "mvn%20's%c.w\t%8-11r, %M"},
3622   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3623     0xf810f000, 0xff70f000, "pld%c\t%a"},
3624   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3625     0xfb200000, 0xfff000e0, "smlad%4'x%c\t%8-11R, %16-19R, %0-3R, %12-15R"},
3626   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3627     0xfb300000, 0xfff000e0, "smlaw%4?tb%c\t%8-11R, %16-19R, %0-3R, %12-15R"},
3628   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3629     0xfb400000, 0xfff000e0, "smlsd%4'x%c\t%8-11R, %16-19R, %0-3R, %12-15R"},
3630   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3631     0xfb500000, 0xfff000e0, "smmla%4'r%c\t%8-11R, %16-19R, %0-3R, %12-15R"},
3632   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3633     0xfb600000, 0xfff000e0, "smmls%4'r%c\t%8-11R, %16-19R, %0-3R, %12-15R"},
3634   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3635     0xfbc000c0, 0xfff000e0, "smlald%4'x%c\t%12-15R, %8-11R, %16-19R, %0-3R"},
3636   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3637     0xfbd000c0, 0xfff000e0, "smlsld%4'x%c\t%12-15R, %8-11R, %16-19R, %0-3R"},
3638   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3639     0xeac00000, 0xfff08030, "pkhbt%c\t%8-11r, %16-19r, %S"},
3640   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3641     0xeac00020, 0xfff08030, "pkhtb%c\t%8-11r, %16-19r, %S"},
3642   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3643     0xf3400000, 0xfff08020, "sbfx%c\t%8-11r, %16-19r, %F"},
3644   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3645     0xf3c00000, 0xfff08020, "ubfx%c\t%8-11r, %16-19r, %F"},
3646   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3647     0xf8000e00, 0xff900f00, "str%wt%c\t%12-15r, %a"},
3648   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3649     0xfb100000, 0xfff000c0,
3650     "smla%5?tb%4?tb%c\t%8-11r, %16-19r, %0-3r, %12-15r"},
3651   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3652     0xfbc00080, 0xfff000c0,
3653     "smlal%5?tb%4?tb%c\t%12-15r, %8-11r, %16-19r, %0-3r"},
3654   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3655     0xf3600000, 0xfff08020, "bfi%c\t%8-11r, %16-19r, %E"},
3656   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3657     0xf8100e00, 0xfe900f00, "ldr%wt%c\t%12-15r, %a"},
3658   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3659     0xf3000000, 0xffd08020, "ssat%c\t%8-11r, #%0-4D, %16-19r%s"},
3660   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3661     0xf3800000, 0xffd08020, "usat%c\t%8-11r, #%0-4d, %16-19r%s"},
3662   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3663     0xf2000000, 0xfbf08000, "addw%c\t%8-11r, %16-19r, %I"},
3664   {ARM_FEATURE_CORE_HIGH (ARM_EXT2_V6T2_V8M),
3665     0xf2400000, 0xfbf08000, "movw%c\t%8-11r, %J"},
3666   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3667     0xf2a00000, 0xfbf08000, "subw%c\t%8-11r, %16-19r, %I"},
3668   {ARM_FEATURE_CORE_HIGH (ARM_EXT2_V6T2_V8M),
3669     0xf2c00000, 0xfbf08000, "movt%c\t%8-11r, %J"},
3670   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3671     0xea000000, 0xffe08000, "and%20's%c.w\t%8-11r, %16-19r, %S"},
3672   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3673     0xea200000, 0xffe08000, "bic%20's%c.w\t%8-11r, %16-19r, %S"},
3674   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3675     0xea400000, 0xffe08000, "orr%20's%c.w\t%8-11r, %16-19r, %S"},
3676   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3677     0xea600000, 0xffe08000, "orn%20's%c\t%8-11r, %16-19r, %S"},
3678   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3679     0xea800000, 0xffe08000, "eor%20's%c.w\t%8-11r, %16-19r, %S"},
3680   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3681     0xeb000000, 0xffe08000, "add%20's%c.w\t%8-11r, %16-19r, %S"},
3682   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3683     0xeb400000, 0xffe08000, "adc%20's%c.w\t%8-11r, %16-19r, %S"},
3684   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3685     0xeb600000, 0xffe08000, "sbc%20's%c.w\t%8-11r, %16-19r, %S"},
3686   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3687     0xeba00000, 0xffe08000, "sub%20's%c.w\t%8-11r, %16-19r, %S"},
3688   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3689     0xebc00000, 0xffe08000, "rsb%20's%c\t%8-11r, %16-19r, %S"},
3690   {ARM_FEATURE_CORE_HIGH (ARM_EXT2_V6T2_V8M),
3691     0xe8400000, 0xfff00000, "strex%c\t%8-11r, %12-15r, [%16-19r, #%0-7W]"},
3692   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3693     0xf0000000, 0xfbe08000, "and%20's%c.w\t%8-11r, %16-19r, %M"},
3694   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3695     0xf0200000, 0xfbe08000, "bic%20's%c.w\t%8-11r, %16-19r, %M"},
3696   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3697     0xf0400000, 0xfbe08000, "orr%20's%c.w\t%8-11r, %16-19r, %M"},
3698   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3699     0xf0600000, 0xfbe08000, "orn%20's%c\t%8-11r, %16-19r, %M"},
3700   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3701     0xf0800000, 0xfbe08000, "eor%20's%c.w\t%8-11r, %16-19r, %M"},
3702   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3703     0xf1000000, 0xfbe08000, "add%20's%c.w\t%8-11r, %16-19r, %M"},
3704   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3705     0xf1400000, 0xfbe08000, "adc%20's%c.w\t%8-11r, %16-19r, %M"},
3706   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3707     0xf1600000, 0xfbe08000, "sbc%20's%c.w\t%8-11r, %16-19r, %M"},
3708   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3709     0xf1a00000, 0xfbe08000, "sub%20's%c.w\t%8-11r, %16-19r, %M"},
3710   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3711     0xf1c00000, 0xfbe08000, "rsb%20's%c\t%8-11r, %16-19r, %M"},
3712   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3713     0xe8800000, 0xffd00000, "stmia%c.w\t%16-19r%21'!, %m"},
3714   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3715     0xe8900000, 0xffd00000, "ldmia%c.w\t%16-19r%21'!, %m"},
3716   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3717     0xe9000000, 0xffd00000, "stmdb%c\t%16-19r%21'!, %m"},
3718   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3719     0xe9100000, 0xffd00000, "ldmdb%c\t%16-19r%21'!, %m"},
3720   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3721     0xe9c00000, 0xffd000ff, "strd%c\t%12-15r, %8-11r, [%16-19r]"},
3722   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3723     0xe9d00000, 0xffd000ff, "ldrd%c\t%12-15r, %8-11r, [%16-19r]"},
3724   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3725     0xe9400000, 0xff500000,
3726     "strd%c\t%12-15r, %8-11r, [%16-19r, #%23`-%0-7W]%21'!%L"},
3727   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3728     0xe9500000, 0xff500000,
3729     "ldrd%c\t%12-15r, %8-11r, [%16-19r, #%23`-%0-7W]%21'!%L"},
3730   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3731     0xe8600000, 0xff700000,
3732     "strd%c\t%12-15r, %8-11r, [%16-19r], #%23`-%0-7W%L"},
3733   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3734     0xe8700000, 0xff700000,
3735     "ldrd%c\t%12-15r, %8-11r, [%16-19r], #%23`-%0-7W%L"},
3736   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3737     0xf8000000, 0xff100000, "str%w%c.w\t%12-15r, %a"},
3738   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3739     0xf8100000, 0xfe100000, "ldr%w%c.w\t%12-15r, %a"},
3740
3741   /* Filter out Bcc with cond=E or F, which are used for other instructions.  */
3742   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3743     0xf3c08000, 0xfbc0d000, "undefined (bcc, cond=0xF)"},
3744   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3745     0xf3808000, 0xfbc0d000, "undefined (bcc, cond=0xE)"},
3746   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3747     0xf0008000, 0xf800d000, "b%22-25c.w\t%b%X"},
3748   {ARM_FEATURE_CORE_LOW (ARM_EXT_V6T2),
3749     0xf0009000, 0xf800d000, "b%c.w\t%B%x"},
3750
3751   /* These have been 32-bit since the invention of Thumb.  */
3752   {ARM_FEATURE_CORE_LOW (ARM_EXT_V4T),
3753      0xf000c000, 0xf800d001, "blx%c\t%B%x"},
3754   {ARM_FEATURE_CORE_LOW (ARM_EXT_V4T),
3755      0xf000d000, 0xf800d000, "bl%c\t%B%x"},
3756
3757   /* Fallback.  */
3758   {ARM_FEATURE_CORE_LOW (ARM_EXT_V1),
3759       0x00000000, 0x00000000, UNDEFINED_INSTRUCTION},
3760   {ARM_FEATURE_CORE_LOW (0), 0, 0, 0}
3761 };
3762
3763 static const char *const arm_conditional[] =
3764 {"eq", "ne", "cs", "cc", "mi", "pl", "vs", "vc",
3765  "hi", "ls", "ge", "lt", "gt", "le", "al", "<und>", ""};
3766
3767 static const char *const arm_fp_const[] =
3768 {"0.0", "1.0", "2.0", "3.0", "4.0", "5.0", "0.5", "10.0"};
3769
3770 static const char *const arm_shift[] =
3771 {"lsl", "lsr", "asr", "ror"};
3772
3773 typedef struct
3774 {
3775   const char *name;
3776   const char *description;
3777   const char *reg_names[16];
3778 }
3779 arm_regname;
3780
3781 static const arm_regname regnames[] =
3782 {
3783   { "reg-names-raw", N_("Select raw register names"),
3784     { "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15"}},
3785   { "reg-names-gcc", N_("Select register names used by GCC"),
3786     { "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", "r8", "r9", "sl",  "fp",  "ip",  "sp",  "lr",  "pc" }},
3787   { "reg-names-std", N_("Select register names used in ARM's ISA documentation"),
3788     { "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", "r8", "r9", "r10", "r11", "r12", "sp",  "lr",  "pc" }},
3789   { "force-thumb", N_("Assume all insns are Thumb insns"), {NULL} },
3790   { "no-force-thumb", N_("Examine preceding label to determine an insn's type"), {NULL} },
3791   { "reg-names-apcs", N_("Select register names used in the APCS"),
3792     { "a1", "a2", "a3", "a4", "v1", "v2", "v3", "v4", "v5", "v6", "sl",  "fp",  "ip",  "sp",  "lr",  "pc" }},
3793   { "reg-names-atpcs", N_("Select register names used in the ATPCS"),
3794     { "a1", "a2", "a3", "a4", "v1", "v2", "v3", "v4", "v5", "v6", "v7",  "v8",  "IP",  "SP",  "LR",  "PC" }},
3795   { "reg-names-special-atpcs", N_("Select special register names used in the ATPCS"),
3796     { "a1", "a2", "a3", "a4", "v1", "v2", "v3", "WR", "v5", "SB", "SL",  "FP",  "IP",  "SP",  "LR",  "PC" }}
3797 };
3798
3799 static const char *const iwmmxt_wwnames[] =
3800 {"b", "h", "w", "d"};
3801
3802 static const char *const iwmmxt_wwssnames[] =
3803 {"b", "bus", "bc", "bss",
3804  "h", "hus", "hc", "hss",
3805  "w", "wus", "wc", "wss",
3806  "d", "dus", "dc", "dss"
3807 };
3808
3809 static const char *const iwmmxt_regnames[] =
3810 { "wr0", "wr1", "wr2", "wr3", "wr4", "wr5", "wr6", "wr7",
3811   "wr8", "wr9", "wr10", "wr11", "wr12", "wr13", "wr14", "wr15"
3812 };
3813
3814 static const char *const iwmmxt_cregnames[] =
3815 { "wcid", "wcon", "wcssf", "wcasf", "reserved", "reserved", "reserved", "reserved",
3816   "wcgr0", "wcgr1", "wcgr2", "wcgr3", "reserved", "reserved", "reserved", "reserved"
3817 };
3818
3819 static const char *const vec_condnames[] =
3820 { "eq", "ne", "cs", "hi", "ge", "lt", "gt", "le"
3821 };
3822
3823 static const char *const mve_predicatenames[] =
3824 { "", "ttt", "tt", "tte", "t", "tee", "te", "tet", "",
3825   "eee", "ee", "eet", "e", "ett", "et", "ete"
3826 };
3827
3828 /* Names for 2-bit size field for mve vector isntructions.  */
3829 static const char *const mve_vec_sizename[] =
3830   { "8", "16", "32", "64"};
3831
3832 /* Indicates whether we are processing a then predicate,
3833    else predicate or none at all.  */
3834 enum vpt_pred_state
3835 {
3836   PRED_NONE,
3837   PRED_THEN,
3838   PRED_ELSE
3839 };
3840
3841 /* Information used to process a vpt block and subsequent instructions.  */
3842 struct vpt_block
3843 {
3844   /* Are we in a vpt block.  */
3845   bfd_boolean in_vpt_block;
3846
3847   /* Next predicate state if in vpt block.  */
3848   enum vpt_pred_state next_pred_state;
3849
3850   /* Mask from vpt/vpst instruction.  */
3851   long predicate_mask;
3852
3853   /* Instruction number in vpt block.  */
3854   long current_insn_num;
3855
3856   /* Number of instructions in vpt block..   */
3857   long num_pred_insn;
3858 };
3859
3860 static struct vpt_block vpt_block_state =
3861 {
3862   FALSE,
3863   PRED_NONE,
3864   0,
3865   0,
3866   0
3867 };
3868
3869 /* Default to GCC register name set.  */
3870 static unsigned int regname_selected = 1;
3871
3872 #define NUM_ARM_OPTIONS   ARRAY_SIZE (regnames)
3873 #define arm_regnames      regnames[regname_selected].reg_names
3874
3875 static bfd_boolean force_thumb = FALSE;
3876
3877 /* Current IT instruction state.  This contains the same state as the IT
3878    bits in the CPSR.  */
3879 static unsigned int ifthen_state;
3880 /* IT state for the next instruction.  */
3881 static unsigned int ifthen_next_state;
3882 /* The address of the insn for which the IT state is valid.  */
3883 static bfd_vma ifthen_address;
3884 #define IFTHEN_COND ((ifthen_state >> 4) & 0xf)
3885 /* Indicates that the current Conditional state is unconditional or outside
3886    an IT block.  */
3887 #define COND_UNCOND 16
3888
3889 \f
3890 /* Functions.  */
3891 /* Extract the predicate mask for a VPT or VPST instruction.
3892    The mask is composed of bits 13-15 (Mkl) and bit 22 (Mkh).  */
3893
3894 static long
3895 mve_extract_pred_mask (long given)
3896 {
3897   return ((given & 0x00400000) >> 19) | ((given & 0xe000) >> 13);
3898 }
3899
3900 /* Return the number of instructions in a MVE predicate block.  */
3901 static long
3902 num_instructions_vpt_block (long given)
3903 {
3904   long mask = mve_extract_pred_mask (given);
3905   if (mask == 0)
3906     return 0;
3907
3908   if (mask == 8)
3909     return 1;
3910
3911   if ((mask & 7) == 4)
3912     return 2;
3913
3914   if ((mask & 3) == 2)
3915     return 3;
3916
3917   if ((mask & 1) == 1)
3918     return 4;
3919
3920   return 0;
3921 }
3922
3923 static void
3924 mark_outside_vpt_block (void)
3925 {
3926   vpt_block_state.in_vpt_block = FALSE;
3927   vpt_block_state.next_pred_state = PRED_NONE;
3928   vpt_block_state.predicate_mask = 0;
3929   vpt_block_state.current_insn_num = 0;
3930   vpt_block_state.num_pred_insn = 0;
3931 }
3932
3933 static void
3934 mark_inside_vpt_block (long given)
3935 {
3936   vpt_block_state.in_vpt_block = TRUE;
3937   vpt_block_state.next_pred_state = PRED_THEN;
3938   vpt_block_state.predicate_mask = mve_extract_pred_mask (given);
3939   vpt_block_state.current_insn_num = 0;
3940   vpt_block_state.num_pred_insn = num_instructions_vpt_block (given);
3941   assert (vpt_block_state.num_pred_insn >= 1);
3942 }
3943
3944 static enum vpt_pred_state
3945 invert_next_predicate_state (enum vpt_pred_state astate)
3946 {
3947   if (astate == PRED_THEN)
3948     return PRED_ELSE;
3949   else if (astate == PRED_ELSE)
3950     return PRED_THEN;
3951   else
3952     return PRED_NONE;
3953 }
3954
3955 static enum vpt_pred_state
3956 update_next_predicate_state (void)
3957 {
3958   long pred_mask = vpt_block_state.predicate_mask;
3959   long mask_for_insn = 0;
3960
3961   switch (vpt_block_state.current_insn_num)
3962     {
3963     case 1:
3964       mask_for_insn = 8;
3965       break;
3966
3967     case 2:
3968       mask_for_insn = 4;
3969       break;
3970
3971     case 3:
3972       mask_for_insn = 2;
3973       break;
3974
3975     case 4:
3976       return PRED_NONE;
3977     }
3978
3979   if (pred_mask & mask_for_insn)
3980     return invert_next_predicate_state (vpt_block_state.next_pred_state);
3981   else
3982     return vpt_block_state.next_pred_state;
3983 }
3984
3985 static void
3986 update_vpt_block_state (void)
3987 {
3988   vpt_block_state.current_insn_num++;
3989   if (vpt_block_state.current_insn_num == vpt_block_state.num_pred_insn)
3990     {
3991       /* No more instructions to process in vpt block.  */
3992       mark_outside_vpt_block ();
3993       return;
3994     }
3995
3996   vpt_block_state.next_pred_state = update_next_predicate_state ();
3997 }
3998
3999 /* Decode a bitfield of the form matching regexp (N(-N)?,)*N(-N)?.
4000    Returns pointer to following character of the format string and
4001    fills in *VALUEP and *WIDTHP with the extracted value and number of
4002    bits extracted.  WIDTHP can be NULL.  */
4003
4004 static const char *
4005 arm_decode_bitfield (const char *ptr,
4006                      unsigned long insn,
4007                      unsigned long *valuep,
4008                      int *widthp)
4009 {
4010   unsigned long value = 0;
4011   int width = 0;
4012
4013   do
4014     {
4015       int start, end;
4016       int bits;
4017
4018       for (start = 0; *ptr >= '0' && *ptr <= '9'; ptr++)
4019         start = start * 10 + *ptr - '0';
4020       if (*ptr == '-')
4021         for (end = 0, ptr++; *ptr >= '0' && *ptr <= '9'; ptr++)
4022           end = end * 10 + *ptr - '0';
4023       else
4024         end = start;
4025       bits = end - start;
4026       if (bits < 0)
4027         abort ();
4028       value |= ((insn >> start) & ((2ul << bits) - 1)) << width;
4029       width += bits + 1;
4030     }
4031   while (*ptr++ == ',');
4032   *valuep = value;
4033   if (widthp)
4034     *widthp = width;
4035   return ptr - 1;
4036 }
4037
4038 static void
4039 arm_decode_shift (long given, fprintf_ftype func, void *stream,
4040                   bfd_boolean print_shift)
4041 {
4042   func (stream, "%s", arm_regnames[given & 0xf]);
4043
4044   if ((given & 0xff0) != 0)
4045     {
4046       if ((given & 0x10) == 0)
4047         {
4048           int amount = (given & 0xf80) >> 7;
4049           int shift = (given & 0x60) >> 5;
4050
4051           if (amount == 0)
4052             {
4053               if (shift == 3)
4054                 {
4055                   func (stream, ", rrx");
4056                   return;
4057                 }
4058
4059               amount = 32;
4060             }
4061
4062           if (print_shift)
4063             func (stream, ", %s #%d", arm_shift[shift], amount);
4064           else
4065             func (stream, ", #%d", amount);
4066         }
4067       else if ((given & 0x80) == 0x80)
4068         func (stream, "\t; <illegal shifter operand>");
4069       else if (print_shift)
4070         func (stream, ", %s %s", arm_shift[(given & 0x60) >> 5],
4071               arm_regnames[(given & 0xf00) >> 8]);
4072       else
4073         func (stream, ", %s", arm_regnames[(given & 0xf00) >> 8]);
4074     }
4075 }
4076
4077 /* Return TRUE if the MATCHED_INSN can be inside an IT block.  */
4078
4079 static bfd_boolean
4080 is_mve_okay_in_it (enum mve_instructions matched_insn)
4081 {
4082   return FALSE;
4083 }
4084
4085 static bfd_boolean
4086 is_mve_architecture (struct disassemble_info *info)
4087 {
4088   struct arm_private_data *private_data = info->private_data;
4089   arm_feature_set allowed_arches = private_data->features;
4090
4091   arm_feature_set arm_ext_v8_1m_main
4092     = ARM_FEATURE_CORE_HIGH (ARM_EXT2_V8_1M_MAIN);
4093
4094   if (ARM_CPU_HAS_FEATURE (arm_ext_v8_1m_main, allowed_arches)
4095       && !ARM_CPU_IS_ANY (allowed_arches))
4096     return TRUE;
4097   else
4098     return FALSE;
4099 }
4100
4101 static bfd_boolean
4102 is_vpt_instruction (long given)
4103 {
4104
4105   /* If mkh:mkl is '0000' then its not a vpt/vpst instruction.  */
4106   if ((given & 0x0040e000) == 0)
4107     return FALSE;
4108
4109   /* VPT floating point T1 variant.  */
4110   if (((given & 0xefb10f50) == 0xee310f00 && ((given & 0x1001) != 0x1))
4111   /* VPT floating point T2 variant.  */
4112       || ((given & 0xefb10f50) == 0xee310f40)
4113   /* VPT vector T1 variant.  */
4114       || ((given & 0xff811f51) == 0xfe010f00)
4115   /* VPT vector T2 variant.  */
4116       || ((given & 0xff811f51) == 0xfe010f01
4117           && ((given & 0x300000) != 0x300000))
4118   /* VPT vector T3 variant.  */
4119       || ((given & 0xff811f50) == 0xfe011f00)
4120   /* VPT vector T4 variant.  */
4121       || ((given & 0xff811f70) == 0xfe010f40)
4122   /* VPT vector T5 variant.  */
4123       || ((given & 0xff811f70) == 0xfe010f60)
4124   /* VPT vector T6 variant.  */
4125       || ((given & 0xff811f50) == 0xfe011f40)
4126   /* VPST vector T variant.  */
4127       || ((given & 0xffbf1fff) == 0xfe310f4d))
4128     return TRUE;
4129   else
4130     return FALSE;
4131 }
4132
4133 /* Decode a bitfield from opcode GIVEN, with starting bitfield = START
4134    and ending bitfield = END.  END must be greater than START.  */
4135
4136 static unsigned long
4137 arm_decode_field (unsigned long given, unsigned int start, unsigned int end)
4138 {
4139   int bits = end - start;
4140
4141   if (bits < 0)
4142     abort ();
4143
4144   return ((given >> start) & ((2ul << bits) - 1));
4145 }
4146
4147 /* Decode a bitfield from opcode GIVEN, with multiple bitfields:
4148    START:END and START2:END2.  END/END2 must be greater than
4149    START/START2.  */
4150
4151 static unsigned long
4152 arm_decode_field_multiple (unsigned long given, unsigned int start,
4153                            unsigned int end, unsigned int start2,
4154                            unsigned int end2)
4155 {
4156   int bits = end - start;
4157   int bits2 = end2 - start2;
4158   unsigned long value = 0;
4159   int width = 0;
4160
4161   if (bits2 < 0)
4162     abort ();
4163
4164   value = arm_decode_field (given, start, end);
4165   width += bits + 1;
4166
4167   value |= ((given >> start2) & ((2ul << bits2) - 1)) << width;
4168   return value;
4169 }
4170
4171 /* Return TRUE if the GIVEN encoding should not be decoded as MATCHED_INSN.
4172    This helps us decode instructions that change mnemonic depending on specific
4173    operand values/encodings.  */
4174
4175 static bfd_boolean
4176 is_mve_encoding_conflict (unsigned long given,
4177                           enum mve_instructions matched_insn)
4178 {
4179   switch (matched_insn)
4180     {
4181     case MVE_VPST:
4182       if (arm_decode_field_multiple (given, 13, 15, 22, 22) == 0)
4183         return TRUE;
4184       else
4185         return FALSE;
4186
4187     case MVE_VPT_FP_T1:
4188       if (arm_decode_field_multiple (given, 13, 15, 22, 22) == 0)
4189         return TRUE;
4190       if ((arm_decode_field (given, 12, 12) == 0)
4191           && (arm_decode_field (given, 0, 0) == 1))
4192         return TRUE;
4193       return FALSE;
4194
4195     case MVE_VPT_FP_T2:
4196       if (arm_decode_field_multiple (given, 13, 15, 22, 22) == 0)
4197         return TRUE;
4198       if (arm_decode_field (given, 0, 3) == 0xd)
4199         return TRUE;
4200       return FALSE;
4201
4202     case MVE_VPT_VEC_T1:
4203     case MVE_VPT_VEC_T2:
4204     case MVE_VPT_VEC_T3:
4205     case MVE_VPT_VEC_T4:
4206     case MVE_VPT_VEC_T5:
4207     case MVE_VPT_VEC_T6:
4208       if (arm_decode_field_multiple (given, 13, 15, 22, 22) == 0)
4209         return TRUE;
4210       if (arm_decode_field (given, 20, 21) == 3)
4211         return TRUE;
4212       return FALSE;
4213
4214     case MVE_VCMP_FP_T1:
4215       if ((arm_decode_field (given, 12, 12) == 0)
4216           && (arm_decode_field (given, 0, 0) == 1))
4217         return TRUE;
4218       else
4219         return FALSE;
4220
4221     case MVE_VCMP_FP_T2:
4222       if (arm_decode_field (given, 0, 3) == 0xd)
4223         return TRUE;
4224       else
4225         return FALSE;
4226
4227     case MVE_VHADD_T2:
4228     case MVE_VHSUB_T2:
4229     case MVE_VCMP_VEC_T1:
4230     case MVE_VCMP_VEC_T2:
4231     case MVE_VCMP_VEC_T3:
4232     case MVE_VCMP_VEC_T4:
4233     case MVE_VCMP_VEC_T5:
4234     case MVE_VCMP_VEC_T6:
4235       if (arm_decode_field (given, 20, 21) == 3)
4236         return TRUE;
4237       else
4238         return FALSE;
4239
4240     case MVE_VLD2:
4241     case MVE_VLD4:
4242     case MVE_VST2:
4243     case MVE_VST4:
4244       if (arm_decode_field (given, 7, 8) == 3)
4245         return TRUE;
4246       else
4247         return FALSE;
4248
4249     case MVE_VSTRB_T1:
4250     case MVE_VSTRH_T2:
4251       if ((arm_decode_field (given, 24, 24) == 0)
4252           && (arm_decode_field (given, 21, 21) == 0))
4253         {
4254             return TRUE;
4255         }
4256       else if ((arm_decode_field (given, 7, 8) == 3))
4257         return TRUE;
4258       else
4259         return FALSE;
4260
4261     case MVE_VSTRB_T5:
4262     case MVE_VSTRH_T6:
4263     case MVE_VSTRW_T7:
4264       if ((arm_decode_field (given, 24, 24) == 0)
4265           && (arm_decode_field (given, 21, 21) == 0))
4266         {
4267             return TRUE;
4268         }
4269       else
4270         return FALSE;
4271
4272     default:
4273       return FALSE;
4274
4275     }
4276 }
4277
4278 static void
4279 print_mve_vld_str_addr (struct disassemble_info *info,
4280                         unsigned long given,
4281                         enum mve_instructions matched_insn)
4282 {
4283   void *stream = info->stream;
4284   fprintf_ftype func = info->fprintf_func;
4285
4286   unsigned long p, w, gpr, imm, add, mod_imm;
4287
4288   imm = arm_decode_field (given, 0, 6);
4289   mod_imm = imm;
4290
4291   switch (matched_insn)
4292     {
4293     case MVE_VLDRB_T1:
4294     case MVE_VSTRB_T1:
4295       gpr = arm_decode_field (given, 16, 18);
4296       break;
4297
4298     case MVE_VLDRH_T2:
4299     case MVE_VSTRH_T2:
4300       gpr = arm_decode_field (given, 16, 18);
4301       mod_imm = imm << 1;
4302       break;
4303
4304     case MVE_VLDRH_T6:
4305     case MVE_VSTRH_T6:
4306       gpr = arm_decode_field (given, 16, 19);
4307       mod_imm = imm << 1;
4308       break;
4309
4310     case MVE_VLDRW_T7:
4311     case MVE_VSTRW_T7:
4312       gpr = arm_decode_field (given, 16, 19);
4313       mod_imm = imm << 2;
4314       break;
4315
4316     case MVE_VLDRB_T5:
4317     case MVE_VSTRB_T5:
4318       gpr = arm_decode_field (given, 16, 19);
4319       break;
4320
4321     default:
4322       return;
4323     }
4324
4325   p = arm_decode_field (given, 24, 24);
4326   w = arm_decode_field (given, 21, 21);
4327
4328   add = arm_decode_field (given, 23, 23);
4329
4330   char * add_sub;
4331
4332   /* Don't print anything for '+' as it is implied.  */
4333   if (add == 1)
4334     add_sub = "";
4335   else
4336     add_sub = "-";
4337
4338   if (p == 1)
4339     {
4340       /* Offset mode.  */
4341       if (w == 0)
4342         func (stream, "[%s, #%s%lu]", arm_regnames[gpr], add_sub, mod_imm);
4343       /* Pre-indexed mode.  */
4344       else
4345         func (stream, "[%s, #%s%lu]!", arm_regnames[gpr], add_sub, mod_imm);
4346     }
4347   else if ((p == 0) && (w == 1))
4348     /* Post-index mode.  */
4349     func (stream, "[%s], #%s%lu", arm_regnames[gpr], add_sub, mod_imm);
4350 }
4351
4352 /* Return FALSE if GIVEN is not an undefined encoding for MATCHED_INSN.
4353    Otherwise, return TRUE and set UNDEFINED_CODE to give a reason as to why
4354    this encoding is undefined.  */
4355
4356 static bfd_boolean
4357 is_mve_undefined (unsigned long given, enum mve_instructions matched_insn,
4358                   enum mve_undefined *undefined_code)
4359 {
4360   *undefined_code = UNDEF_NONE;
4361
4362   switch (matched_insn)
4363     {
4364     case MVE_VDUP:
4365       if (arm_decode_field_multiple (given, 5, 5, 22, 22) == 3)
4366         {
4367           *undefined_code = UNDEF_SIZE_3;
4368           return TRUE;
4369         }
4370       else
4371         return FALSE;
4372
4373     case MVE_VRHADD:
4374     case MVE_VHADD_T1:
4375     case MVE_VHSUB_T1:
4376       if (arm_decode_field (given, 20, 21) == 3)
4377         {
4378           *undefined_code = UNDEF_SIZE_3;
4379           return TRUE;
4380         }
4381       else
4382         return FALSE;
4383
4384     case MVE_VLDRB_T1:
4385       if (arm_decode_field (given, 7, 8) == 3)
4386         {
4387           *undefined_code = UNDEF_SIZE_3;
4388           return TRUE;
4389         }
4390       else
4391         return FALSE;
4392
4393     case MVE_VLDRH_T2:
4394       if (arm_decode_field (given, 7, 8) <= 1)
4395         {
4396           *undefined_code = UNDEF_SIZE_LE_1;
4397           return TRUE;
4398         }
4399       else
4400         return FALSE;
4401
4402     case MVE_VSTRB_T1:
4403       if ((arm_decode_field (given, 7, 8) == 0))
4404         {
4405           *undefined_code = UNDEF_SIZE_0;
4406           return TRUE;
4407         }
4408       else
4409         return FALSE;
4410
4411     case MVE_VSTRH_T2:
4412       if ((arm_decode_field (given, 7, 8) <= 1))
4413         {
4414           *undefined_code = UNDEF_SIZE_LE_1;
4415           return TRUE;
4416         }
4417       else
4418         return FALSE;
4419
4420     case MVE_VLDRB_GATHER_T1:
4421       if (arm_decode_field (given, 7, 8) == 3)
4422         {
4423           *undefined_code = UNDEF_SIZE_3;
4424           return TRUE;
4425         }
4426       else if ((arm_decode_field (given, 28, 28) == 0)
4427                && (arm_decode_field (given, 7, 8) == 0))
4428         {
4429           *undefined_code = UNDEF_NOT_UNS_SIZE_0;
4430           return TRUE;
4431         }
4432       else
4433         return FALSE;
4434
4435     case MVE_VLDRH_GATHER_T2:
4436       if (arm_decode_field (given, 7, 8) == 3)
4437         {
4438           *undefined_code = UNDEF_SIZE_3;
4439           return TRUE;
4440         }
4441       else if ((arm_decode_field (given, 28, 28) == 0)
4442                && (arm_decode_field (given, 7, 8) == 1))
4443         {
4444           *undefined_code = UNDEF_NOT_UNS_SIZE_1;
4445           return TRUE;
4446         }
4447       else if (arm_decode_field (given, 7, 8) == 0)
4448         {
4449           *undefined_code = UNDEF_SIZE_0;
4450           return TRUE;
4451         }
4452       else
4453         return FALSE;
4454
4455     case MVE_VLDRW_GATHER_T3:
4456       if (arm_decode_field (given, 7, 8) != 2)
4457         {
4458           *undefined_code = UNDEF_SIZE_NOT_2;
4459           return TRUE;
4460         }
4461       else if (arm_decode_field (given, 28, 28) == 0)
4462         {
4463           *undefined_code = UNDEF_NOT_UNSIGNED;
4464           return TRUE;
4465         }
4466       else
4467         return FALSE;
4468
4469     case MVE_VLDRD_GATHER_T4:
4470       if (arm_decode_field (given, 7, 8) != 3)
4471         {
4472           *undefined_code = UNDEF_SIZE_NOT_3;
4473           return TRUE;
4474         }
4475       else if (arm_decode_field (given, 28, 28) == 0)
4476         {
4477           *undefined_code = UNDEF_NOT_UNSIGNED;
4478           return TRUE;
4479         }
4480       else
4481         return FALSE;
4482
4483     case MVE_VSTRB_SCATTER_T1:
4484       if (arm_decode_field (given, 7, 8) == 3)
4485         {
4486           *undefined_code = UNDEF_SIZE_3;
4487           return TRUE;
4488         }
4489       else
4490         return FALSE;
4491
4492     case MVE_VSTRH_SCATTER_T2:
4493       {
4494         unsigned long size = arm_decode_field (given, 7, 8);
4495         if (size == 3)
4496           {
4497             *undefined_code = UNDEF_SIZE_3;
4498             return TRUE;
4499           }
4500         else if (size == 0)
4501           {
4502             *undefined_code = UNDEF_SIZE_0;
4503             return TRUE;
4504           }
4505         else
4506           return FALSE;
4507       }
4508
4509     case MVE_VSTRW_SCATTER_T3:
4510       if (arm_decode_field (given, 7, 8) != 2)
4511         {
4512           *undefined_code = UNDEF_SIZE_NOT_2;
4513           return TRUE;
4514         }
4515       else
4516         return FALSE;
4517
4518     case MVE_VSTRD_SCATTER_T4:
4519       if (arm_decode_field (given, 7, 8) != 3)
4520         {
4521           *undefined_code = UNDEF_SIZE_NOT_3;
4522           return TRUE;
4523         }
4524       else
4525         return FALSE;
4526
4527     default:
4528       return FALSE;
4529     }
4530 }
4531
4532 /* Return FALSE if GIVEN is not an unpredictable encoding for MATCHED_INSN.
4533    Otherwise, return TRUE and set UNPREDICTABLE_CODE to give a reason as to
4534    why this encoding is unpredictable.  */
4535
4536 static bfd_boolean
4537 is_mve_unpredictable (unsigned long given, enum mve_instructions matched_insn,
4538                       enum mve_unpredictable *unpredictable_code)
4539 {
4540   *unpredictable_code = UNPRED_NONE;
4541
4542   switch (matched_insn)
4543     {
4544     case MVE_VCMP_FP_T2:
4545     case MVE_VPT_FP_T2:
4546       if ((arm_decode_field (given, 12, 12) == 0)
4547           && (arm_decode_field (given, 5, 5) == 1))
4548         {
4549           *unpredictable_code = UNPRED_FCA_0_FCB_1;
4550           return TRUE;
4551         }
4552       else
4553         return FALSE;
4554
4555     case MVE_VPT_VEC_T4:
4556     case MVE_VPT_VEC_T5:
4557     case MVE_VPT_VEC_T6:
4558     case MVE_VCMP_VEC_T4:
4559     case MVE_VCMP_VEC_T5:
4560     case MVE_VCMP_VEC_T6:
4561       if (arm_decode_field (given, 0, 3) == 0xd)
4562         {
4563           *unpredictable_code = UNPRED_R13;
4564           return TRUE;
4565         }
4566       else
4567         return FALSE;
4568
4569     case MVE_VDUP:
4570       {
4571         unsigned long gpr = arm_decode_field (given, 12, 15);
4572         if (gpr == 0xd)
4573           {
4574             *unpredictable_code = UNPRED_R13;
4575             return TRUE;
4576           }
4577         else if (gpr == 0xf)
4578           {
4579             *unpredictable_code = UNPRED_R15;
4580             return TRUE;
4581           }
4582
4583         return FALSE;
4584       }
4585
4586     case MVE_VFMA_FP_SCALAR:
4587     case MVE_VFMAS_FP_SCALAR:
4588     case MVE_VHADD_T2:
4589     case MVE_VHSUB_T2:
4590       {
4591         unsigned long gpr = arm_decode_field (given, 0, 3);
4592         if (gpr == 0xd)
4593           {
4594             *unpredictable_code = UNPRED_R13;
4595             return TRUE;
4596           }
4597         else if (gpr == 0xf)
4598           {
4599             *unpredictable_code = UNPRED_R15;
4600             return TRUE;
4601           }
4602
4603         return FALSE;
4604       }
4605
4606     case MVE_VLD2:
4607     case MVE_VST2:
4608       {
4609         unsigned long rn = arm_decode_field (given, 16, 19);
4610
4611         if ((rn == 0xd) && (arm_decode_field (given, 21, 21) == 1))
4612           {
4613             *unpredictable_code = UNPRED_R13_AND_WB;
4614             return TRUE;
4615           }
4616
4617         if (rn == 0xf)
4618           {
4619             *unpredictable_code = UNPRED_R15;
4620             return TRUE;
4621           }
4622
4623         if (arm_decode_field_multiple (given, 13, 15, 22, 22) > 6)
4624           {
4625             *unpredictable_code = UNPRED_Q_GT_6;
4626             return TRUE;
4627           }
4628         else
4629           return FALSE;
4630       }
4631
4632     case MVE_VLD4:
4633     case MVE_VST4:
4634       {
4635         unsigned long rn = arm_decode_field (given, 16, 19);
4636
4637         if ((rn == 0xd) && (arm_decode_field (given, 21, 21) == 1))
4638           {
4639             *unpredictable_code = UNPRED_R13_AND_WB;
4640             return TRUE;
4641           }
4642
4643         if (rn == 0xf)
4644           {
4645             *unpredictable_code = UNPRED_R15;
4646             return TRUE;
4647           }
4648
4649         if (arm_decode_field_multiple (given, 13, 15, 22, 22) > 4)
4650           {
4651             *unpredictable_code = UNPRED_Q_GT_4;
4652             return TRUE;
4653           }
4654         else
4655           return FALSE;
4656       }
4657
4658     case MVE_VLDRB_T5:
4659     case MVE_VLDRH_T6:
4660     case MVE_VLDRW_T7:
4661     case MVE_VSTRB_T5:
4662     case MVE_VSTRH_T6:
4663     case MVE_VSTRW_T7:
4664       {
4665         unsigned long rn = arm_decode_field (given, 16, 19);
4666
4667         if ((rn == 0xd) && (arm_decode_field (given, 21, 21) == 1))
4668           {
4669             *unpredictable_code = UNPRED_R13_AND_WB;
4670             return TRUE;
4671           }
4672         else if (rn == 0xf)
4673           {
4674             *unpredictable_code = UNPRED_R15;
4675             return TRUE;
4676           }
4677         else
4678           return FALSE;
4679       }
4680
4681     case MVE_VLDRB_GATHER_T1:
4682       if (arm_decode_field (given, 0, 0) == 1)
4683         {
4684           *unpredictable_code = UNPRED_OS;
4685           return TRUE;
4686         }
4687
4688       /*  fall through.  */
4689       /* To handle common code with T2-T4 variants.  */
4690     case MVE_VLDRH_GATHER_T2:
4691     case MVE_VLDRW_GATHER_T3:
4692     case MVE_VLDRD_GATHER_T4:
4693       {
4694         unsigned long qd = arm_decode_field_multiple (given, 13, 15, 22, 22);
4695         unsigned long qm = arm_decode_field_multiple (given, 1, 3, 5, 5);
4696
4697         if (qd == qm)
4698           {
4699             *unpredictable_code = UNPRED_Q_REGS_EQUAL;
4700             return TRUE;
4701           }
4702
4703         if (arm_decode_field (given, 16, 19) == 0xf)
4704           {
4705             *unpredictable_code = UNPRED_R15;
4706             return TRUE;
4707           }
4708
4709         return FALSE;
4710       }
4711
4712     case MVE_VLDRW_GATHER_T5:
4713     case MVE_VLDRD_GATHER_T6:
4714       {
4715         unsigned long qd = arm_decode_field_multiple (given, 13, 15, 22, 22);
4716         unsigned long qm = arm_decode_field_multiple (given, 17, 19, 7, 7);
4717
4718         if (qd == qm)
4719           {
4720             *unpredictable_code = UNPRED_Q_REGS_EQUAL;
4721             return TRUE;
4722           }
4723         else
4724           return FALSE;
4725       }
4726
4727     case MVE_VSTRB_SCATTER_T1:
4728       if (arm_decode_field (given, 16, 19) == 0xf)
4729         {
4730           *unpredictable_code = UNPRED_R15;
4731           return TRUE;
4732         }
4733       else if (arm_decode_field (given, 0, 0) == 1)
4734         {
4735           *unpredictable_code = UNPRED_OS;
4736           return TRUE;
4737         }
4738       else
4739         return FALSE;
4740
4741     case MVE_VSTRH_SCATTER_T2:
4742     case MVE_VSTRW_SCATTER_T3:
4743     case MVE_VSTRD_SCATTER_T4:
4744       if (arm_decode_field (given, 16, 19) == 0xf)
4745         {
4746           *unpredictable_code = UNPRED_R15;
4747           return TRUE;
4748         }
4749       else
4750         return FALSE;
4751
4752     default:
4753       return FALSE;
4754     }
4755 }
4756
4757 static void
4758 print_mve_undefined (struct disassemble_info *info,
4759                      enum mve_undefined undefined_code)
4760 {
4761   void *stream = info->stream;
4762   fprintf_ftype func = info->fprintf_func;
4763
4764   func (stream, "\t\tundefined instruction: ");
4765
4766   switch (undefined_code)
4767     {
4768     case UNDEF_SIZE_0:
4769       func (stream, "size equals zero");
4770       break;
4771
4772     case UNDEF_SIZE_3:
4773       func (stream, "size equals three");
4774       break;
4775
4776     case UNDEF_SIZE_LE_1:
4777       func (stream, "size <= 1");
4778       break;
4779
4780     case UNDEF_SIZE_NOT_2:
4781       func (stream, "size not equal to 2");
4782       break;
4783
4784     case UNDEF_SIZE_NOT_3:
4785       func (stream, "size not equal to 3");
4786       break;
4787
4788     case UNDEF_NOT_UNS_SIZE_0:
4789       func (stream, "not unsigned and size = zero");
4790       break;
4791
4792     case UNDEF_NOT_UNS_SIZE_1:
4793       func (stream, "not unsigned and size = one");
4794       break;
4795
4796     case UNDEF_NOT_UNSIGNED:
4797       func (stream, "not unsigned");
4798       break;
4799
4800     case UNDEF_NONE:
4801       break;
4802     }
4803
4804 }
4805
4806 static void
4807 print_mve_unpredictable (struct disassemble_info *info,
4808                          enum mve_unpredictable unpredict_code)
4809 {
4810   void *stream = info->stream;
4811   fprintf_ftype func = info->fprintf_func;
4812
4813   func (stream, "%s: ", UNPREDICTABLE_INSTRUCTION);
4814
4815   switch (unpredict_code)
4816     {
4817     case UNPRED_IT_BLOCK:
4818       func (stream, "mve instruction in it block");
4819       break;
4820
4821     case UNPRED_FCA_0_FCB_1:
4822       func (stream, "condition bits, fca = 0 and fcb = 1");
4823       break;
4824
4825     case UNPRED_R13:
4826       func (stream, "use of r13 (sp)");
4827       break;
4828
4829     case UNPRED_R15:
4830       func (stream, "use of r15 (pc)");
4831       break;
4832
4833     case UNPRED_Q_GT_4:
4834       func (stream, "start register block > r4");
4835       break;
4836
4837     case UNPRED_Q_GT_6:
4838       func (stream, "start register block > r6");
4839       break;
4840
4841     case UNPRED_R13_AND_WB:
4842       func (stream, "use of r13 and write back");
4843       break;
4844
4845     case UNPRED_Q_REGS_EQUAL:
4846       func (stream,
4847             "same vector register used for destination and other operand");
4848       break;
4849
4850     case UNPRED_OS:
4851       func (stream, "use of offset scaled");
4852       break;
4853
4854     case UNPRED_NONE:
4855       break;
4856     }
4857 }
4858
4859 /* Print register block operand for mve vld2/vld4/vst2/vld4.  */
4860
4861 static void
4862 print_mve_register_blocks (struct disassemble_info *info,
4863                            unsigned long given,
4864                            enum mve_instructions matched_insn)
4865 {
4866   void *stream = info->stream;
4867   fprintf_ftype func = info->fprintf_func;
4868
4869   unsigned long q_reg_start = arm_decode_field_multiple (given,
4870                                                          13, 15,
4871                                                          22, 22);
4872   switch (matched_insn)
4873     {
4874     case MVE_VLD2:
4875     case MVE_VST2:
4876       if (q_reg_start <= 6)
4877         func (stream, "{q%ld, q%ld}", q_reg_start, q_reg_start + 1);
4878       else
4879         func (stream, "<illegal reg q%ld>", q_reg_start);
4880       break;
4881
4882     case MVE_VLD4:
4883     case MVE_VST4:
4884       if (q_reg_start <= 4)
4885         func (stream, "{q%ld, q%ld, q%ld, q%ld}", q_reg_start,
4886               q_reg_start + 1, q_reg_start + 2,
4887               q_reg_start + 3);
4888       else
4889         func (stream, "<illegal reg q%ld>", q_reg_start);
4890       break;
4891
4892     default:
4893       break;
4894     }
4895 }
4896
4897 static void
4898 print_instruction_predicate (struct disassemble_info *info)
4899 {
4900   void *stream = info->stream;
4901   fprintf_ftype func = info->fprintf_func;
4902
4903   if (vpt_block_state.next_pred_state == PRED_THEN)
4904     func (stream, "t");
4905   else if (vpt_block_state.next_pred_state == PRED_ELSE)
4906     func (stream, "e");
4907 }
4908
4909 static void
4910 print_mve_size (struct disassemble_info *info,
4911                 unsigned long size,
4912                 enum mve_instructions matched_insn)
4913 {
4914   void *stream = info->stream;
4915   fprintf_ftype func = info->fprintf_func;
4916
4917   switch (matched_insn)
4918     {
4919     case MVE_VCMP_VEC_T1:
4920     case MVE_VCMP_VEC_T2:
4921     case MVE_VCMP_VEC_T3:
4922     case MVE_VCMP_VEC_T4:
4923     case MVE_VCMP_VEC_T5:
4924     case MVE_VCMP_VEC_T6:
4925     case MVE_VHADD_T1:
4926     case MVE_VHADD_T2:
4927     case MVE_VHSUB_T1:
4928     case MVE_VHSUB_T2:
4929     case MVE_VLD2:
4930     case MVE_VLD4:
4931     case MVE_VLDRB_GATHER_T1:
4932     case MVE_VLDRH_GATHER_T2:
4933     case MVE_VLDRW_GATHER_T3:
4934     case MVE_VLDRD_GATHER_T4:
4935     case MVE_VLDRB_T1:
4936     case MVE_VLDRH_T2:
4937     case MVE_VPT_VEC_T1:
4938     case MVE_VPT_VEC_T2:
4939     case MVE_VPT_VEC_T3:
4940     case MVE_VPT_VEC_T4:
4941     case MVE_VPT_VEC_T5:
4942     case MVE_VPT_VEC_T6:
4943     case MVE_VRHADD:
4944     case MVE_VST2:
4945     case MVE_VST4:
4946     case MVE_VSTRB_SCATTER_T1:
4947     case MVE_VSTRH_SCATTER_T2:
4948     case MVE_VSTRW_SCATTER_T3:
4949     case MVE_VSTRB_T1:
4950     case MVE_VSTRH_T2:
4951       if (size <= 3)
4952         func (stream, "%s", mve_vec_sizename[size]);
4953       else
4954         func (stream, "<undef size>");
4955       break;
4956
4957     case MVE_VCMP_FP_T1:
4958     case MVE_VCMP_FP_T2:
4959     case MVE_VFMA_FP_SCALAR:
4960     case MVE_VFMA_FP:
4961     case MVE_VFMS_FP:
4962     case MVE_VFMAS_FP_SCALAR:
4963     case MVE_VPT_FP_T1:
4964     case MVE_VPT_FP_T2:
4965       if (size == 0)
4966         func (stream, "32");
4967       else if (size == 1)
4968         func (stream, "16");
4969       break;
4970
4971     case MVE_VDUP:
4972       switch (size)
4973         {
4974         case 0:
4975           func (stream, "32");
4976           break;
4977         case 1:
4978           func (stream, "16");
4979           break;
4980         case 2:
4981           func (stream, "8");
4982           break;
4983         default:
4984           break;
4985         }
4986       break;
4987
4988     default:
4989       break;
4990     }
4991 }
4992
4993 static void
4994 print_vec_condition (struct disassemble_info *info, long given,
4995                      enum mve_instructions matched_insn)
4996 {
4997   void *stream = info->stream;
4998   fprintf_ftype func = info->fprintf_func;
4999   long vec_cond = 0;
5000
5001   switch (matched_insn)
5002     {
5003     case MVE_VPT_FP_T1:
5004     case MVE_VCMP_FP_T1:
5005       vec_cond = (((given & 0x1000) >> 10)
5006                   | ((given & 1) << 1)
5007                   | ((given & 0x0080) >> 7));
5008       func (stream, "%s",vec_condnames[vec_cond]);
5009       break;
5010
5011     case MVE_VPT_FP_T2:
5012     case MVE_VCMP_FP_T2:
5013       vec_cond = (((given & 0x1000) >> 10)
5014                   | ((given & 0x0020) >> 4)
5015                   | ((given & 0x0080) >> 7));
5016       func (stream, "%s",vec_condnames[vec_cond]);
5017       break;
5018
5019     case MVE_VPT_VEC_T1:
5020     case MVE_VCMP_VEC_T1:
5021       vec_cond = (given & 0x0080) >> 7;
5022       func (stream, "%s",vec_condnames[vec_cond]);
5023       break;
5024
5025     case MVE_VPT_VEC_T2:
5026     case MVE_VCMP_VEC_T2:
5027       vec_cond = 2 | ((given & 0x0080) >> 7);
5028       func (stream, "%s",vec_condnames[vec_cond]);
5029       break;
5030
5031     case MVE_VPT_VEC_T3:
5032     case MVE_VCMP_VEC_T3:
5033       vec_cond = 4 | ((given & 1) << 1) | ((given & 0x0080) >> 7);
5034       func (stream, "%s",vec_condnames[vec_cond]);
5035       break;
5036
5037     case MVE_VPT_VEC_T4:
5038     case MVE_VCMP_VEC_T4:
5039       vec_cond = (given & 0x0080) >> 7;
5040       func (stream, "%s",vec_condnames[vec_cond]);
5041       break;
5042
5043     case MVE_VPT_VEC_T5:
5044     case MVE_VCMP_VEC_T5:
5045       vec_cond = 2 | ((given & 0x0080) >> 7);
5046       func (stream, "%s",vec_condnames[vec_cond]);
5047       break;
5048
5049     case MVE_VPT_VEC_T6:
5050     case MVE_VCMP_VEC_T6:
5051       vec_cond = 4 | ((given & 0x0020) >> 4) | ((given & 0x0080) >> 7);
5052       func (stream, "%s",vec_condnames[vec_cond]);
5053       break;
5054
5055     case MVE_NONE:
5056     case MVE_VPST:
5057     default:
5058       break;
5059     }
5060 }
5061
5062 #define W_BIT 21
5063 #define I_BIT 22
5064 #define U_BIT 23
5065 #define P_BIT 24
5066
5067 #define WRITEBACK_BIT_SET (given & (1 << W_BIT))
5068 #define IMMEDIATE_BIT_SET (given & (1 << I_BIT))
5069 #define NEGATIVE_BIT_SET  ((given & (1 << U_BIT)) == 0)
5070 #define PRE_BIT_SET       (given & (1 << P_BIT))
5071
5072
5073 /* Print one coprocessor instruction on INFO->STREAM.
5074    Return TRUE if the instuction matched, FALSE if this is not a
5075    recognised coprocessor instruction.  */
5076
5077 static bfd_boolean
5078 print_insn_coprocessor (bfd_vma pc,
5079                         struct disassemble_info *info,
5080                         long given,
5081                         bfd_boolean thumb)
5082 {
5083   const struct sopcode32 *insn;
5084   void *stream = info->stream;
5085   fprintf_ftype func = info->fprintf_func;
5086   unsigned long mask;
5087   unsigned long value = 0;
5088   int cond;
5089   int cp_num;
5090   struct arm_private_data *private_data = info->private_data;
5091   arm_feature_set allowed_arches = ARM_ARCH_NONE;
5092   arm_feature_set arm_ext_v8_1m_main =
5093     ARM_FEATURE_CORE_HIGH (ARM_EXT2_V8_1M_MAIN);
5094
5095   allowed_arches = private_data->features;
5096
5097   for (insn = coprocessor_opcodes; insn->assembler; insn++)
5098     {
5099       unsigned long u_reg = 16;
5100       bfd_boolean is_unpredictable = FALSE;
5101       signed long value_in_comment = 0;
5102       const char *c;
5103
5104       if (ARM_FEATURE_ZERO (insn->arch))
5105         switch (insn->value)
5106           {
5107           case SENTINEL_IWMMXT_START:
5108             if (info->mach != bfd_mach_arm_XScale
5109                 && info->mach != bfd_mach_arm_iWMMXt
5110                 && info->mach != bfd_mach_arm_iWMMXt2)
5111               do
5112                 insn++;
5113               while ((! ARM_FEATURE_ZERO (insn->arch))
5114                      && insn->value != SENTINEL_IWMMXT_END);
5115             continue;
5116
5117           case SENTINEL_IWMMXT_END:
5118             continue;
5119
5120           case SENTINEL_GENERIC_START:
5121             allowed_arches = private_data->features;
5122             continue;
5123
5124           default:
5125             abort ();
5126           }
5127
5128       mask = insn->mask;
5129       value = insn->value;
5130       cp_num = (given >> 8) & 0xf;
5131
5132       if (thumb)
5133         {
5134           /* The high 4 bits are 0xe for Arm conditional instructions, and
5135              0xe for arm unconditional instructions.  The rest of the
5136              encoding is the same.  */
5137           mask |= 0xf0000000;
5138           value |= 0xe0000000;
5139           if (ifthen_state)
5140             cond = IFTHEN_COND;
5141           else
5142             cond = COND_UNCOND;
5143         }
5144       else
5145         {
5146           /* Only match unconditional instuctions against unconditional
5147              patterns.  */
5148           if ((given & 0xf0000000) == 0xf0000000)
5149             {
5150               mask |= 0xf0000000;
5151               cond = COND_UNCOND;
5152             }
5153           else
5154             {
5155               cond = (given >> 28) & 0xf;
5156               if (cond == 0xe)
5157                 cond = COND_UNCOND;
5158             }
5159         }
5160
5161       if ((insn->isa == T32 && !thumb)
5162           || (insn->isa == ARM && thumb))
5163         continue;
5164
5165       if ((given & mask) != value)
5166         continue;
5167
5168       if (! ARM_CPU_HAS_FEATURE (insn->arch, allowed_arches))
5169         continue;
5170
5171       if (insn->value == 0xfe000010     /* mcr2  */
5172           || insn->value == 0xfe100010  /* mrc2  */
5173           || insn->value == 0xfc100000  /* ldc2  */
5174           || insn->value == 0xfc000000) /* stc2  */
5175         {
5176           if (cp_num == 9 || cp_num == 10 || cp_num == 11)
5177             is_unpredictable = TRUE;
5178
5179           /* Armv8.1-M Mainline FP & MVE instructions.  */
5180           if (ARM_CPU_HAS_FEATURE (arm_ext_v8_1m_main, allowed_arches)
5181               && !ARM_CPU_IS_ANY (allowed_arches)
5182               && (cp_num == 8 || cp_num == 14 || cp_num == 15))
5183             continue;
5184
5185         }
5186       else if (insn->value == 0x0e000000     /* cdp  */
5187                || insn->value == 0xfe000000  /* cdp2  */
5188                || insn->value == 0x0e000010  /* mcr  */
5189                || insn->value == 0x0e100010  /* mrc  */
5190                || insn->value == 0x0c100000  /* ldc  */
5191                || insn->value == 0x0c000000) /* stc  */
5192         {
5193           /* Floating-point instructions.  */
5194           if (cp_num == 9 || cp_num == 10 || cp_num == 11)
5195             continue;
5196
5197           /* Armv8.1-M Mainline FP & MVE instructions.  */
5198           if (ARM_CPU_HAS_FEATURE (arm_ext_v8_1m_main, allowed_arches)
5199               && !ARM_CPU_IS_ANY (allowed_arches)
5200               && (cp_num == 8 || cp_num == 14 || cp_num == 15))
5201             continue;
5202         }
5203       else if ((insn->value == 0xec100f80      /* vldr (system register) */
5204                 || insn->value == 0xec000f80)  /* vstr (system register) */
5205                && arm_decode_field (given, 24, 24) == 0
5206                && arm_decode_field (given, 21, 21) == 0)
5207         /* If the P and W bits are both 0 then these encodings match the MVE
5208            VLDR and VSTR instructions, these are in a different table, so we
5209            don't let it match here.  */
5210         continue;
5211
5212
5213       for (c = insn->assembler; *c; c++)
5214         {
5215           if (*c == '%')
5216             {
5217               const char mod = *++c;
5218               switch (mod)
5219                 {
5220                 case '%':
5221                   func (stream, "%%");
5222                   break;
5223
5224                 case 'A':
5225                 case 'K':
5226                   {
5227                     int rn = (given >> 16) & 0xf;
5228                     bfd_vma offset = given & 0xff;
5229
5230                     if (mod == 'K')
5231                       offset = given & 0x7f;
5232
5233                     func (stream, "[%s", arm_regnames [(given >> 16) & 0xf]);
5234
5235                     if (PRE_BIT_SET || WRITEBACK_BIT_SET)
5236                       {
5237                         /* Not unindexed.  The offset is scaled.  */
5238                         if (cp_num == 9)
5239                           /* vldr.16/vstr.16 will shift the address
5240                              left by 1 bit only.  */
5241                           offset = offset * 2;
5242                         else
5243                           offset = offset * 4;
5244
5245                         if (NEGATIVE_BIT_SET)
5246                           offset = - offset;
5247                         if (rn != 15)
5248                           value_in_comment = offset;
5249                       }
5250
5251                     if (PRE_BIT_SET)
5252                       {
5253                         if (offset)
5254                           func (stream, ", #%d]%s",
5255                                 (int) offset,
5256                                 WRITEBACK_BIT_SET ? "!" : "");
5257                         else if (NEGATIVE_BIT_SET)
5258                           func (stream, ", #-0]");
5259                         else
5260                           func (stream, "]");
5261                       }
5262                     else
5263                       {
5264                         func (stream, "]");
5265
5266                         if (WRITEBACK_BIT_SET)
5267                           {
5268                             if (offset)
5269                               func (stream, ", #%d", (int) offset);
5270                             else if (NEGATIVE_BIT_SET)
5271                               func (stream, ", #-0");
5272                           }
5273                         else
5274                           {
5275                             func (stream, ", {%s%d}",
5276                                   (NEGATIVE_BIT_SET && !offset) ? "-" : "",
5277                                   (int) offset);
5278                             value_in_comment = offset;
5279                           }
5280                       }
5281                     if (rn == 15 && (PRE_BIT_SET || WRITEBACK_BIT_SET))
5282                       {
5283                         func (stream, "\t; ");
5284                         /* For unaligned PCs, apply off-by-alignment
5285                            correction.  */
5286                         info->print_address_func (offset + pc
5287                                                   + info->bytes_per_chunk * 2
5288                                                   - (pc & 3),
5289                                                   info);
5290                       }
5291                   }
5292                   break;
5293
5294                 case 'B':
5295                   {
5296                     int regno = ((given >> 12) & 0xf) | ((given >> (22 - 4)) & 0x10);
5297                     int offset = (given >> 1) & 0x3f;
5298
5299                     if (offset == 1)
5300                       func (stream, "{d%d}", regno);
5301                     else if (regno + offset > 32)
5302                       func (stream, "{d%d-<overflow reg d%d>}", regno, regno + offset - 1);
5303                     else
5304                       func (stream, "{d%d-d%d}", regno, regno + offset - 1);
5305                   }
5306                   break;
5307
5308                 case 'C':
5309                   {
5310                     bfd_boolean single = ((given >> 8) & 1) == 0;
5311                     char reg_prefix = single ? 's' : 'd';
5312                     int Dreg = (given >> 22) & 0x1;
5313                     int Vdreg = (given >> 12) & 0xf;
5314                     int reg = single ? ((Vdreg << 1) | Dreg)
5315                                      : ((Dreg << 4) | Vdreg);
5316                     int num = (given >> (single ? 0 : 1)) & 0x7f;
5317                     int maxreg = single ? 31 : 15;
5318                     int topreg = reg + num - 1;
5319
5320                     if (!num)
5321                       func (stream, "{VPR}");
5322                     else if (num == 1)
5323                       func (stream, "{%c%d, VPR}", reg_prefix, reg);
5324                     else if (topreg > maxreg)
5325                       func (stream, "{%c%d-<overflow reg d%d, VPR}",
5326                             reg_prefix, reg, single ? topreg >> 1 : topreg);
5327                     else
5328                       func (stream, "{%c%d-%c%d, VPR}", reg_prefix, reg,
5329                             reg_prefix, topreg);
5330                   }
5331                   break;
5332
5333                 case 'u':
5334                   if (cond != COND_UNCOND)
5335                     is_unpredictable = TRUE;
5336
5337                   /* Fall through.  */
5338                 case 'c':
5339                   if (cond != COND_UNCOND && cp_num == 9)
5340                     is_unpredictable = TRUE;
5341
5342                   func (stream, "%s", arm_conditional[cond]);
5343                   break;
5344
5345                 case 'I':
5346                   /* Print a Cirrus/DSP shift immediate.  */
5347                   /* Immediates are 7bit signed ints with bits 0..3 in
5348                      bits 0..3 of opcode and bits 4..6 in bits 5..7
5349                      of opcode.  */
5350                   {
5351                     int imm;
5352
5353                     imm = (given & 0xf) | ((given & 0xe0) >> 1);
5354
5355                     /* Is ``imm'' a negative number?  */
5356                     if (imm & 0x40)
5357                       imm -= 0x80;
5358
5359                     func (stream, "%d", imm);
5360                   }
5361
5362                   break;
5363
5364                 case 'J':
5365                   {
5366                     unsigned long regno
5367                       = arm_decode_field_multiple (given, 13, 15, 22, 22);
5368
5369                     switch (regno)
5370                       {
5371                       case 0x1:
5372                         func (stream, "FPSCR");
5373                         break;
5374                       case 0x2:
5375                         func (stream, "FPSCR_nzcvqc");
5376                         break;
5377                       case 0xc:
5378                         func (stream, "VPR");
5379                         break;
5380                       case 0xd:
5381                         func (stream, "P0");
5382                         break;
5383                       case 0xe:
5384                         func (stream, "FPCXTNS");
5385                         break;
5386                       case 0xf:
5387                         func (stream, "FPCXTS");
5388                         break;
5389                       default:
5390                         func (stream, "<invalid reg %lu>", regno);
5391                         break;
5392                       }
5393                   }
5394                   break;
5395
5396                 case 'F':
5397                   switch (given & 0x00408000)
5398                     {
5399                     case 0:
5400                       func (stream, "4");
5401                       break;
5402                     case 0x8000:
5403                       func (stream, "1");
5404                       break;
5405                     case 0x00400000:
5406                       func (stream, "2");
5407                       break;
5408                     default:
5409                       func (stream, "3");
5410                     }
5411                   break;
5412
5413                 case 'P':
5414                   switch (given & 0x00080080)
5415                     {
5416                     case 0:
5417                       func (stream, "s");
5418                       break;
5419                     case 0x80:
5420                       func (stream, "d");
5421                       break;
5422                     case 0x00080000:
5423                       func (stream, "e");
5424                       break;
5425                     default:
5426                       func (stream, _("<illegal precision>"));
5427                       break;
5428                     }
5429                   break;
5430
5431                 case 'Q':
5432                   switch (given & 0x00408000)
5433                     {
5434                     case 0:
5435                       func (stream, "s");
5436                       break;
5437                     case 0x8000:
5438                       func (stream, "d");
5439                       break;
5440                     case 0x00400000:
5441                       func (stream, "e");
5442                       break;
5443                     default:
5444                       func (stream, "p");
5445                       break;
5446                     }
5447                   break;
5448
5449                 case 'R':
5450                   switch (given & 0x60)
5451                     {
5452                     case 0:
5453                       break;
5454                     case 0x20:
5455                       func (stream, "p");
5456                       break;
5457                     case 0x40:
5458                       func (stream, "m");
5459                       break;
5460                     default:
5461                       func (stream, "z");
5462                       break;
5463                     }
5464                   break;
5465
5466                 case '0': case '1': case '2': case '3': case '4':
5467                 case '5': case '6': case '7': case '8': case '9':
5468                   {
5469                     int width;
5470
5471                     c = arm_decode_bitfield (c, given, &value, &width);
5472
5473                     switch (*c)
5474                       {
5475                       case 'R':
5476                         if (value == 15)
5477                           is_unpredictable = TRUE;
5478                         /* Fall through.  */
5479                       case 'r':
5480                         if (c[1] == 'u')
5481                           {
5482                             /* Eat the 'u' character.  */
5483                             ++ c;
5484
5485                             if (u_reg == value)
5486                               is_unpredictable = TRUE;
5487                             u_reg = value;
5488                           }
5489                         func (stream, "%s", arm_regnames[value]);
5490                         break;
5491                       case 'V':
5492                         if (given & (1 << 6))
5493                           goto Q;
5494                         /* FALLTHROUGH */
5495                       case 'D':
5496                         func (stream, "d%ld", value);
5497                         break;
5498                       case 'Q':
5499                       Q:
5500                         if (value & 1)
5501                           func (stream, "<illegal reg q%ld.5>", value >> 1);
5502                         else
5503                           func (stream, "q%ld", value >> 1);
5504                         break;
5505                       case 'd':
5506                         func (stream, "%ld", value);
5507                         value_in_comment = value;
5508                         break;
5509                       case 'E':
5510                         {
5511                           /* Converts immediate 8 bit back to float value.  */
5512                           unsigned floatVal = (value & 0x80) << 24
5513                             | (value & 0x3F) << 19
5514                             | ((value & 0x40) ? (0xF8 << 22) : (1 << 30));
5515
5516                           /* Quarter float have a maximum value of 31.0.
5517                              Get floating point value multiplied by 1e7.
5518                              The maximum value stays in limit of a 32-bit int.  */
5519                           unsigned decVal =
5520                             (78125 << (((floatVal >> 23) & 0xFF) - 124)) *
5521                             (16 + (value & 0xF));
5522
5523                           if (!(decVal % 1000000))
5524                             func (stream, "%ld\t; 0x%08x %c%u.%01u", value,
5525                                   floatVal, value & 0x80 ? '-' : ' ',
5526                                   decVal / 10000000,
5527                                   decVal % 10000000 / 1000000);
5528                           else if (!(decVal % 10000))
5529                             func (stream, "%ld\t; 0x%08x %c%u.%03u", value,
5530                                   floatVal, value & 0x80 ? '-' : ' ',
5531                                   decVal / 10000000,
5532                                   decVal % 10000000 / 10000);
5533                           else
5534                             func (stream, "%ld\t; 0x%08x %c%u.%07u", value,
5535                                   floatVal, value & 0x80 ? '-' : ' ',
5536                                   decVal / 10000000, decVal % 10000000);
5537                           break;
5538                         }
5539                       case 'k':
5540                         {
5541                           int from = (given & (1 << 7)) ? 32 : 16;
5542                           func (stream, "%ld", from - value);
5543                         }
5544                         break;
5545
5546                       case 'f':
5547                         if (value > 7)
5548                           func (stream, "#%s", arm_fp_const[value & 7]);
5549                         else
5550                           func (stream, "f%ld", value);
5551                         break;
5552
5553                       case 'w':
5554                         if (width == 2)
5555                           func (stream, "%s", iwmmxt_wwnames[value]);
5556                         else
5557                           func (stream, "%s", iwmmxt_wwssnames[value]);
5558                         break;
5559
5560                       case 'g':
5561                         func (stream, "%s", iwmmxt_regnames[value]);
5562                         break;
5563                       case 'G':
5564                         func (stream, "%s", iwmmxt_cregnames[value]);
5565                         break;
5566
5567                       case 'x':
5568                         func (stream, "0x%lx", (value & 0xffffffffUL));
5569                         break;
5570
5571                       case 'c':
5572                         switch (value)
5573                           {
5574                           case 0:
5575                             func (stream, "eq");
5576                             break;
5577
5578                           case 1:
5579                             func (stream, "vs");
5580                             break;
5581
5582                           case 2:
5583                             func (stream, "ge");
5584                             break;
5585
5586                           case 3:
5587                             func (stream, "gt");
5588                             break;
5589
5590                           default:
5591                             func (stream, "??");
5592                             break;
5593                           }
5594                         break;
5595
5596                       case '`':
5597                         c++;
5598                         if (value == 0)
5599                           func (stream, "%c", *c);
5600                         break;
5601                       case '\'':
5602                         c++;
5603                         if (value == ((1ul << width) - 1))
5604                           func (stream, "%c", *c);
5605                         break;
5606                       case '?':
5607                         func (stream, "%c", c[(1 << width) - (int) value]);
5608                         c += 1 << width;
5609                         break;
5610                       default:
5611                         abort ();
5612                       }
5613                   }
5614                   break;
5615
5616                 case 'y':
5617                 case 'z':
5618                   {
5619                     int single = *c++ == 'y';
5620                     int regno;
5621
5622                     switch (*c)
5623                       {
5624                       case '4': /* Sm pair */
5625                       case '0': /* Sm, Dm */
5626                         regno = given & 0x0000000f;
5627                         if (single)
5628                           {
5629                             regno <<= 1;
5630                             regno += (given >> 5) & 1;
5631                           }
5632                         else
5633                           regno += ((given >> 5) & 1) << 4;
5634                         break;
5635
5636                       case '1': /* Sd, Dd */
5637                         regno = (given >> 12) & 0x0000000f;
5638                         if (single)
5639                           {
5640                             regno <<= 1;
5641                             regno += (given >> 22) & 1;
5642                           }
5643                         else
5644                           regno += ((given >> 22) & 1) << 4;
5645                         break;
5646
5647                       case '2': /* Sn, Dn */
5648                         regno = (given >> 16) & 0x0000000f;
5649                         if (single)
5650                           {
5651                             regno <<= 1;
5652                             regno += (given >> 7) & 1;
5653                           }
5654                         else
5655                           regno += ((given >> 7) & 1) << 4;
5656                         break;
5657
5658                       case '3': /* List */
5659                         func (stream, "{");
5660                         regno = (given >> 12) & 0x0000000f;
5661                         if (single)
5662                           {
5663                             regno <<= 1;
5664                             regno += (given >> 22) & 1;
5665                           }
5666                         else
5667                           regno += ((given >> 22) & 1) << 4;
5668                         break;
5669
5670                       default:
5671                         abort ();
5672                       }
5673
5674                     func (stream, "%c%d", single ? 's' : 'd', regno);
5675
5676                     if (*c == '3')
5677                       {
5678                         int count = given & 0xff;
5679
5680                         if (single == 0)
5681                           count >>= 1;
5682
5683                         if (--count)
5684                           {
5685                             func (stream, "-%c%d",
5686                                   single ? 's' : 'd',
5687                                   regno + count);
5688                           }
5689
5690                         func (stream, "}");
5691                       }
5692                     else if (*c == '4')
5693                       func (stream, ", %c%d", single ? 's' : 'd',
5694                             regno + 1);
5695                   }
5696                   break;
5697
5698                 case 'L':
5699                   switch (given & 0x00400100)
5700                     {
5701                     case 0x00000000: func (stream, "b"); break;
5702                     case 0x00400000: func (stream, "h"); break;
5703                     case 0x00000100: func (stream, "w"); break;
5704                     case 0x00400100: func (stream, "d"); break;
5705                     default:
5706                       break;
5707                     }
5708                   break;
5709
5710                 case 'Z':
5711                   {
5712                     /* given (20, 23) | given (0, 3) */
5713                     value = ((given >> 16) & 0xf0) | (given & 0xf);
5714                     func (stream, "%d", (int) value);
5715                   }
5716                   break;
5717
5718                 case 'l':
5719                   /* This is like the 'A' operator, except that if
5720                      the width field "M" is zero, then the offset is
5721                      *not* multiplied by four.  */
5722                   {
5723                     int offset = given & 0xff;
5724                     int multiplier = (given & 0x00000100) ? 4 : 1;
5725
5726                     func (stream, "[%s", arm_regnames [(given >> 16) & 0xf]);
5727
5728                     if (multiplier > 1)
5729                       {
5730                         value_in_comment = offset * multiplier;
5731                         if (NEGATIVE_BIT_SET)
5732                           value_in_comment = - value_in_comment;
5733                       }
5734
5735                     if (offset)
5736                       {
5737                         if (PRE_BIT_SET)
5738                           func (stream, ", #%s%d]%s",
5739                                 NEGATIVE_BIT_SET ? "-" : "",
5740                                 offset * multiplier,
5741                                 WRITEBACK_BIT_SET ? "!" : "");
5742                         else
5743                           func (stream, "], #%s%d",
5744                                 NEGATIVE_BIT_SET ? "-" : "",
5745                                 offset * multiplier);
5746                       }
5747                     else
5748                       func (stream, "]");
5749                   }
5750                   break;
5751
5752                 case 'r':
5753                   {
5754                     int imm4 = (given >> 4) & 0xf;
5755                     int puw_bits = ((given >> 22) & 6) | ((given >> W_BIT) & 1);
5756                     int ubit = ! NEGATIVE_BIT_SET;
5757                     const char *rm = arm_regnames [given & 0xf];
5758                     const char *rn = arm_regnames [(given >> 16) & 0xf];
5759
5760                     switch (puw_bits)
5761                       {
5762                       case 1:
5763                       case 3:
5764                         func (stream, "[%s], %c%s", rn, ubit ? '+' : '-', rm);
5765                         if (imm4)
5766                           func (stream, ", lsl #%d", imm4);
5767                         break;
5768
5769                       case 4:
5770                       case 5:
5771                       case 6:
5772                       case 7:
5773                         func (stream, "[%s, %c%s", rn, ubit ? '+' : '-', rm);
5774                         if (imm4 > 0)
5775                           func (stream, ", lsl #%d", imm4);
5776                         func (stream, "]");
5777                         if (puw_bits == 5 || puw_bits == 7)
5778                           func (stream, "!");
5779                         break;
5780
5781                       default:
5782                         func (stream, "INVALID");
5783                       }
5784                   }
5785                   break;
5786
5787                 case 'i':
5788                   {
5789                     long imm5;
5790                     imm5 = ((given & 0x100) >> 4) | (given & 0xf);
5791                     func (stream, "%ld", (imm5 == 0) ? 32 : imm5);
5792                   }
5793                   break;
5794
5795                 default:
5796                   abort ();
5797                 }
5798             }
5799           else
5800             func (stream, "%c", *c);
5801         }
5802
5803       if (value_in_comment > 32 || value_in_comment < -16)
5804         func (stream, "\t; 0x%lx", (value_in_comment & 0xffffffffUL));
5805
5806       if (is_unpredictable)
5807         func (stream, UNPREDICTABLE_INSTRUCTION);
5808
5809       return TRUE;
5810     }
5811   return FALSE;
5812 }
5813
5814 /* Decodes and prints ARM addressing modes.  Returns the offset
5815    used in the address, if any, if it is worthwhile printing the
5816    offset as a hexadecimal value in a comment at the end of the
5817    line of disassembly.  */
5818
5819 static signed long
5820 print_arm_address (bfd_vma pc, struct disassemble_info *info, long given)
5821 {
5822   void *stream = info->stream;
5823   fprintf_ftype func = info->fprintf_func;
5824   bfd_vma offset = 0;
5825
5826   if (((given & 0x000f0000) == 0x000f0000)
5827       && ((given & 0x02000000) == 0))
5828     {
5829       offset = given & 0xfff;
5830
5831       func (stream, "[pc");
5832
5833       if (PRE_BIT_SET)
5834         {
5835           /* Pre-indexed.  Elide offset of positive zero when
5836              non-writeback.  */
5837           if (WRITEBACK_BIT_SET || NEGATIVE_BIT_SET || offset)
5838             func (stream, ", #%s%d", NEGATIVE_BIT_SET ? "-" : "", (int) offset);
5839
5840           if (NEGATIVE_BIT_SET)
5841             offset = -offset;
5842
5843           offset += pc + 8;
5844
5845           /* Cope with the possibility of write-back
5846              being used.  Probably a very dangerous thing
5847              for the programmer to do, but who are we to
5848              argue ?  */
5849           func (stream, "]%s", WRITEBACK_BIT_SET ? "!" : "");
5850         }
5851       else  /* Post indexed.  */
5852         {
5853           func (stream, "], #%s%d", NEGATIVE_BIT_SET ? "-" : "", (int) offset);
5854
5855           /* Ie ignore the offset.  */
5856           offset = pc + 8;
5857         }
5858
5859       func (stream, "\t; ");
5860       info->print_address_func (offset, info);
5861       offset = 0;
5862     }
5863   else
5864     {
5865       func (stream, "[%s",
5866             arm_regnames[(given >> 16) & 0xf]);
5867
5868       if (PRE_BIT_SET)
5869         {
5870           if ((given & 0x02000000) == 0)
5871             {
5872               /* Elide offset of positive zero when non-writeback.  */
5873               offset = given & 0xfff;
5874               if (WRITEBACK_BIT_SET || NEGATIVE_BIT_SET || offset)
5875                 func (stream, ", #%s%d", NEGATIVE_BIT_SET ? "-" : "", (int) offset);
5876             }
5877           else
5878             {
5879               func (stream, ", %s", NEGATIVE_BIT_SET ? "-" : "");
5880               arm_decode_shift (given, func, stream, TRUE);
5881             }
5882
5883           func (stream, "]%s",
5884                 WRITEBACK_BIT_SET ? "!" : "");
5885         }
5886       else
5887         {
5888           if ((given & 0x02000000) == 0)
5889             {
5890               /* Always show offset.  */
5891               offset = given & 0xfff;
5892               func (stream, "], #%s%d",
5893                     NEGATIVE_BIT_SET ? "-" : "", (int) offset);
5894             }
5895           else
5896             {
5897               func (stream, "], %s",
5898                     NEGATIVE_BIT_SET ? "-" : "");
5899               arm_decode_shift (given, func, stream, TRUE);
5900             }
5901         }
5902       if (NEGATIVE_BIT_SET)
5903         offset = -offset;
5904     }
5905
5906   return (signed long) offset;
5907 }
5908
5909 /* Print one neon instruction on INFO->STREAM.
5910    Return TRUE if the instuction matched, FALSE if this is not a
5911    recognised neon instruction.  */
5912
5913 static bfd_boolean
5914 print_insn_neon (struct disassemble_info *info, long given, bfd_boolean thumb)
5915 {
5916   const struct opcode32 *insn;
5917   void *stream = info->stream;
5918   fprintf_ftype func = info->fprintf_func;
5919
5920   if (thumb)
5921     {
5922       if ((given & 0xef000000) == 0xef000000)
5923         {
5924           /* Move bit 28 to bit 24 to translate Thumb2 to ARM encoding.  */
5925           unsigned long bit28 = given & (1 << 28);
5926
5927           given &= 0x00ffffff;
5928           if (bit28)
5929             given |= 0xf3000000;
5930           else
5931             given |= 0xf2000000;
5932         }
5933       else if ((given & 0xff000000) == 0xf9000000)
5934         given ^= 0xf9000000 ^ 0xf4000000;
5935       /* vdup is also a valid neon instruction.  */
5936       else if ((given & 0xff910f5f) != 0xee800b10)
5937         return FALSE;
5938     }
5939
5940   for (insn = neon_opcodes; insn->assembler; insn++)
5941     {
5942       if ((given & insn->mask) == insn->value)
5943         {
5944           signed long value_in_comment = 0;
5945           bfd_boolean is_unpredictable = FALSE;
5946           const char *c;
5947
5948           for (c = insn->assembler; *c; c++)
5949             {
5950               if (*c == '%')
5951                 {
5952                   switch (*++c)
5953                     {
5954                     case '%':
5955                       func (stream, "%%");
5956                       break;
5957
5958                     case 'u':
5959                       if (thumb && ifthen_state)
5960                         is_unpredictable = TRUE;
5961
5962                       /* Fall through.  */
5963                     case 'c':
5964                       if (thumb && ifthen_state)
5965                         func (stream, "%s", arm_conditional[IFTHEN_COND]);
5966                       break;
5967
5968                     case 'A':
5969                       {
5970                         static const unsigned char enc[16] =
5971                         {
5972                           0x4, 0x14, /* st4 0,1 */
5973                           0x4, /* st1 2 */
5974                           0x4, /* st2 3 */
5975                           0x3, /* st3 4 */
5976                           0x13, /* st3 5 */
5977                           0x3, /* st1 6 */
5978                           0x1, /* st1 7 */
5979                           0x2, /* st2 8 */
5980                           0x12, /* st2 9 */
5981                           0x2, /* st1 10 */
5982                           0, 0, 0, 0, 0
5983                         };
5984                         int rd = ((given >> 12) & 0xf) | (((given >> 22) & 1) << 4);
5985                         int rn = ((given >> 16) & 0xf);
5986                         int rm = ((given >> 0) & 0xf);
5987                         int align = ((given >> 4) & 0x3);
5988                         int type = ((given >> 8) & 0xf);
5989                         int n = enc[type] & 0xf;
5990                         int stride = (enc[type] >> 4) + 1;
5991                         int ix;
5992
5993                         func (stream, "{");
5994                         if (stride > 1)
5995                           for (ix = 0; ix != n; ix++)
5996                             func (stream, "%sd%d", ix ? "," : "", rd + ix * stride);
5997                         else if (n == 1)
5998                           func (stream, "d%d", rd);
5999                         else
6000                           func (stream, "d%d-d%d", rd, rd + n - 1);
6001                         func (stream, "}, [%s", arm_regnames[rn]);
6002                         if (align)
6003                           func (stream, " :%d", 32 << align);
6004                         func (stream, "]");
6005                         if (rm == 0xd)
6006                           func (stream, "!");
6007                         else if (rm != 0xf)
6008                           func (stream, ", %s", arm_regnames[rm]);
6009                       }
6010                       break;
6011
6012                     case 'B':
6013                       {
6014                         int rd = ((given >> 12) & 0xf) | (((given >> 22) & 1) << 4);
6015                         int rn = ((given >> 16) & 0xf);
6016                         int rm = ((given >> 0) & 0xf);
6017                         int idx_align = ((given >> 4) & 0xf);
6018                         int align = 0;
6019                         int size = ((given >> 10) & 0x3);
6020                         int idx = idx_align >> (size + 1);
6021                         int length = ((given >> 8) & 3) + 1;
6022                         int stride = 1;
6023                         int i;
6024
6025                         if (length > 1 && size > 0)
6026                           stride = (idx_align & (1 << size)) ? 2 : 1;
6027
6028                         switch (length)
6029                           {
6030                           case 1:
6031                             {
6032                               int amask = (1 << size) - 1;
6033                               if ((idx_align & (1 << size)) != 0)
6034                                 return FALSE;
6035                               if (size > 0)
6036                                 {
6037                                   if ((idx_align & amask) == amask)
6038                                     align = 8 << size;
6039                                   else if ((idx_align & amask) != 0)
6040                                     return FALSE;
6041                                 }
6042                               }
6043                             break;
6044
6045                           case 2:
6046                             if (size == 2 && (idx_align & 2) != 0)
6047                               return FALSE;
6048                             align = (idx_align & 1) ? 16 << size : 0;
6049                             break;
6050
6051                           case 3:
6052                             if ((size == 2 && (idx_align & 3) != 0)
6053                                 || (idx_align & 1) != 0)
6054                               return FALSE;
6055                             break;
6056
6057                           case 4:
6058                             if (size == 2)
6059                               {
6060                                 if ((idx_align & 3) == 3)
6061                                   return FALSE;
6062                                 align = (idx_align & 3) * 64;
6063                               }
6064                             else
6065                               align = (idx_align & 1) ? 32 << size : 0;
6066                             break;
6067
6068                           default:
6069                             abort ();
6070                           }
6071
6072                         func (stream, "{");
6073                         for (i = 0; i < length; i++)
6074                           func (stream, "%sd%d[%d]", (i == 0) ? "" : ",",
6075                             rd + i * stride, idx);
6076                         func (stream, "}, [%s", arm_regnames[rn]);
6077                         if (align)
6078                           func (stream, " :%d", align);
6079                         func (stream, "]");
6080                         if (rm == 0xd)
6081                           func (stream, "!");
6082                         else if (rm != 0xf)
6083                           func (stream, ", %s", arm_regnames[rm]);
6084                       }
6085                       break;
6086
6087                     case 'C':
6088                       {
6089                         int rd = ((given >> 12) & 0xf) | (((given >> 22) & 1) << 4);
6090                         int rn = ((given >> 16) & 0xf);
6091                         int rm = ((given >> 0) & 0xf);
6092                         int align = ((given >> 4) & 0x1);
6093                         int size = ((given >> 6) & 0x3);
6094                         int type = ((given >> 8) & 0x3);
6095                         int n = type + 1;
6096                         int stride = ((given >> 5) & 0x1);
6097                         int ix;
6098
6099                         if (stride && (n == 1))
6100                           n++;
6101                         else
6102                           stride++;
6103
6104                         func (stream, "{");
6105                         if (stride > 1)
6106                           for (ix = 0; ix != n; ix++)
6107                             func (stream, "%sd%d[]", ix ? "," : "", rd + ix * stride);
6108                         else if (n == 1)
6109                           func (stream, "d%d[]", rd);
6110                         else
6111                           func (stream, "d%d[]-d%d[]", rd, rd + n - 1);
6112                         func (stream, "}, [%s", arm_regnames[rn]);
6113                         if (align)
6114                           {
6115                             align = (8 * (type + 1)) << size;
6116                             if (type == 3)
6117                               align = (size > 1) ? align >> 1 : align;
6118                             if (type == 2 || (type == 0 && !size))
6119                               func (stream, " :<bad align %d>", align);
6120                             else
6121                               func (stream, " :%d", align);
6122                           }
6123                         func (stream, "]");
6124                         if (rm == 0xd)
6125                           func (stream, "!");
6126                         else if (rm != 0xf)
6127                           func (stream, ", %s", arm_regnames[rm]);
6128                       }
6129                       break;
6130
6131                     case 'D':
6132                       {
6133                         int raw_reg = (given & 0xf) | ((given >> 1) & 0x10);
6134                         int size = (given >> 20) & 3;
6135                         int reg = raw_reg & ((4 << size) - 1);
6136                         int ix = raw_reg >> size >> 2;
6137
6138                         func (stream, "d%d[%d]", reg, ix);
6139                       }
6140                       break;
6141
6142                     case 'E':
6143                       /* Neon encoded constant for mov, mvn, vorr, vbic.  */
6144                       {
6145                         int bits = 0;
6146                         int cmode = (given >> 8) & 0xf;
6147                         int op = (given >> 5) & 0x1;
6148                         unsigned long value = 0, hival = 0;
6149                         unsigned shift;
6150                         int size = 0;
6151                         int isfloat = 0;
6152
6153                         bits |= ((given >> 24) & 1) << 7;
6154                         bits |= ((given >> 16) & 7) << 4;
6155                         bits |= ((given >> 0) & 15) << 0;
6156
6157                         if (cmode < 8)
6158                           {
6159                             shift = (cmode >> 1) & 3;
6160                             value = (unsigned long) bits << (8 * shift);
6161                             size = 32;
6162                           }
6163                         else if (cmode < 12)
6164                           {
6165                             shift = (cmode >> 1) & 1;
6166                             value = (unsigned long) bits << (8 * shift);
6167                             size = 16;
6168                           }
6169                         else if (cmode < 14)
6170                           {
6171                             shift = (cmode & 1) + 1;
6172                             value = (unsigned long) bits << (8 * shift);
6173                             value |= (1ul << (8 * shift)) - 1;
6174                             size = 32;
6175                           }
6176                         else if (cmode == 14)
6177                           {
6178                             if (op)
6179                               {
6180                                 /* Bit replication into bytes.  */
6181                                 int ix;
6182                                 unsigned long mask;
6183
6184                                 value = 0;
6185                                 hival = 0;
6186                                 for (ix = 7; ix >= 0; ix--)
6187                                   {
6188                                     mask = ((bits >> ix) & 1) ? 0xff : 0;
6189                                     if (ix <= 3)
6190                                       value = (value << 8) | mask;
6191                                     else
6192                                       hival = (hival << 8) | mask;
6193                                   }
6194                                 size = 64;
6195                               }
6196                             else
6197                               {
6198                                 /* Byte replication.  */
6199                                 value = (unsigned long) bits;
6200                                 size = 8;
6201                               }
6202                           }
6203                         else if (!op)
6204                           {
6205                             /* Floating point encoding.  */
6206                             int tmp;
6207
6208                             value = (unsigned long)  (bits & 0x7f) << 19;
6209                             value |= (unsigned long) (bits & 0x80) << 24;
6210                             tmp = bits & 0x40 ? 0x3c : 0x40;
6211                             value |= (unsigned long) tmp << 24;
6212                             size = 32;
6213                             isfloat = 1;
6214                           }
6215                         else
6216                           {
6217                             func (stream, "<illegal constant %.8x:%x:%x>",
6218                                   bits, cmode, op);
6219                             size = 32;
6220                             break;
6221                           }
6222                         switch (size)
6223                           {
6224                           case 8:
6225                             func (stream, "#%ld\t; 0x%.2lx", value, value);
6226                             break;
6227
6228                           case 16:
6229                             func (stream, "#%ld\t; 0x%.4lx", value, value);
6230                             break;
6231
6232                           case 32:
6233                             if (isfloat)
6234                               {
6235                                 unsigned char valbytes[4];
6236                                 double fvalue;
6237
6238                                 /* Do this a byte at a time so we don't have to
6239                                    worry about the host's endianness.  */
6240                                 valbytes[0] = value & 0xff;
6241                                 valbytes[1] = (value >> 8) & 0xff;
6242                                 valbytes[2] = (value >> 16) & 0xff;
6243                                 valbytes[3] = (value >> 24) & 0xff;
6244
6245                                 floatformat_to_double
6246                                   (& floatformat_ieee_single_little, valbytes,
6247                                   & fvalue);
6248
6249                                 func (stream, "#%.7g\t; 0x%.8lx", fvalue,
6250                                       value);
6251                               }
6252                             else
6253                               func (stream, "#%ld\t; 0x%.8lx",
6254                                     (long) (((value & 0x80000000L) != 0)
6255                                             ? value | ~0xffffffffL : value),
6256                                     value);
6257                             break;
6258
6259                           case 64:
6260                             func (stream, "#0x%.8lx%.8lx", hival, value);
6261                             break;
6262
6263                           default:
6264                             abort ();
6265                           }
6266                       }
6267                       break;
6268
6269                     case 'F':
6270                       {
6271                         int regno = ((given >> 16) & 0xf) | ((given >> (7 - 4)) & 0x10);
6272                         int num = (given >> 8) & 0x3;
6273
6274                         if (!num)
6275                           func (stream, "{d%d}", regno);
6276                         else if (num + regno >= 32)
6277                           func (stream, "{d%d-<overflow reg d%d}", regno, regno + num);
6278                         else
6279                           func (stream, "{d%d-d%d}", regno, regno + num);
6280                       }
6281                       break;
6282
6283
6284                     case '0': case '1': case '2': case '3': case '4':
6285                     case '5': case '6': case '7': case '8': case '9':
6286                       {
6287                         int width;
6288                         unsigned long value;
6289
6290                         c = arm_decode_bitfield (c, given, &value, &width);
6291
6292                         switch (*c)
6293                           {
6294                           case 'r':
6295                             func (stream, "%s", arm_regnames[value]);
6296                             break;
6297                           case 'd':
6298                             func (stream, "%ld", value);
6299                             value_in_comment = value;
6300                             break;
6301                           case 'e':
6302                             func (stream, "%ld", (1ul << width) - value);
6303                             break;
6304
6305                           case 'S':
6306                           case 'T':
6307                           case 'U':
6308                             /* Various width encodings.  */
6309                             {
6310                               int base = 8 << (*c - 'S'); /* 8,16 or 32 */
6311                               int limit;
6312                               unsigned low, high;
6313
6314                               c++;
6315                               if (*c >= '0' && *c <= '9')
6316                                 limit = *c - '0';
6317                               else if (*c >= 'a' && *c <= 'f')
6318                                 limit = *c - 'a' + 10;
6319                               else
6320                                 abort ();
6321                               low = limit >> 2;
6322                               high = limit & 3;
6323
6324                               if (value < low || value > high)
6325                                 func (stream, "<illegal width %d>", base << value);
6326                               else
6327                                 func (stream, "%d", base << value);
6328                             }
6329                             break;
6330                           case 'R':
6331                             if (given & (1 << 6))
6332                               goto Q;
6333                             /* FALLTHROUGH */
6334                           case 'D':
6335                             func (stream, "d%ld", value);
6336                             break;
6337                           case 'Q':
6338                           Q:
6339                             if (value & 1)
6340                               func (stream, "<illegal reg q%ld.5>", value >> 1);
6341                             else
6342                               func (stream, "q%ld", value >> 1);
6343                             break;
6344
6345                           case '`':
6346                             c++;
6347                             if (value == 0)
6348                               func (stream, "%c", *c);
6349                             break;
6350                           case '\'':
6351                             c++;
6352                             if (value == ((1ul << width) - 1))
6353                               func (stream, "%c", *c);
6354                             break;
6355                           case '?':
6356                             func (stream, "%c", c[(1 << width) - (int) value]);
6357                             c += 1 << width;
6358                             break;
6359                           default:
6360                             abort ();
6361                           }
6362                       }
6363                       break;
6364
6365                     default:
6366                       abort ();
6367                     }
6368                 }
6369               else
6370                 func (stream, "%c", *c);
6371             }
6372
6373           if (value_in_comment > 32 || value_in_comment < -16)
6374             func (stream, "\t; 0x%lx", value_in_comment);
6375
6376           if (is_unpredictable)
6377             func (stream, UNPREDICTABLE_INSTRUCTION);
6378
6379           return TRUE;
6380         }
6381     }
6382   return FALSE;
6383 }
6384
6385 /* Print one mve instruction on INFO->STREAM.
6386    Return TRUE if the instuction matched, FALSE if this is not a
6387    recognised mve instruction.  */
6388
6389 static bfd_boolean
6390 print_insn_mve (struct disassemble_info *info, long given)
6391 {
6392   const struct mopcode32 *insn;
6393   void *stream = info->stream;
6394   fprintf_ftype func = info->fprintf_func;
6395
6396   for (insn = mve_opcodes; insn->assembler; insn++)
6397     {
6398       if (((given & insn->mask) == insn->value)
6399           && !is_mve_encoding_conflict (given, insn->mve_op))
6400         {
6401           signed long value_in_comment = 0;
6402           bfd_boolean is_unpredictable = FALSE;
6403           bfd_boolean is_undefined = FALSE;
6404           const char *c;
6405           enum mve_unpredictable unpredictable_cond = UNPRED_NONE;
6406           enum mve_undefined undefined_cond = UNDEF_NONE;
6407
6408           /* Most vector mve instruction are illegal in a it block.
6409              There are a few exceptions; check for them.  */
6410           if (ifthen_state && !is_mve_okay_in_it (insn->mve_op))
6411             {
6412               is_unpredictable = TRUE;
6413               unpredictable_cond = UNPRED_IT_BLOCK;
6414             }
6415           else if (is_mve_unpredictable (given, insn->mve_op,
6416                                          &unpredictable_cond))
6417             is_unpredictable = TRUE;
6418
6419           if (is_mve_undefined (given, insn->mve_op, &undefined_cond))
6420             is_undefined = TRUE;
6421
6422           for (c = insn->assembler; *c; c++)
6423             {
6424               if (*c == '%')
6425                 {
6426                   switch (*++c)
6427                     {
6428                     case '%':
6429                       func (stream, "%%");
6430                       break;
6431
6432                     case 'a':
6433                       /* Don't print anything for '+' as it is implied.  */
6434                       if (arm_decode_field (given, 23, 23) == 0)
6435                         func (stream, "-");
6436                       break;
6437
6438                     case 'c':
6439                       if (ifthen_state)
6440                         func (stream, "%s", arm_conditional[IFTHEN_COND]);
6441                       break;
6442
6443                     case 'd':
6444                       print_mve_vld_str_addr (info, given, insn->mve_op);
6445                       break;
6446
6447                     case 'i':
6448                       {
6449                         long mve_mask = mve_extract_pred_mask (given);
6450                         func (stream, "%s", mve_predicatenames[mve_mask]);
6451                       }
6452                       break;
6453
6454                     case 'n':
6455                       print_vec_condition (info, given, insn->mve_op);
6456                       break;
6457
6458                     case 'o':
6459                       if (arm_decode_field (given, 0, 0) == 1)
6460                         {
6461                           unsigned long size
6462                             = arm_decode_field (given, 4, 4)
6463                               | (arm_decode_field (given, 6, 6) << 1);
6464
6465                           func (stream, ", uxtw #%lu", size);
6466                         }
6467                       break;
6468
6469                     case 'u':
6470                       {
6471                         if (arm_decode_field (given, 28, 28) == 0)
6472                           func (stream, "s");
6473                         else
6474                           func (stream, "u");
6475                       }
6476                       break;
6477
6478                     case 'v':
6479                       print_instruction_predicate (info);
6480                       break;
6481
6482                     case 'w':
6483                       if (arm_decode_field (given, 21, 21) == 1)
6484                         func (stream, "!");
6485                       break;
6486
6487                     case 'B':
6488                       print_mve_register_blocks (info, given, insn->mve_op);
6489                       break;
6490
6491                     case '0': case '1': case '2': case '3': case '4':
6492                     case '5': case '6': case '7': case '8': case '9':
6493                       {
6494                         int width;
6495                         unsigned long value;
6496
6497                         c = arm_decode_bitfield (c, given, &value, &width);
6498
6499                         switch (*c)
6500                           {
6501                           case 'Z':
6502                             if (value == 13)
6503                               is_unpredictable = TRUE;
6504                             else if (value == 15)
6505                               func (stream, "zr");
6506                             else
6507                               func (stream, "%s", arm_regnames[value]);
6508                             break;
6509                           case 's':
6510                             print_mve_size (info,
6511                                             value,
6512                                             insn->mve_op);
6513                             break;
6514                           case 'i':
6515                             {
6516                               unsigned long imm
6517                                 = arm_decode_field (given, 0, 6);
6518                               unsigned long mod_imm = imm;
6519
6520                               switch (insn->mve_op)
6521                                 {
6522                                 case MVE_VLDRW_GATHER_T5:
6523                                 case MVE_VSTRW_SCATTER_T5:
6524                                   mod_imm = mod_imm << 2;
6525                                   break;
6526                                 case MVE_VSTRD_SCATTER_T6:
6527                                 case MVE_VLDRD_GATHER_T6:
6528                                   mod_imm = mod_imm << 3;
6529                                   break;
6530
6531                                 default:
6532                                   break;
6533                                 }
6534
6535                               func (stream, "%lu", mod_imm);
6536                             }
6537                             break;
6538                           case 'r':
6539                             func (stream, "%s", arm_regnames[value]);
6540                             break;
6541                           case 'd':
6542                             func (stream, "%ld", value);
6543                             value_in_comment = value;
6544                             break;
6545                           case 'Q':
6546                             if (value & 0x8)
6547                               func (stream, "<illegal reg q%ld.5>", value);
6548                             else
6549                               func (stream, "q%ld", value);
6550                             break;
6551                           default:
6552                             abort ();
6553                           }
6554                         break;
6555                       default:
6556                         abort ();
6557                       }
6558                     }
6559                 }
6560               else
6561                 func (stream, "%c", *c);
6562             }
6563
6564           if (value_in_comment > 32 || value_in_comment < -16)
6565             func (stream, "\t; 0x%lx", value_in_comment);
6566
6567           if (is_unpredictable)
6568             print_mve_unpredictable (info, unpredictable_cond);
6569
6570           if (is_undefined)
6571             print_mve_undefined (info, undefined_cond);
6572
6573           if ((vpt_block_state.in_vpt_block == FALSE)
6574               && !ifthen_state
6575               && (is_vpt_instruction (given) == TRUE))
6576             mark_inside_vpt_block (given);
6577           else if (vpt_block_state.in_vpt_block == TRUE)
6578             update_vpt_block_state ();
6579
6580           return TRUE;
6581         }
6582     }
6583   return FALSE;
6584 }
6585
6586
6587 /* Return the name of a v7A special register.  */
6588
6589 static const char *
6590 banked_regname (unsigned reg)
6591 {
6592   switch (reg)
6593     {
6594       case 15: return "CPSR";
6595       case 32: return "R8_usr";
6596       case 33: return "R9_usr";
6597       case 34: return "R10_usr";
6598       case 35: return "R11_usr";
6599       case 36: return "R12_usr";
6600       case 37: return "SP_usr";
6601       case 38: return "LR_usr";
6602       case 40: return "R8_fiq";
6603       case 41: return "R9_fiq";
6604       case 42: return "R10_fiq";
6605       case 43: return "R11_fiq";
6606       case 44: return "R12_fiq";
6607       case 45: return "SP_fiq";
6608       case 46: return "LR_fiq";
6609       case 48: return "LR_irq";
6610       case 49: return "SP_irq";
6611       case 50: return "LR_svc";
6612       case 51: return "SP_svc";
6613       case 52: return "LR_abt";
6614       case 53: return "SP_abt";
6615       case 54: return "LR_und";
6616       case 55: return "SP_und";
6617       case 60: return "LR_mon";
6618       case 61: return "SP_mon";
6619       case 62: return "ELR_hyp";
6620       case 63: return "SP_hyp";
6621       case 79: return "SPSR";
6622       case 110: return "SPSR_fiq";
6623       case 112: return "SPSR_irq";
6624       case 114: return "SPSR_svc";
6625       case 116: return "SPSR_abt";
6626       case 118: return "SPSR_und";
6627       case 124: return "SPSR_mon";
6628       case 126: return "SPSR_hyp";
6629       default: return NULL;
6630     }
6631 }
6632
6633 /* Return the name of the DMB/DSB option.  */
6634 static const char *
6635 data_barrier_option (unsigned option)
6636 {
6637   switch (option & 0xf)
6638     {
6639     case 0xf: return "sy";
6640     case 0xe: return "st";
6641     case 0xd: return "ld";
6642     case 0xb: return "ish";
6643     case 0xa: return "ishst";
6644     case 0x9: return "ishld";
6645     case 0x7: return "un";
6646     case 0x6: return "unst";
6647     case 0x5: return "nshld";
6648     case 0x3: return "osh";
6649     case 0x2: return "oshst";
6650     case 0x1: return "oshld";
6651     default:  return NULL;
6652     }
6653 }
6654
6655 /* Print one ARM instruction from PC on INFO->STREAM.  */
6656
6657 static void
6658 print_insn_arm (bfd_vma pc, struct disassemble_info *info, long given)
6659 {
6660   const struct opcode32 *insn;
6661   void *stream = info->stream;
6662   fprintf_ftype func = info->fprintf_func;
6663   struct arm_private_data *private_data = info->private_data;
6664
6665   if (print_insn_coprocessor (pc, info, given, FALSE))
6666     return;
6667
6668   if (print_insn_neon (info, given, FALSE))
6669     return;
6670
6671   for (insn = arm_opcodes; insn->assembler; insn++)
6672     {
6673       if ((given & insn->mask) != insn->value)
6674         continue;
6675
6676       if (! ARM_CPU_HAS_FEATURE (insn->arch, private_data->features))
6677         continue;
6678
6679       /* Special case: an instruction with all bits set in the condition field
6680          (0xFnnn_nnnn) is only matched if all those bits are set in insn->mask,
6681          or by the catchall at the end of the table.  */
6682       if ((given & 0xF0000000) != 0xF0000000
6683           || (insn->mask & 0xF0000000) == 0xF0000000
6684           || (insn->mask == 0 && insn->value == 0))
6685         {
6686           unsigned long u_reg = 16;
6687           unsigned long U_reg = 16;
6688           bfd_boolean is_unpredictable = FALSE;
6689           signed long value_in_comment = 0;
6690           const char *c;
6691
6692           for (c = insn->assembler; *c; c++)
6693             {
6694               if (*c == '%')
6695                 {
6696                   bfd_boolean allow_unpredictable = FALSE;
6697
6698                   switch (*++c)
6699                     {
6700                     case '%':
6701                       func (stream, "%%");
6702                       break;
6703
6704                     case 'a':
6705                       value_in_comment = print_arm_address (pc, info, given);
6706                       break;
6707
6708                     case 'P':
6709                       /* Set P address bit and use normal address
6710                          printing routine.  */
6711                       value_in_comment = print_arm_address (pc, info, given | (1 << P_BIT));
6712                       break;
6713
6714                     case 'S':
6715                       allow_unpredictable = TRUE;
6716                       /* Fall through.  */
6717                     case 's':
6718                       if ((given & 0x004f0000) == 0x004f0000)
6719                         {
6720                           /* PC relative with immediate offset.  */
6721                           bfd_vma offset = ((given & 0xf00) >> 4) | (given & 0xf);
6722
6723                           if (PRE_BIT_SET)
6724                             {
6725                               /* Elide positive zero offset.  */
6726                               if (offset || NEGATIVE_BIT_SET)
6727                                 func (stream, "[pc, #%s%d]\t; ",
6728                                       NEGATIVE_BIT_SET ? "-" : "", (int) offset);
6729                               else
6730                                 func (stream, "[pc]\t; ");
6731                               if (NEGATIVE_BIT_SET)
6732                                 offset = -offset;
6733                               info->print_address_func (offset + pc + 8, info);
6734                             }
6735                           else
6736                             {
6737                               /* Always show the offset.  */
6738                               func (stream, "[pc], #%s%d",
6739                                     NEGATIVE_BIT_SET ? "-" : "", (int) offset);
6740                               if (! allow_unpredictable)
6741                                 is_unpredictable = TRUE;
6742                             }
6743                         }
6744                       else
6745                         {
6746                           int offset = ((given & 0xf00) >> 4) | (given & 0xf);
6747
6748                           func (stream, "[%s",
6749                                 arm_regnames[(given >> 16) & 0xf]);
6750
6751                           if (PRE_BIT_SET)
6752                             {
6753                               if (IMMEDIATE_BIT_SET)
6754                                 {
6755                                   /* Elide offset for non-writeback
6756                                      positive zero.  */
6757                                   if (WRITEBACK_BIT_SET || NEGATIVE_BIT_SET
6758                                       || offset)
6759                                     func (stream, ", #%s%d",
6760                                           NEGATIVE_BIT_SET ? "-" : "", offset);
6761
6762                                   if (NEGATIVE_BIT_SET)
6763                                     offset = -offset;
6764
6765                                   value_in_comment = offset;
6766                                 }
6767                               else
6768                                 {
6769                                   /* Register Offset or Register Pre-Indexed.  */
6770                                   func (stream, ", %s%s",
6771                                         NEGATIVE_BIT_SET ? "-" : "",
6772                                         arm_regnames[given & 0xf]);
6773
6774                                   /* Writing back to the register that is the source/
6775                                      destination of the load/store is unpredictable.  */
6776                                   if (! allow_unpredictable
6777                                       && WRITEBACK_BIT_SET
6778                                       && ((given & 0xf) == ((given >> 12) & 0xf)))
6779                                     is_unpredictable = TRUE;
6780                                 }
6781
6782                               func (stream, "]%s",
6783                                     WRITEBACK_BIT_SET ? "!" : "");
6784                             }
6785                           else
6786                             {
6787                               if (IMMEDIATE_BIT_SET)
6788                                 {
6789                                   /* Immediate Post-indexed.  */
6790                                   /* PR 10924: Offset must be printed, even if it is zero.  */
6791                                   func (stream, "], #%s%d",
6792                                         NEGATIVE_BIT_SET ? "-" : "", offset);
6793                                   if (NEGATIVE_BIT_SET)
6794                                     offset = -offset;
6795                                   value_in_comment = offset;
6796                                 }
6797                               else
6798                                 {
6799                                   /* Register Post-indexed.  */
6800                                   func (stream, "], %s%s",
6801                                         NEGATIVE_BIT_SET ? "-" : "",
6802                                         arm_regnames[given & 0xf]);
6803
6804                                   /* Writing back to the register that is the source/
6805                                      destination of the load/store is unpredictable.  */
6806                                   if (! allow_unpredictable
6807                                       && (given & 0xf) == ((given >> 12) & 0xf))
6808                                     is_unpredictable = TRUE;
6809                                 }
6810
6811                               if (! allow_unpredictable)
6812                                 {
6813                                   /* Writeback is automatically implied by post- addressing.
6814                                      Setting the W bit is unnecessary and ARM specify it as
6815                                      being unpredictable.  */
6816                                   if (WRITEBACK_BIT_SET
6817                                       /* Specifying the PC register as the post-indexed
6818                                          registers is also unpredictable.  */
6819                                       || (! IMMEDIATE_BIT_SET && ((given & 0xf) == 0xf)))
6820                                     is_unpredictable = TRUE;
6821                                 }
6822                             }
6823                         }
6824                       break;
6825
6826                     case 'b':
6827                       {
6828                         bfd_vma disp = (((given & 0xffffff) ^ 0x800000) - 0x800000);
6829                         info->print_address_func (disp * 4 + pc + 8, info);
6830                       }
6831                       break;
6832
6833                     case 'c':
6834                       if (((given >> 28) & 0xf) != 0xe)
6835                         func (stream, "%s",
6836                               arm_conditional [(given >> 28) & 0xf]);
6837                       break;
6838
6839                     case 'm':
6840                       {
6841                         int started = 0;
6842                         int reg;
6843
6844                         func (stream, "{");
6845                         for (reg = 0; reg < 16; reg++)
6846                           if ((given & (1 << reg)) != 0)
6847                             {
6848                               if (started)
6849                                 func (stream, ", ");
6850                               started = 1;
6851                               func (stream, "%s", arm_regnames[reg]);
6852                             }
6853                         func (stream, "}");
6854                         if (! started)
6855                           is_unpredictable = TRUE;
6856                       }
6857                       break;
6858
6859                     case 'q':
6860                       arm_decode_shift (given, func, stream, FALSE);
6861                       break;
6862
6863                     case 'o':
6864                       if ((given & 0x02000000) != 0)
6865                         {
6866                           unsigned int rotate = (given & 0xf00) >> 7;
6867                           unsigned int immed = (given & 0xff);
6868                           unsigned int a, i;
6869
6870                           a = (((immed << (32 - rotate))
6871                                 | (immed >> rotate)) & 0xffffffff);
6872                           /* If there is another encoding with smaller rotate,
6873                              the rotate should be specified directly.  */
6874                           for (i = 0; i < 32; i += 2)
6875                             if ((a << i | a >> (32 - i)) <= 0xff)
6876                               break;
6877
6878                           if (i != rotate)
6879                             func (stream, "#%d, %d", immed, rotate);
6880                           else
6881                             func (stream, "#%d", a);
6882                           value_in_comment = a;
6883                         }
6884                       else
6885                         arm_decode_shift (given, func, stream, TRUE);
6886                       break;
6887
6888                     case 'p':
6889                       if ((given & 0x0000f000) == 0x0000f000)
6890                         {
6891                           arm_feature_set arm_ext_v6 =
6892                             ARM_FEATURE_CORE_LOW (ARM_EXT_V6);
6893
6894                           /* The p-variants of tst/cmp/cmn/teq are the pre-V6
6895                              mechanism for setting PSR flag bits.  They are
6896                              obsolete in V6 onwards.  */
6897                           if (! ARM_CPU_HAS_FEATURE (private_data->features, \
6898                                                      arm_ext_v6))
6899                             func (stream, "p");
6900                           else
6901                             is_unpredictable = TRUE;
6902                         }
6903                       break;
6904
6905                     case 't':
6906                       if ((given & 0x01200000) == 0x00200000)
6907                         func (stream, "t");
6908                       break;
6909
6910                     case 'A':
6911                       {
6912                         int offset = given & 0xff;
6913
6914                         value_in_comment = offset * 4;
6915                         if (NEGATIVE_BIT_SET)
6916                           value_in_comment = - value_in_comment;
6917
6918                         func (stream, "[%s", arm_regnames [(given >> 16) & 0xf]);
6919
6920                         if (PRE_BIT_SET)
6921                           {
6922                             if (offset)
6923                               func (stream, ", #%d]%s",
6924                                     (int) value_in_comment,
6925                                     WRITEBACK_BIT_SET ? "!" : "");
6926                             else
6927                               func (stream, "]");
6928                           }
6929                         else
6930                           {
6931                             func (stream, "]");
6932
6933                             if (WRITEBACK_BIT_SET)
6934                               {
6935                                 if (offset)
6936                                   func (stream, ", #%d", (int) value_in_comment);
6937                               }
6938                             else
6939                               {
6940                                 func (stream, ", {%d}", (int) offset);
6941                                 value_in_comment = offset;
6942                               }
6943                           }
6944                       }
6945                       break;
6946
6947                     case 'B':
6948                       /* Print ARM V5 BLX(1) address: pc+25 bits.  */
6949                       {
6950                         bfd_vma address;
6951                         bfd_vma offset = 0;
6952
6953                         if (! NEGATIVE_BIT_SET)
6954                           /* Is signed, hi bits should be ones.  */
6955                           offset = (-1) ^ 0x00ffffff;
6956
6957                         /* Offset is (SignExtend(offset field)<<2).  */
6958                         offset += given & 0x00ffffff;
6959                         offset <<= 2;
6960                         address = offset + pc + 8;
6961
6962                         if (given & 0x01000000)
6963                           /* H bit allows addressing to 2-byte boundaries.  */
6964                           address += 2;
6965
6966                         info->print_address_func (address, info);
6967                       }
6968                       break;
6969
6970                     case 'C':
6971                       if ((given & 0x02000200) == 0x200)
6972                         {
6973                           const char * name;
6974                           unsigned sysm = (given & 0x004f0000) >> 16;
6975
6976                           sysm |= (given & 0x300) >> 4;
6977                           name = banked_regname (sysm);
6978
6979                           if (name != NULL)
6980                             func (stream, "%s", name);
6981                           else
6982                             func (stream, "(UNDEF: %lu)", (unsigned long) sysm);
6983                         }
6984                       else
6985                         {
6986                           func (stream, "%cPSR_",
6987                                 (given & 0x00400000) ? 'S' : 'C');
6988                           if (given & 0x80000)
6989                             func (stream, "f");
6990                           if (given & 0x40000)
6991                             func (stream, "s");
6992                           if (given & 0x20000)
6993                             func (stream, "x");
6994                           if (given & 0x10000)
6995                             func (stream, "c");
6996                         }
6997                       break;
6998
6999                     case 'U':
7000                       if ((given & 0xf0) == 0x60)
7001                         {
7002                           switch (given & 0xf)
7003                             {
7004                             case 0xf: func (stream, "sy"); break;
7005                             default:
7006                               func (stream, "#%d", (int) given & 0xf);
7007                               break;
7008                             }
7009                         }
7010                       else
7011                         {
7012                           const char * opt = data_barrier_option (given & 0xf);
7013                           if (opt != NULL)
7014                             func (stream, "%s", opt);
7015                           else
7016                               func (stream, "#%d", (int) given & 0xf);
7017                         }
7018                       break;
7019
7020                     case '0': case '1': case '2': case '3': case '4':
7021                     case '5': case '6': case '7': case '8': case '9':
7022                       {
7023                         int width;
7024                         unsigned long value;
7025
7026                         c = arm_decode_bitfield (c, given, &value, &width);
7027
7028                         switch (*c)
7029                           {
7030                           case 'R':
7031                             if (value == 15)
7032                               is_unpredictable = TRUE;
7033                             /* Fall through.  */
7034                           case 'r':
7035                           case 'T':
7036                             /* We want register + 1 when decoding T.  */
7037                             if (*c == 'T')
7038                               ++value;
7039
7040                             if (c[1] == 'u')
7041                               {
7042                                 /* Eat the 'u' character.  */
7043                                 ++ c;
7044
7045                                 if (u_reg == value)
7046                                   is_unpredictable = TRUE;
7047                                 u_reg = value;
7048                               }
7049                             if (c[1] == 'U')
7050                               {
7051                                 /* Eat the 'U' character.  */
7052                                 ++ c;
7053
7054                                 if (U_reg == value)
7055                                   is_unpredictable = TRUE;
7056                                 U_reg = value;
7057                               }
7058                             func (stream, "%s", arm_regnames[value]);
7059                             break;
7060                           case 'd':
7061                             func (stream, "%ld", value);
7062                             value_in_comment = value;
7063                             break;
7064                           case 'b':
7065                             func (stream, "%ld", value * 8);
7066                             value_in_comment = value * 8;
7067                             break;
7068                           case 'W':
7069                             func (stream, "%ld", value + 1);
7070                             value_in_comment = value + 1;
7071                             break;
7072                           case 'x':
7073                             func (stream, "0x%08lx", value);
7074
7075                             /* Some SWI instructions have special
7076                                meanings.  */
7077                             if ((given & 0x0fffffff) == 0x0FF00000)
7078                               func (stream, "\t; IMB");
7079                             else if ((given & 0x0fffffff) == 0x0FF00001)
7080                               func (stream, "\t; IMBRange");
7081                             break;
7082                           case 'X':
7083                             func (stream, "%01lx", value & 0xf);
7084                             value_in_comment = value;
7085                             break;
7086                           case '`':
7087                             c++;
7088                             if (value == 0)
7089                               func (stream, "%c", *c);
7090                             break;
7091                           case '\'':
7092                             c++;
7093                             if (value == ((1ul << width) - 1))
7094                               func (stream, "%c", *c);
7095                             break;
7096                           case '?':
7097                             func (stream, "%c", c[(1 << width) - (int) value]);
7098                             c += 1 << width;
7099                             break;
7100                           default:
7101                             abort ();
7102                           }
7103                       }
7104                       break;
7105
7106                     case 'e':
7107                       {
7108                         int imm;
7109
7110                         imm = (given & 0xf) | ((given & 0xfff00) >> 4);
7111                         func (stream, "%d", imm);
7112                         value_in_comment = imm;
7113                       }
7114                       break;
7115
7116                     case 'E':
7117                       /* LSB and WIDTH fields of BFI or BFC.  The machine-
7118                          language instruction encodes LSB and MSB.  */
7119                       {
7120                         long msb = (given & 0x001f0000) >> 16;
7121                         long lsb = (given & 0x00000f80) >> 7;
7122                         long w = msb - lsb + 1;
7123
7124                         if (w > 0)
7125                           func (stream, "#%lu, #%lu", lsb, w);
7126                         else
7127                           func (stream, "(invalid: %lu:%lu)", lsb, msb);
7128                       }
7129                       break;
7130
7131                     case 'R':
7132                       /* Get the PSR/banked register name.  */
7133                       {
7134                         const char * name;
7135                         unsigned sysm = (given & 0x004f0000) >> 16;
7136
7137                         sysm |= (given & 0x300) >> 4;
7138                         name = banked_regname (sysm);
7139
7140                         if (name != NULL)
7141                           func (stream, "%s", name);
7142                         else
7143                           func (stream, "(UNDEF: %lu)", (unsigned long) sysm);
7144                       }
7145                       break;
7146
7147                     case 'V':
7148                       /* 16-bit unsigned immediate from a MOVT or MOVW
7149                          instruction, encoded in bits 0:11 and 15:19.  */
7150                       {
7151                         long hi = (given & 0x000f0000) >> 4;
7152                         long lo = (given & 0x00000fff);
7153                         long imm16 = hi | lo;
7154
7155                         func (stream, "#%lu", imm16);
7156                         value_in_comment = imm16;
7157                       }
7158                       break;
7159
7160                     default:
7161                       abort ();
7162                     }
7163                 }
7164               else
7165                 func (stream, "%c", *c);
7166             }
7167
7168           if (value_in_comment > 32 || value_in_comment < -16)
7169             func (stream, "\t; 0x%lx", (value_in_comment & 0xffffffffUL));
7170
7171           if (is_unpredictable)
7172             func (stream, UNPREDICTABLE_INSTRUCTION);
7173
7174           return;
7175         }
7176     }
7177   func (stream, UNKNOWN_INSTRUCTION_32BIT, (unsigned)given);
7178   return;
7179 }
7180
7181 /* Print one 16-bit Thumb instruction from PC on INFO->STREAM.  */
7182
7183 static void
7184 print_insn_thumb16 (bfd_vma pc, struct disassemble_info *info, long given)
7185 {
7186   const struct opcode16 *insn;
7187   void *stream = info->stream;
7188   fprintf_ftype func = info->fprintf_func;
7189
7190   for (insn = thumb_opcodes; insn->assembler; insn++)
7191     if ((given & insn->mask) == insn->value)
7192       {
7193         signed long value_in_comment = 0;
7194         const char *c = insn->assembler;
7195
7196         for (; *c; c++)
7197           {
7198             int domaskpc = 0;
7199             int domasklr = 0;
7200
7201             if (*c != '%')
7202               {
7203                 func (stream, "%c", *c);
7204                 continue;
7205               }
7206
7207             switch (*++c)
7208               {
7209               case '%':
7210                 func (stream, "%%");
7211                 break;
7212
7213               case 'c':
7214                 if (ifthen_state)
7215                   func (stream, "%s", arm_conditional[IFTHEN_COND]);
7216                 break;
7217
7218               case 'C':
7219                 if (ifthen_state)
7220                   func (stream, "%s", arm_conditional[IFTHEN_COND]);
7221                 else
7222                   func (stream, "s");
7223                 break;
7224
7225               case 'I':
7226                 {
7227                   unsigned int tmp;
7228
7229                   ifthen_next_state = given & 0xff;
7230                   for (tmp = given << 1; tmp & 0xf; tmp <<= 1)
7231                     func (stream, ((given ^ tmp) & 0x10) ? "e" : "t");
7232                   func (stream, "\t%s", arm_conditional[(given >> 4) & 0xf]);
7233                 }
7234                 break;
7235
7236               case 'x':
7237                 if (ifthen_next_state)
7238                   func (stream, "\t; unpredictable branch in IT block\n");
7239                 break;
7240
7241               case 'X':
7242                 if (ifthen_state)
7243                   func (stream, "\t; unpredictable <IT:%s>",
7244                         arm_conditional[IFTHEN_COND]);
7245                 break;
7246
7247               case 'S':
7248                 {
7249                   long reg;
7250
7251                   reg = (given >> 3) & 0x7;
7252                   if (given & (1 << 6))
7253                     reg += 8;
7254
7255                   func (stream, "%s", arm_regnames[reg]);
7256                 }
7257                 break;
7258
7259               case 'D':
7260                 {
7261                   long reg;
7262
7263                   reg = given & 0x7;
7264                   if (given & (1 << 7))
7265                     reg += 8;
7266
7267                   func (stream, "%s", arm_regnames[reg]);
7268                 }
7269                 break;
7270
7271               case 'N':
7272                 if (given & (1 << 8))
7273                   domasklr = 1;
7274                 /* Fall through.  */
7275               case 'O':
7276                 if (*c == 'O' && (given & (1 << 8)))
7277                   domaskpc = 1;
7278                 /* Fall through.  */
7279               case 'M':
7280                 {
7281                   int started = 0;
7282                   int reg;
7283
7284                   func (stream, "{");
7285
7286                   /* It would be nice if we could spot
7287                      ranges, and generate the rS-rE format: */
7288                   for (reg = 0; (reg < 8); reg++)
7289                     if ((given & (1 << reg)) != 0)
7290                       {
7291                         if (started)
7292                           func (stream, ", ");
7293                         started = 1;
7294                         func (stream, "%s", arm_regnames[reg]);
7295                       }
7296
7297                   if (domasklr)
7298                     {
7299                       if (started)
7300                         func (stream, ", ");
7301                       started = 1;
7302                       func (stream, "%s", arm_regnames[14] /* "lr" */);
7303                     }
7304
7305                   if (domaskpc)
7306                     {
7307                       if (started)
7308                         func (stream, ", ");
7309                       func (stream, "%s", arm_regnames[15] /* "pc" */);
7310                     }
7311
7312                   func (stream, "}");
7313                 }
7314                 break;
7315
7316               case 'W':
7317                 /* Print writeback indicator for a LDMIA.  We are doing a
7318                    writeback if the base register is not in the register
7319                    mask.  */
7320                 if ((given & (1 << ((given & 0x0700) >> 8))) == 0)
7321                   func (stream, "!");
7322                 break;
7323
7324               case 'b':
7325                 /* Print ARM V6T2 CZB address: pc+4+6 bits.  */
7326                 {
7327                   bfd_vma address = (pc + 4
7328                                      + ((given & 0x00f8) >> 2)
7329                                      + ((given & 0x0200) >> 3));
7330                   info->print_address_func (address, info);
7331                 }
7332                 break;
7333
7334               case 's':
7335                 /* Right shift immediate -- bits 6..10; 1-31 print
7336                    as themselves, 0 prints as 32.  */
7337                 {
7338                   long imm = (given & 0x07c0) >> 6;
7339                   if (imm == 0)
7340                     imm = 32;
7341                   func (stream, "#%ld", imm);
7342                 }
7343                 break;
7344
7345               case '0': case '1': case '2': case '3': case '4':
7346               case '5': case '6': case '7': case '8': case '9':
7347                 {
7348                   int bitstart = *c++ - '0';
7349                   int bitend = 0;
7350
7351                   while (*c >= '0' && *c <= '9')
7352                     bitstart = (bitstart * 10) + *c++ - '0';
7353
7354                   switch (*c)
7355                     {
7356                     case '-':
7357                       {
7358                         bfd_vma reg;
7359
7360                         c++;
7361                         while (*c >= '0' && *c <= '9')
7362                           bitend = (bitend * 10) + *c++ - '0';
7363                         if (!bitend)
7364                           abort ();
7365                         reg = given >> bitstart;
7366                         reg &= (2 << (bitend - bitstart)) - 1;
7367
7368                         switch (*c)
7369                           {
7370                           case 'r':
7371                             func (stream, "%s", arm_regnames[reg]);
7372                             break;
7373
7374                           case 'd':
7375                             func (stream, "%ld", (long) reg);
7376                             value_in_comment = reg;
7377                             break;
7378
7379                           case 'H':
7380                             func (stream, "%ld", (long) (reg << 1));
7381                             value_in_comment = reg << 1;
7382                             break;
7383
7384                           case 'W':
7385                             func (stream, "%ld", (long) (reg << 2));
7386                             value_in_comment = reg << 2;
7387                             break;
7388
7389                           case 'a':
7390                             /* PC-relative address -- the bottom two
7391                                bits of the address are dropped
7392                                before the calculation.  */
7393                             info->print_address_func
7394                               (((pc + 4) & ~3) + (reg << 2), info);
7395                             value_in_comment = 0;
7396                             break;
7397
7398                           case 'x':
7399                             func (stream, "0x%04lx", (long) reg);
7400                             break;
7401
7402                           case 'B':
7403                             reg = ((reg ^ (1 << bitend)) - (1 << bitend));
7404                             info->print_address_func (reg * 2 + pc + 4, info);
7405                             value_in_comment = 0;
7406                             break;
7407
7408                           case 'c':
7409                             func (stream, "%s", arm_conditional [reg]);
7410                             break;
7411
7412                           default:
7413                             abort ();
7414                           }
7415                       }
7416                       break;
7417
7418                     case '\'':
7419                       c++;
7420                       if ((given & (1 << bitstart)) != 0)
7421                         func (stream, "%c", *c);
7422                       break;
7423
7424                     case '?':
7425                       ++c;
7426                       if ((given & (1 << bitstart)) != 0)
7427                         func (stream, "%c", *c++);
7428                       else
7429                         func (stream, "%c", *++c);
7430                       break;
7431
7432                     default:
7433                       abort ();
7434                     }
7435                 }
7436                 break;
7437
7438               default:
7439                 abort ();
7440               }
7441           }
7442
7443         if (value_in_comment > 32 || value_in_comment < -16)
7444           func (stream, "\t; 0x%lx", value_in_comment);
7445         return;
7446       }
7447
7448   /* No match.  */
7449   func (stream, UNKNOWN_INSTRUCTION_16BIT, (unsigned)given);
7450   return;
7451 }
7452
7453 /* Return the name of an V7M special register.  */
7454
7455 static const char *
7456 psr_name (int regno)
7457 {
7458   switch (regno)
7459     {
7460     case 0x0: return "APSR";
7461     case 0x1: return "IAPSR";
7462     case 0x2: return "EAPSR";
7463     case 0x3: return "PSR";
7464     case 0x5: return "IPSR";
7465     case 0x6: return "EPSR";
7466     case 0x7: return "IEPSR";
7467     case 0x8: return "MSP";
7468     case 0x9: return "PSP";
7469     case 0xa: return "MSPLIM";
7470     case 0xb: return "PSPLIM";
7471     case 0x10: return "PRIMASK";
7472     case 0x11: return "BASEPRI";
7473     case 0x12: return "BASEPRI_MAX";
7474     case 0x13: return "FAULTMASK";
7475     case 0x14: return "CONTROL";
7476     case 0x88: return "MSP_NS";
7477     case 0x89: return "PSP_NS";
7478     case 0x8a: return "MSPLIM_NS";
7479     case 0x8b: return "PSPLIM_NS";
7480     case 0x90: return "PRIMASK_NS";
7481     case 0x91: return "BASEPRI_NS";
7482     case 0x93: return "FAULTMASK_NS";
7483     case 0x94: return "CONTROL_NS";
7484     case 0x98: return "SP_NS";
7485     default: return "<unknown>";
7486     }
7487 }
7488
7489 /* Print one 32-bit Thumb instruction from PC on INFO->STREAM.  */
7490
7491 static void
7492 print_insn_thumb32 (bfd_vma pc, struct disassemble_info *info, long given)
7493 {
7494   const struct opcode32 *insn;
7495   void *stream = info->stream;
7496   fprintf_ftype func = info->fprintf_func;
7497   bfd_boolean is_mve = is_mve_architecture (info);
7498
7499   if (print_insn_coprocessor (pc, info, given, TRUE))
7500     return;
7501
7502   if ((is_mve == FALSE) && print_insn_neon (info, given, TRUE))
7503     return;
7504
7505   if (is_mve && print_insn_mve (info, given))
7506     return;
7507
7508   for (insn = thumb32_opcodes; insn->assembler; insn++)
7509     if ((given & insn->mask) == insn->value)
7510       {
7511         bfd_boolean is_clrm = FALSE;
7512         bfd_boolean is_unpredictable = FALSE;
7513         signed long value_in_comment = 0;
7514         const char *c = insn->assembler;
7515
7516         for (; *c; c++)
7517           {
7518             if (*c != '%')
7519               {
7520                 func (stream, "%c", *c);
7521                 continue;
7522               }
7523
7524             switch (*++c)
7525               {
7526               case '%':
7527                 func (stream, "%%");
7528                 break;
7529
7530               case 'c':
7531                 if (ifthen_state)
7532                   func (stream, "%s", arm_conditional[IFTHEN_COND]);
7533                 break;
7534
7535               case 'x':
7536                 if (ifthen_next_state)
7537                   func (stream, "\t; unpredictable branch in IT block\n");
7538                 break;
7539
7540               case 'X':
7541                 if (ifthen_state)
7542                   func (stream, "\t; unpredictable <IT:%s>",
7543                         arm_conditional[IFTHEN_COND]);
7544                 break;
7545
7546               case 'I':
7547                 {
7548                   unsigned int imm12 = 0;
7549
7550                   imm12 |= (given & 0x000000ffu);
7551                   imm12 |= (given & 0x00007000u) >> 4;
7552                   imm12 |= (given & 0x04000000u) >> 15;
7553                   func (stream, "#%u", imm12);
7554                   value_in_comment = imm12;
7555                 }
7556                 break;
7557
7558               case 'M':
7559                 {
7560                   unsigned int bits = 0, imm, imm8, mod;
7561
7562                   bits |= (given & 0x000000ffu);
7563                   bits |= (given & 0x00007000u) >> 4;
7564                   bits |= (given & 0x04000000u) >> 15;
7565                   imm8 = (bits & 0x0ff);
7566                   mod = (bits & 0xf00) >> 8;
7567                   switch (mod)
7568                     {
7569                     case 0: imm = imm8; break;
7570                     case 1: imm = ((imm8 << 16) | imm8); break;
7571                     case 2: imm = ((imm8 << 24) | (imm8 << 8)); break;
7572                     case 3: imm = ((imm8 << 24) | (imm8 << 16) | (imm8 << 8) | imm8); break;
7573                     default:
7574                       mod  = (bits & 0xf80) >> 7;
7575                       imm8 = (bits & 0x07f) | 0x80;
7576                       imm  = (((imm8 << (32 - mod)) | (imm8 >> mod)) & 0xffffffff);
7577                     }
7578                   func (stream, "#%u", imm);
7579                   value_in_comment = imm;
7580                 }
7581                 break;
7582
7583               case 'J':
7584                 {
7585                   unsigned int imm = 0;
7586
7587                   imm |= (given & 0x000000ffu);
7588                   imm |= (given & 0x00007000u) >> 4;
7589                   imm |= (given & 0x04000000u) >> 15;
7590                   imm |= (given & 0x000f0000u) >> 4;
7591                   func (stream, "#%u", imm);
7592                   value_in_comment = imm;
7593                 }
7594                 break;
7595
7596               case 'K':
7597                 {
7598                   unsigned int imm = 0;
7599
7600                   imm |= (given & 0x000f0000u) >> 16;
7601                   imm |= (given & 0x00000ff0u) >> 0;
7602                   imm |= (given & 0x0000000fu) << 12;
7603                   func (stream, "#%u", imm);
7604                   value_in_comment = imm;
7605                 }
7606                 break;
7607
7608               case 'H':
7609                 {
7610                   unsigned int imm = 0;
7611
7612                   imm |= (given & 0x000f0000u) >> 4;
7613                   imm |= (given & 0x00000fffu) >> 0;
7614                   func (stream, "#%u", imm);
7615                   value_in_comment = imm;
7616                 }
7617                 break;
7618
7619               case 'V':
7620                 {
7621                   unsigned int imm = 0;
7622
7623                   imm |= (given & 0x00000fffu);
7624                   imm |= (given & 0x000f0000u) >> 4;
7625                   func (stream, "#%u", imm);
7626                   value_in_comment = imm;
7627                 }
7628                 break;
7629
7630               case 'S':
7631                 {
7632                   unsigned int reg = (given & 0x0000000fu);
7633                   unsigned int stp = (given & 0x00000030u) >> 4;
7634                   unsigned int imm = 0;
7635                   imm |= (given & 0x000000c0u) >> 6;
7636                   imm |= (given & 0x00007000u) >> 10;
7637
7638                   func (stream, "%s", arm_regnames[reg]);
7639                   switch (stp)
7640                     {
7641                     case 0:
7642                       if (imm > 0)
7643                         func (stream, ", lsl #%u", imm);
7644                       break;
7645
7646                     case 1:
7647                       if (imm == 0)
7648                         imm = 32;
7649                       func (stream, ", lsr #%u", imm);
7650                       break;
7651
7652                     case 2:
7653                       if (imm == 0)
7654                         imm = 32;
7655                       func (stream, ", asr #%u", imm);
7656                       break;
7657
7658                     case 3:
7659                       if (imm == 0)
7660                         func (stream, ", rrx");
7661                       else
7662                         func (stream, ", ror #%u", imm);
7663                     }
7664                 }
7665                 break;
7666
7667               case 'a':
7668                 {
7669                   unsigned int Rn  = (given & 0x000f0000) >> 16;
7670                   unsigned int U   = ! NEGATIVE_BIT_SET;
7671                   unsigned int op  = (given & 0x00000f00) >> 8;
7672                   unsigned int i12 = (given & 0x00000fff);
7673                   unsigned int i8  = (given & 0x000000ff);
7674                   bfd_boolean writeback = FALSE, postind = FALSE;
7675                   bfd_vma offset = 0;
7676
7677                   func (stream, "[%s", arm_regnames[Rn]);
7678                   if (U) /* 12-bit positive immediate offset.  */
7679                     {
7680                       offset = i12;
7681                       if (Rn != 15)
7682                         value_in_comment = offset;
7683                     }
7684                   else if (Rn == 15) /* 12-bit negative immediate offset.  */
7685                     offset = - (int) i12;
7686                   else if (op == 0x0) /* Shifted register offset.  */
7687                     {
7688                       unsigned int Rm = (i8 & 0x0f);
7689                       unsigned int sh = (i8 & 0x30) >> 4;
7690
7691                       func (stream, ", %s", arm_regnames[Rm]);
7692                       if (sh)
7693                         func (stream, ", lsl #%u", sh);
7694                       func (stream, "]");
7695                       break;
7696                     }
7697                   else switch (op)
7698                     {
7699                     case 0xE:  /* 8-bit positive immediate offset.  */
7700                       offset = i8;
7701                       break;
7702
7703                     case 0xC:  /* 8-bit negative immediate offset.  */
7704                       offset = -i8;
7705                       break;
7706
7707                     case 0xF:  /* 8-bit + preindex with wb.  */
7708                       offset = i8;
7709                       writeback = TRUE;
7710                       break;
7711
7712                     case 0xD:  /* 8-bit - preindex with wb.  */
7713                       offset = -i8;
7714                       writeback = TRUE;
7715                       break;
7716
7717                     case 0xB:  /* 8-bit + postindex.  */
7718                       offset = i8;
7719                       postind = TRUE;
7720                       break;
7721
7722                     case 0x9:  /* 8-bit - postindex.  */
7723                       offset = -i8;
7724                       postind = TRUE;
7725                       break;
7726
7727                     default:
7728                       func (stream, ", <undefined>]");
7729                       goto skip;
7730                     }
7731
7732                   if (postind)
7733                     func (stream, "], #%d", (int) offset);
7734                   else
7735                     {
7736                       if (offset)
7737                         func (stream, ", #%d", (int) offset);
7738                       func (stream, writeback ? "]!" : "]");
7739                     }
7740
7741                   if (Rn == 15)
7742                     {
7743                       func (stream, "\t; ");
7744                       info->print_address_func (((pc + 4) & ~3) + offset, info);
7745                     }
7746                 }
7747               skip:
7748                 break;
7749
7750               case 'A':
7751                 {
7752                   unsigned int U   = ! NEGATIVE_BIT_SET;
7753                   unsigned int W   = WRITEBACK_BIT_SET;
7754                   unsigned int Rn  = (given & 0x000f0000) >> 16;
7755                   unsigned int off = (given & 0x000000ff);
7756
7757                   func (stream, "[%s", arm_regnames[Rn]);
7758
7759                   if (PRE_BIT_SET)
7760                     {
7761                       if (off || !U)
7762                         {
7763                           func (stream, ", #%c%u", U ? '+' : '-', off * 4);
7764                           value_in_comment = off * 4 * (U ? 1 : -1);
7765                         }
7766                       func (stream, "]");
7767                       if (W)
7768                         func (stream, "!");
7769                     }
7770                   else
7771                     {
7772                       func (stream, "], ");
7773                       if (W)
7774                         {
7775                           func (stream, "#%c%u", U ? '+' : '-', off * 4);
7776                           value_in_comment = off * 4 * (U ? 1 : -1);
7777                         }
7778                       else
7779                         {
7780                           func (stream, "{%u}", off);
7781                           value_in_comment = off;
7782                         }
7783                     }
7784                 }
7785                 break;
7786
7787               case 'w':
7788                 {
7789                   unsigned int Sbit = (given & 0x01000000) >> 24;
7790                   unsigned int type = (given & 0x00600000) >> 21;
7791
7792                   switch (type)
7793                     {
7794                     case 0: func (stream, Sbit ? "sb" : "b"); break;
7795                     case 1: func (stream, Sbit ? "sh" : "h"); break;
7796                     case 2:
7797                       if (Sbit)
7798                         func (stream, "??");
7799                       break;
7800                     case 3:
7801                       func (stream, "??");
7802                       break;
7803                     }
7804                 }
7805                 break;
7806
7807               case 'n':
7808                 is_clrm = TRUE;
7809                 /* Fall through.  */
7810               case 'm':
7811                 {
7812                   int started = 0;
7813                   int reg;
7814
7815                   func (stream, "{");
7816                   for (reg = 0; reg < 16; reg++)
7817                     if ((given & (1 << reg)) != 0)
7818                       {
7819                         if (started)
7820                           func (stream, ", ");
7821                         started = 1;
7822                         if (is_clrm && reg == 13)
7823                           func (stream, "(invalid: %s)", arm_regnames[reg]);
7824                         else if (is_clrm && reg == 15)
7825                           func (stream, "%s", "APSR");
7826                         else
7827                           func (stream, "%s", arm_regnames[reg]);
7828                       }
7829                   func (stream, "}");
7830                 }
7831                 break;
7832
7833               case 'E':
7834                 {
7835                   unsigned int msb = (given & 0x0000001f);
7836                   unsigned int lsb = 0;
7837
7838                   lsb |= (given & 0x000000c0u) >> 6;
7839                   lsb |= (given & 0x00007000u) >> 10;
7840                   func (stream, "#%u, #%u", lsb, msb - lsb + 1);
7841                 }
7842                 break;
7843
7844               case 'F':
7845                 {
7846                   unsigned int width = (given & 0x0000001f) + 1;
7847                   unsigned int lsb = 0;
7848
7849                   lsb |= (given & 0x000000c0u) >> 6;
7850                   lsb |= (given & 0x00007000u) >> 10;
7851                   func (stream, "#%u, #%u", lsb, width);
7852                 }
7853                 break;
7854
7855               case 'G':
7856                 {
7857                   unsigned int boff = (((given & 0x07800000) >> 23) << 1);
7858                   func (stream, "%x", boff);
7859                 }
7860                 break;
7861
7862               case 'W':
7863                 {
7864                   unsigned int immA = (given & 0x001f0000u) >> 16;
7865                   unsigned int immB = (given & 0x000007feu) >> 1;
7866                   unsigned int immC = (given & 0x00000800u) >> 11;
7867                   bfd_vma offset = 0;
7868
7869                   offset |= immA << 12;
7870                   offset |= immB << 2;
7871                   offset |= immC << 1;
7872                   /* Sign extend.  */
7873                   offset = (offset & 0x10000) ? offset - (1 << 17) : offset;
7874
7875                   info->print_address_func (pc + 4 + offset, info);
7876                 }
7877                 break;
7878
7879               case 'Y':
7880                 {
7881                   unsigned int immA = (given & 0x007f0000u) >> 16;
7882                   unsigned int immB = (given & 0x000007feu) >> 1;
7883                   unsigned int immC = (given & 0x00000800u) >> 11;
7884                   bfd_vma offset = 0;
7885
7886                   offset |= immA << 12;
7887                   offset |= immB << 2;
7888                   offset |= immC << 1;
7889                   /* Sign extend.  */
7890                   offset = (offset & 0x40000) ? offset - (1 << 19) : offset;
7891
7892                   info->print_address_func (pc + 4 + offset, info);
7893                 }
7894                 break;
7895
7896               case 'Z':
7897                 {
7898                   unsigned int immA = (given & 0x00010000u) >> 16;
7899                   unsigned int immB = (given & 0x000007feu) >> 1;
7900                   unsigned int immC = (given & 0x00000800u) >> 11;
7901                   bfd_vma offset = 0;
7902
7903                   offset |= immA << 12;
7904                   offset |= immB << 2;
7905                   offset |= immC << 1;
7906                   /* Sign extend.  */
7907                   offset = (offset & 0x1000) ? offset - (1 << 13) : offset;
7908
7909                   info->print_address_func (pc + 4 + offset, info);
7910
7911                   unsigned int T    = (given & 0x00020000u) >> 17;
7912                   unsigned int endoffset = (((given & 0x07800000) >> 23) << 1);
7913                   unsigned int boffset   = (T == 1) ? 4 : 2;
7914                   func (stream, ", ");
7915                   func (stream, "%x", endoffset + boffset);
7916                 }
7917                 break;
7918
7919               case 'Q':
7920                 {
7921                   unsigned int immh = (given & 0x000007feu) >> 1;
7922                   unsigned int imml = (given & 0x00000800u) >> 11;
7923                   bfd_vma imm32 = 0;
7924
7925                   imm32 |= immh << 2;
7926                   imm32 |= imml << 1;
7927
7928                   info->print_address_func (pc + 4 + imm32, info);
7929                 }
7930                 break;
7931
7932               case 'P':
7933                 {
7934                   unsigned int immh = (given & 0x000007feu) >> 1;
7935                   unsigned int imml = (given & 0x00000800u) >> 11;
7936                   bfd_vma imm32 = 0;
7937
7938                   imm32 |= immh << 2;
7939                   imm32 |= imml << 1;
7940
7941                   info->print_address_func (pc + 4 - imm32, info);
7942                 }
7943                 break;
7944
7945               case 'b':
7946                 {
7947                   unsigned int S = (given & 0x04000000u) >> 26;
7948                   unsigned int J1 = (given & 0x00002000u) >> 13;
7949                   unsigned int J2 = (given & 0x00000800u) >> 11;
7950                   bfd_vma offset = 0;
7951
7952                   offset |= !S << 20;
7953                   offset |= J2 << 19;
7954                   offset |= J1 << 18;
7955                   offset |= (given & 0x003f0000) >> 4;
7956                   offset |= (given & 0x000007ff) << 1;
7957                   offset -= (1 << 20);
7958
7959                   info->print_address_func (pc + 4 + offset, info);
7960                 }
7961                 break;
7962
7963               case 'B':
7964                 {
7965                   unsigned int S = (given & 0x04000000u) >> 26;
7966                   unsigned int I1 = (given & 0x00002000u) >> 13;
7967                   unsigned int I2 = (given & 0x00000800u) >> 11;
7968                   bfd_vma offset = 0;
7969
7970                   offset |= !S << 24;
7971                   offset |= !(I1 ^ S) << 23;
7972                   offset |= !(I2 ^ S) << 22;
7973                   offset |= (given & 0x03ff0000u) >> 4;
7974                   offset |= (given & 0x000007ffu) << 1;
7975                   offset -= (1 << 24);
7976                   offset += pc + 4;
7977
7978                   /* BLX target addresses are always word aligned.  */
7979                   if ((given & 0x00001000u) == 0)
7980                       offset &= ~2u;
7981
7982                   info->print_address_func (offset, info);
7983                 }
7984                 break;
7985
7986               case 's':
7987                 {
7988                   unsigned int shift = 0;
7989
7990                   shift |= (given & 0x000000c0u) >> 6;
7991                   shift |= (given & 0x00007000u) >> 10;
7992                   if (WRITEBACK_BIT_SET)
7993                     func (stream, ", asr #%u", shift);
7994                   else if (shift)
7995                     func (stream, ", lsl #%u", shift);
7996                   /* else print nothing - lsl #0 */
7997                 }
7998                 break;
7999
8000               case 'R':
8001                 {
8002                   unsigned int rot = (given & 0x00000030) >> 4;
8003
8004                   if (rot)
8005                     func (stream, ", ror #%u", rot * 8);
8006                 }
8007                 break;
8008
8009               case 'U':
8010                 if ((given & 0xf0) == 0x60)
8011                   {
8012                     switch (given & 0xf)
8013                       {
8014                         case 0xf: func (stream, "sy"); break;
8015                         default:
8016                           func (stream, "#%d", (int) given & 0xf);
8017                               break;
8018                       }
8019                   }
8020                 else
8021                   {
8022                     const char * opt = data_barrier_option (given & 0xf);
8023                     if (opt != NULL)
8024                       func (stream, "%s", opt);
8025                     else
8026                       func (stream, "#%d", (int) given & 0xf);
8027                    }
8028                 break;
8029
8030               case 'C':
8031                 if ((given & 0xff) == 0)
8032                   {
8033                     func (stream, "%cPSR_", (given & 0x100000) ? 'S' : 'C');
8034                     if (given & 0x800)
8035                       func (stream, "f");
8036                     if (given & 0x400)
8037                       func (stream, "s");
8038                     if (given & 0x200)
8039                       func (stream, "x");
8040                     if (given & 0x100)
8041                       func (stream, "c");
8042                   }
8043                 else if ((given & 0x20) == 0x20)
8044                   {
8045                     char const* name;
8046                     unsigned sysm = (given & 0xf00) >> 8;
8047
8048                     sysm |= (given & 0x30);
8049                     sysm |= (given & 0x00100000) >> 14;
8050                     name = banked_regname (sysm);
8051
8052                     if (name != NULL)
8053                       func (stream, "%s", name);
8054                     else
8055                       func (stream, "(UNDEF: %lu)", (unsigned long) sysm);
8056                   }
8057                 else
8058                   {
8059                     func (stream, "%s", psr_name (given & 0xff));
8060                   }
8061                 break;
8062
8063               case 'D':
8064                 if (((given & 0xff) == 0)
8065                     || ((given & 0x20) == 0x20))
8066                   {
8067                     char const* name;
8068                     unsigned sm = (given & 0xf0000) >> 16;
8069
8070                     sm |= (given & 0x30);
8071                     sm |= (given & 0x00100000) >> 14;
8072                     name = banked_regname (sm);
8073
8074                     if (name != NULL)
8075                       func (stream, "%s", name);
8076                     else
8077                       func (stream, "(UNDEF: %lu)", (unsigned long) sm);
8078                   }
8079                 else
8080                   func (stream, "%s", psr_name (given & 0xff));
8081                 break;
8082
8083               case '0': case '1': case '2': case '3': case '4':
8084               case '5': case '6': case '7': case '8': case '9':
8085                 {
8086                   int width;
8087                   unsigned long val;
8088
8089                   c = arm_decode_bitfield (c, given, &val, &width);
8090
8091                   switch (*c)
8092                     {
8093                     case 'd':
8094                       func (stream, "%lu", val);
8095                       value_in_comment = val;
8096                       break;
8097
8098                     case 'D':
8099                       func (stream, "%lu", val + 1);
8100                       value_in_comment = val + 1;
8101                       break;
8102
8103                     case 'W':
8104                       func (stream, "%lu", val * 4);
8105                       value_in_comment = val * 4;
8106                       break;
8107
8108                     case 'S':
8109                       if (val == 13)
8110                         is_unpredictable = TRUE;
8111                       /* Fall through.  */
8112                     case 'R':
8113                       if (val == 15)
8114                         is_unpredictable = TRUE;
8115                       /* Fall through.  */
8116                     case 'r':
8117                       func (stream, "%s", arm_regnames[val]);
8118                       break;
8119
8120                     case 'c':
8121                       func (stream, "%s", arm_conditional[val]);
8122                       break;
8123
8124                     case '\'':
8125                       c++;
8126                       if (val == ((1ul << width) - 1))
8127                         func (stream, "%c", *c);
8128                       break;
8129
8130                     case '`':
8131                       c++;
8132                       if (val == 0)
8133                         func (stream, "%c", *c);
8134                       break;
8135
8136                     case '?':
8137                       func (stream, "%c", c[(1 << width) - (int) val]);
8138                       c += 1 << width;
8139                       break;
8140
8141                     case 'x':
8142                       func (stream, "0x%lx", val & 0xffffffffUL);
8143                       break;
8144
8145                     default:
8146                       abort ();
8147                     }
8148                 }
8149                 break;
8150
8151               case 'L':
8152                 /* PR binutils/12534
8153                    If we have a PC relative offset in an LDRD or STRD
8154                    instructions then display the decoded address.  */
8155                 if (((given >> 16) & 0xf) == 0xf)
8156                   {
8157                     bfd_vma offset = (given & 0xff) * 4;
8158
8159                     if ((given & (1 << 23)) == 0)
8160                       offset = - offset;
8161                     func (stream, "\t; ");
8162                     info->print_address_func ((pc & ~3) + 4 + offset, info);
8163                   }
8164                 break;
8165
8166               default:
8167                 abort ();
8168               }
8169           }
8170
8171         if (value_in_comment > 32 || value_in_comment < -16)
8172           func (stream, "\t; 0x%lx", value_in_comment);
8173
8174         if (is_unpredictable)
8175           func (stream, UNPREDICTABLE_INSTRUCTION);
8176
8177         return;
8178       }
8179
8180   /* No match.  */
8181   func (stream, UNKNOWN_INSTRUCTION_32BIT, (unsigned)given);
8182   return;
8183 }
8184
8185 /* Print data bytes on INFO->STREAM.  */
8186
8187 static void
8188 print_insn_data (bfd_vma pc ATTRIBUTE_UNUSED,
8189                  struct disassemble_info *info,
8190                  long given)
8191 {
8192   switch (info->bytes_per_chunk)
8193     {
8194     case 1:
8195       info->fprintf_func (info->stream, ".byte\t0x%02lx", given);
8196       break;
8197     case 2:
8198       info->fprintf_func (info->stream, ".short\t0x%04lx", given);
8199       break;
8200     case 4:
8201       info->fprintf_func (info->stream, ".word\t0x%08lx", given);
8202       break;
8203     default:
8204       abort ();
8205     }
8206 }
8207
8208 /* Disallow mapping symbols ($a, $b, $d, $t etc) from
8209    being displayed in symbol relative addresses.
8210
8211    Also disallow private symbol, with __tagsym$$ prefix,
8212    from ARM RVCT toolchain being displayed.  */
8213
8214 bfd_boolean
8215 arm_symbol_is_valid (asymbol * sym,
8216                      struct disassemble_info * info ATTRIBUTE_UNUSED)
8217 {
8218   const char * name;
8219
8220   if (sym == NULL)
8221     return FALSE;
8222
8223   name = bfd_asymbol_name (sym);
8224
8225   return (name && *name != '$' && strncmp (name, "__tagsym$$", 10));
8226 }
8227
8228 /* Parse the string of disassembler options.  */
8229
8230 static void
8231 parse_arm_disassembler_options (const char *options)
8232 {
8233   const char *opt;
8234
8235   FOR_EACH_DISASSEMBLER_OPTION (opt, options)
8236     {
8237       if (CONST_STRNEQ (opt, "reg-names-"))
8238         {
8239           unsigned int i;
8240           for (i = 0; i < NUM_ARM_OPTIONS; i++)
8241             if (disassembler_options_cmp (opt, regnames[i].name) == 0)
8242               {
8243                 regname_selected = i;
8244                 break;
8245               }
8246
8247           if (i >= NUM_ARM_OPTIONS)
8248             /* xgettext: c-format */
8249             opcodes_error_handler (_("unrecognised register name set: %s"),
8250                                    opt);
8251         }
8252       else if (CONST_STRNEQ (opt, "force-thumb"))
8253         force_thumb = 1;
8254       else if (CONST_STRNEQ (opt, "no-force-thumb"))
8255         force_thumb = 0;
8256       else
8257         /* xgettext: c-format */
8258         opcodes_error_handler (_("unrecognised disassembler option: %s"), opt);
8259     }
8260
8261   return;
8262 }
8263
8264 static bfd_boolean
8265 mapping_symbol_for_insn (bfd_vma pc, struct disassemble_info *info,
8266                          enum map_type *map_symbol);
8267
8268 /* Search back through the insn stream to determine if this instruction is
8269    conditionally executed.  */
8270
8271 static void
8272 find_ifthen_state (bfd_vma pc,
8273                    struct disassemble_info *info,
8274                    bfd_boolean little)
8275 {
8276   unsigned char b[2];
8277   unsigned int insn;
8278   int status;
8279   /* COUNT is twice the number of instructions seen.  It will be odd if we
8280      just crossed an instruction boundary.  */
8281   int count;
8282   int it_count;
8283   unsigned int seen_it;
8284   bfd_vma addr;
8285
8286   ifthen_address = pc;
8287   ifthen_state = 0;
8288
8289   addr = pc;
8290   count = 1;
8291   it_count = 0;
8292   seen_it = 0;
8293   /* Scan backwards looking for IT instructions, keeping track of where
8294      instruction boundaries are.  We don't know if something is actually an
8295      IT instruction until we find a definite instruction boundary.  */
8296   for (;;)
8297     {
8298       if (addr == 0 || info->symbol_at_address_func (addr, info))
8299         {
8300           /* A symbol must be on an instruction boundary, and will not
8301              be within an IT block.  */
8302           if (seen_it && (count & 1))
8303             break;
8304
8305           return;
8306         }
8307       addr -= 2;
8308       status = info->read_memory_func (addr, (bfd_byte *) b, 2, info);
8309       if (status)
8310         return;
8311
8312       if (little)
8313         insn = (b[0]) | (b[1] << 8);
8314       else
8315         insn = (b[1]) | (b[0] << 8);
8316       if (seen_it)
8317         {
8318           if ((insn & 0xf800) < 0xe800)
8319             {
8320               /* Addr + 2 is an instruction boundary.  See if this matches
8321                  the expected boundary based on the position of the last
8322                  IT candidate.  */
8323               if (count & 1)
8324                 break;
8325               seen_it = 0;
8326             }
8327         }
8328       if ((insn & 0xff00) == 0xbf00 && (insn & 0xf) != 0)
8329         {
8330           enum map_type type = MAP_ARM;
8331           bfd_boolean found = mapping_symbol_for_insn (addr, info, &type);
8332
8333           if (!found || (found && type == MAP_THUMB))
8334             {
8335               /* This could be an IT instruction.  */
8336               seen_it = insn;
8337               it_count = count >> 1;
8338             }
8339         }
8340       if ((insn & 0xf800) >= 0xe800)
8341         count++;
8342       else
8343         count = (count + 2) | 1;
8344       /* IT blocks contain at most 4 instructions.  */
8345       if (count >= 8 && !seen_it)
8346         return;
8347     }
8348   /* We found an IT instruction.  */
8349   ifthen_state = (seen_it & 0xe0) | ((seen_it << it_count) & 0x1f);
8350   if ((ifthen_state & 0xf) == 0)
8351     ifthen_state = 0;
8352 }
8353
8354 /* Returns nonzero and sets *MAP_TYPE if the N'th symbol is a
8355    mapping symbol.  */
8356
8357 static int
8358 is_mapping_symbol (struct disassemble_info *info, int n,
8359                    enum map_type *map_type)
8360 {
8361   const char *name;
8362
8363   name = bfd_asymbol_name (info->symtab[n]);
8364   if (name[0] == '$' && (name[1] == 'a' || name[1] == 't' || name[1] == 'd')
8365       && (name[2] == 0 || name[2] == '.'))
8366     {
8367       *map_type = ((name[1] == 'a') ? MAP_ARM
8368                    : (name[1] == 't') ? MAP_THUMB
8369                    : MAP_DATA);
8370       return TRUE;
8371     }
8372
8373   return FALSE;
8374 }
8375
8376 /* Try to infer the code type (ARM or Thumb) from a mapping symbol.
8377    Returns nonzero if *MAP_TYPE was set.  */
8378
8379 static int
8380 get_map_sym_type (struct disassemble_info *info,
8381                   int n,
8382                   enum map_type *map_type)
8383 {
8384   /* If the symbol is in a different section, ignore it.  */
8385   if (info->section != NULL && info->section != info->symtab[n]->section)
8386     return FALSE;
8387
8388   return is_mapping_symbol (info, n, map_type);
8389 }
8390
8391 /* Try to infer the code type (ARM or Thumb) from a non-mapping symbol.
8392    Returns nonzero if *MAP_TYPE was set.  */
8393
8394 static int
8395 get_sym_code_type (struct disassemble_info *info,
8396                    int n,
8397                    enum map_type *map_type)
8398 {
8399   elf_symbol_type *es;
8400   unsigned int type;
8401
8402   /* If the symbol is in a different section, ignore it.  */
8403   if (info->section != NULL && info->section != info->symtab[n]->section)
8404     return FALSE;
8405
8406   es = *(elf_symbol_type **)(info->symtab + n);
8407   type = ELF_ST_TYPE (es->internal_elf_sym.st_info);
8408
8409   /* If the symbol has function type then use that.  */
8410   if (type == STT_FUNC || type == STT_GNU_IFUNC)
8411     {
8412       if (ARM_GET_SYM_BRANCH_TYPE (es->internal_elf_sym.st_target_internal)
8413           == ST_BRANCH_TO_THUMB)
8414         *map_type = MAP_THUMB;
8415       else
8416         *map_type = MAP_ARM;
8417       return TRUE;
8418     }
8419
8420   return FALSE;
8421 }
8422
8423 /* Search the mapping symbol state for instruction at pc.  This is only
8424    applicable for elf target.
8425
8426    There is an assumption Here, info->private_data contains the correct AND
8427    up-to-date information about current scan process.  The information will be
8428    used to speed this search process.
8429
8430    Return TRUE if the mapping state can be determined, and map_symbol
8431    will be updated accordingly.  Otherwise, return FALSE.  */
8432
8433 static bfd_boolean
8434 mapping_symbol_for_insn (bfd_vma pc, struct disassemble_info *info,
8435                          enum map_type *map_symbol)
8436 {
8437   bfd_vma addr, section_vma = 0;
8438   int n, last_sym = -1;
8439   bfd_boolean found = FALSE;
8440   bfd_boolean can_use_search_opt_p = FALSE;
8441
8442   /* Default to DATA.  A text section is required by the ABI to contain an
8443      INSN mapping symbol at the start.  A data section has no such
8444      requirement, hence if no mapping symbol is found the section must
8445      contain only data.  This however isn't very useful if the user has
8446      fully stripped the binaries.  If this is the case use the section
8447      attributes to determine the default.  If we have no section default to
8448      INSN as well, as we may be disassembling some raw bytes on a baremetal
8449      HEX file or similar.  */
8450   enum map_type type = MAP_DATA;
8451   if ((info->section && info->section->flags & SEC_CODE) || !info->section)
8452     type = MAP_ARM;
8453   struct arm_private_data *private_data;
8454
8455   if (info->private_data == NULL
8456       || bfd_asymbol_flavour (*info->symtab) != bfd_target_elf_flavour)
8457     return FALSE;
8458
8459   private_data = info->private_data;
8460
8461   /* First, look for mapping symbols.  */
8462   if (info->symtab_size != 0)
8463   {
8464     if (pc <= private_data->last_mapping_addr)
8465       private_data->last_mapping_sym = -1;
8466
8467     /* Start scanning at the start of the function, or wherever
8468        we finished last time.  */
8469     n = info->symtab_pos + 1;
8470
8471     /* If the last stop offset is different from the current one it means we
8472        are disassembling a different glob of bytes.  As such the optimization
8473        would not be safe and we should start over.  */
8474     can_use_search_opt_p
8475       = private_data->last_mapping_sym >= 0
8476         && info->stop_offset == private_data->last_stop_offset;
8477
8478     if (n >= private_data->last_mapping_sym && can_use_search_opt_p)
8479       n = private_data->last_mapping_sym;
8480
8481     /* Look down while we haven't passed the location being disassembled.
8482        The reason for this is that there's no defined order between a symbol
8483        and an mapping symbol that may be at the same address.  We may have to
8484        look at least one position ahead.  */
8485     for (; n < info->symtab_size; n++)
8486       {
8487         addr = bfd_asymbol_value (info->symtab[n]);
8488         if (addr > pc)
8489           break;
8490         if (get_map_sym_type (info, n, &type))
8491           {
8492             last_sym = n;
8493             found = TRUE;
8494           }
8495       }
8496
8497     if (!found)
8498       {
8499         n = info->symtab_pos;
8500         if (n >= private_data->last_mapping_sym && can_use_search_opt_p)
8501           n = private_data->last_mapping_sym;
8502
8503         /* No mapping symbol found at this address.  Look backwards
8504            for a preceeding one, but don't go pass the section start
8505            otherwise a data section with no mapping symbol can pick up
8506            a text mapping symbol of a preceeding section.  The documentation
8507            says section can be NULL, in which case we will seek up all the
8508            way to the top.  */
8509         if (info->section)
8510           section_vma = info->section->vma;
8511
8512         for (; n >= 0; n--)
8513           {
8514             addr = bfd_asymbol_value (info->symtab[n]);
8515             if (addr < section_vma)
8516               break;
8517
8518             if (get_map_sym_type (info, n, &type))
8519               {
8520                 last_sym = n;
8521                 found = TRUE;
8522                 break;
8523               }
8524           }
8525       }
8526   }
8527
8528   /* If no mapping symbol was found, try looking up without a mapping
8529      symbol.  This is done by walking up from the current PC to the nearest
8530      symbol.  We don't actually have to loop here since symtab_pos will
8531      contain the nearest symbol already.  */
8532   if (!found)
8533     {
8534       n = info->symtab_pos;
8535       if (n >= 0 && get_sym_code_type (info, n, &type))
8536         {
8537           last_sym = n;
8538           found = TRUE;
8539         }
8540     }
8541
8542   private_data->last_mapping_sym = last_sym;
8543   private_data->last_type = type;
8544   private_data->last_stop_offset = info->stop_offset;
8545
8546   *map_symbol = type;
8547   return found;
8548 }
8549
8550 /* Given a bfd_mach_arm_XXX value, this function fills in the fields
8551    of the supplied arm_feature_set structure with bitmasks indicating
8552    the supported base architectures and coprocessor extensions.
8553
8554    FIXME: This could more efficiently implemented as a constant array,
8555    although it would also be less robust.  */
8556
8557 static void
8558 select_arm_features (unsigned long mach,
8559                      arm_feature_set * features)
8560 {
8561   arm_feature_set arch_fset;
8562   const arm_feature_set fpu_any = FPU_ANY;
8563
8564 #undef ARM_SET_FEATURES
8565 #define ARM_SET_FEATURES(FSET) \
8566   {                                                     \
8567     const arm_feature_set fset = FSET;                  \
8568     arch_fset = fset;                                   \
8569   }
8570
8571   /* When several architecture versions share the same bfd_mach_arm_XXX value
8572      the most featureful is chosen.  */
8573   switch (mach)
8574     {
8575     case bfd_mach_arm_2:         ARM_SET_FEATURES (ARM_ARCH_V2); break;
8576     case bfd_mach_arm_2a:        ARM_SET_FEATURES (ARM_ARCH_V2S); break;
8577     case bfd_mach_arm_3:         ARM_SET_FEATURES (ARM_ARCH_V3); break;
8578     case bfd_mach_arm_3M:        ARM_SET_FEATURES (ARM_ARCH_V3M); break;
8579     case bfd_mach_arm_4:         ARM_SET_FEATURES (ARM_ARCH_V4); break;
8580     case bfd_mach_arm_4T:        ARM_SET_FEATURES (ARM_ARCH_V4T); break;
8581     case bfd_mach_arm_5:         ARM_SET_FEATURES (ARM_ARCH_V5); break;
8582     case bfd_mach_arm_5T:        ARM_SET_FEATURES (ARM_ARCH_V5T); break;
8583     case bfd_mach_arm_5TE:       ARM_SET_FEATURES (ARM_ARCH_V5TE); break;
8584     case bfd_mach_arm_XScale:    ARM_SET_FEATURES (ARM_ARCH_XSCALE); break;
8585     case bfd_mach_arm_ep9312:
8586         ARM_SET_FEATURES (ARM_FEATURE_LOW (ARM_AEXT_V4T,
8587                                            ARM_CEXT_MAVERICK | FPU_MAVERICK));
8588        break;
8589     case bfd_mach_arm_iWMMXt:    ARM_SET_FEATURES (ARM_ARCH_IWMMXT); break;
8590     case bfd_mach_arm_iWMMXt2:   ARM_SET_FEATURES (ARM_ARCH_IWMMXT2); break;
8591     case bfd_mach_arm_5TEJ:      ARM_SET_FEATURES (ARM_ARCH_V5TEJ); break;
8592     case bfd_mach_arm_6:         ARM_SET_FEATURES (ARM_ARCH_V6); break;
8593     case bfd_mach_arm_6KZ:       ARM_SET_FEATURES (ARM_ARCH_V6KZ); break;
8594     case bfd_mach_arm_6T2:       ARM_SET_FEATURES (ARM_ARCH_V6KZT2); break;
8595     case bfd_mach_arm_6K:        ARM_SET_FEATURES (ARM_ARCH_V6K); break;
8596     case bfd_mach_arm_7:         ARM_SET_FEATURES (ARM_ARCH_V7VE); break;
8597     case bfd_mach_arm_6M:        ARM_SET_FEATURES (ARM_ARCH_V6M); break;
8598     case bfd_mach_arm_6SM:       ARM_SET_FEATURES (ARM_ARCH_V6SM); break;
8599     case bfd_mach_arm_7EM:       ARM_SET_FEATURES (ARM_ARCH_V7EM); break;
8600     case bfd_mach_arm_8:
8601         {
8602           /* Add bits for extensions that Armv8.5-A recognizes.  */
8603           arm_feature_set armv8_5_ext_fset
8604             = ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST);
8605           ARM_SET_FEATURES (ARM_ARCH_V8_5A);
8606           ARM_MERGE_FEATURE_SETS (arch_fset, arch_fset, armv8_5_ext_fset);
8607           break;
8608         }
8609     case bfd_mach_arm_8R:        ARM_SET_FEATURES (ARM_ARCH_V8R); break;
8610     case bfd_mach_arm_8M_BASE:   ARM_SET_FEATURES (ARM_ARCH_V8M_BASE); break;
8611     case bfd_mach_arm_8M_MAIN:   ARM_SET_FEATURES (ARM_ARCH_V8M_MAIN); break;
8612     case bfd_mach_arm_8_1M_MAIN:
8613       ARM_SET_FEATURES (ARM_ARCH_V8_1M_MAIN);
8614       force_thumb = 1;
8615       break;
8616       /* If the machine type is unknown allow all architecture types and all
8617          extensions.  */
8618     case bfd_mach_arm_unknown:   ARM_SET_FEATURES (ARM_FEATURE_ALL); break;
8619     default:
8620       abort ();
8621     }
8622 #undef ARM_SET_FEATURES
8623
8624   /* None of the feature bits related to -mfpu have an impact on Tag_CPU_arch
8625      and thus on bfd_mach_arm_XXX value.  Therefore for a given
8626      bfd_mach_arm_XXX value all coprocessor feature bits should be allowed.  */
8627   ARM_MERGE_FEATURE_SETS (*features, arch_fset, fpu_any);
8628 }
8629
8630
8631 /* NOTE: There are no checks in these routines that
8632    the relevant number of data bytes exist.  */
8633
8634 static int
8635 print_insn (bfd_vma pc, struct disassemble_info *info, bfd_boolean little)
8636 {
8637   unsigned char b[4];
8638   long          given;
8639   int           status;
8640   int           is_thumb = FALSE;
8641   int           is_data = FALSE;
8642   int           little_code;
8643   unsigned int  size = 4;
8644   void          (*printer) (bfd_vma, struct disassemble_info *, long);
8645   bfd_boolean   found = FALSE;
8646   struct arm_private_data *private_data;
8647
8648   if (info->disassembler_options)
8649     {
8650       parse_arm_disassembler_options (info->disassembler_options);
8651
8652       /* To avoid repeated parsing of these options, we remove them here.  */
8653       info->disassembler_options = NULL;
8654     }
8655
8656   /* PR 10288: Control which instructions will be disassembled.  */
8657   if (info->private_data == NULL)
8658     {
8659       static struct arm_private_data private;
8660
8661       if ((info->flags & USER_SPECIFIED_MACHINE_TYPE) == 0)
8662         /* If the user did not use the -m command line switch then default to
8663            disassembling all types of ARM instruction.
8664
8665            The info->mach value has to be ignored as this will be based on
8666            the default archictecture for the target and/or hints in the notes
8667            section, but it will never be greater than the current largest arm
8668            machine value (iWMMXt2), which is only equivalent to the V5TE
8669            architecture.  ARM architectures have advanced beyond the machine
8670            value encoding, and these newer architectures would be ignored if
8671            the machine value was used.
8672
8673            Ie the -m switch is used to restrict which instructions will be
8674            disassembled.  If it is necessary to use the -m switch to tell
8675            objdump that an ARM binary is being disassembled, eg because the
8676            input is a raw binary file, but it is also desired to disassemble
8677            all ARM instructions then use "-marm".  This will select the
8678            "unknown" arm architecture which is compatible with any ARM
8679            instruction.  */
8680           info->mach = bfd_mach_arm_unknown;
8681
8682       /* Compute the architecture bitmask from the machine number.
8683          Note: This assumes that the machine number will not change
8684          during disassembly....  */
8685       select_arm_features (info->mach, & private.features);
8686
8687       private.last_mapping_sym = -1;
8688       private.last_mapping_addr = 0;
8689       private.last_stop_offset = 0;
8690
8691       info->private_data = & private;
8692     }
8693
8694   private_data = info->private_data;
8695
8696   /* Decide if our code is going to be little-endian, despite what the
8697      function argument might say.  */
8698   little_code = ((info->endian_code == BFD_ENDIAN_LITTLE) || little);
8699
8700   /* For ELF, consult the symbol table to determine what kind of code
8701      or data we have.  */
8702   if (info->symtab_size != 0
8703       && bfd_asymbol_flavour (*info->symtab) == bfd_target_elf_flavour)
8704     {
8705       bfd_vma addr;
8706       int n;
8707       int last_sym = -1;
8708       enum map_type type = MAP_ARM;
8709
8710       found = mapping_symbol_for_insn (pc, info, &type);
8711       last_sym = private_data->last_mapping_sym;
8712
8713       is_thumb = (private_data->last_type == MAP_THUMB);
8714       is_data = (private_data->last_type == MAP_DATA);
8715
8716       /* Look a little bit ahead to see if we should print out
8717          two or four bytes of data.  If there's a symbol,
8718          mapping or otherwise, after two bytes then don't
8719          print more.  */
8720       if (is_data)
8721         {
8722           size = 4 - (pc & 3);
8723           for (n = last_sym + 1; n < info->symtab_size; n++)
8724             {
8725               addr = bfd_asymbol_value (info->symtab[n]);
8726               if (addr > pc
8727                   && (info->section == NULL
8728                       || info->section == info->symtab[n]->section))
8729                 {
8730                   if (addr - pc < size)
8731                     size = addr - pc;
8732                   break;
8733                 }
8734             }
8735           /* If the next symbol is after three bytes, we need to
8736              print only part of the data, so that we can use either
8737              .byte or .short.  */
8738           if (size == 3)
8739             size = (pc & 1) ? 1 : 2;
8740         }
8741     }
8742
8743   if (info->symbols != NULL)
8744     {
8745       if (bfd_asymbol_flavour (*info->symbols) == bfd_target_coff_flavour)
8746         {
8747           coff_symbol_type * cs;
8748
8749           cs = coffsymbol (*info->symbols);
8750           is_thumb = (   cs->native->u.syment.n_sclass == C_THUMBEXT
8751                       || cs->native->u.syment.n_sclass == C_THUMBSTAT
8752                       || cs->native->u.syment.n_sclass == C_THUMBLABEL
8753                       || cs->native->u.syment.n_sclass == C_THUMBEXTFUNC
8754                       || cs->native->u.syment.n_sclass == C_THUMBSTATFUNC);
8755         }
8756       else if (bfd_asymbol_flavour (*info->symbols) == bfd_target_elf_flavour
8757                && !found)
8758         {
8759           /* If no mapping symbol has been found then fall back to the type
8760              of the function symbol.  */
8761           elf_symbol_type *  es;
8762           unsigned int       type;
8763
8764           es = *(elf_symbol_type **)(info->symbols);
8765           type = ELF_ST_TYPE (es->internal_elf_sym.st_info);
8766
8767           is_thumb =
8768             ((ARM_GET_SYM_BRANCH_TYPE (es->internal_elf_sym.st_target_internal)
8769               == ST_BRANCH_TO_THUMB) || type == STT_ARM_16BIT);
8770         }
8771       else if (bfd_asymbol_flavour (*info->symbols)
8772                == bfd_target_mach_o_flavour)
8773         {
8774           bfd_mach_o_asymbol *asym = (bfd_mach_o_asymbol *)*info->symbols;
8775
8776           is_thumb = (asym->n_desc & BFD_MACH_O_N_ARM_THUMB_DEF);
8777         }
8778     }
8779
8780   if (force_thumb)
8781     is_thumb = TRUE;
8782
8783   if (is_data)
8784     info->display_endian = little ? BFD_ENDIAN_LITTLE : BFD_ENDIAN_BIG;
8785   else
8786     info->display_endian = little_code ? BFD_ENDIAN_LITTLE : BFD_ENDIAN_BIG;
8787
8788   info->bytes_per_line = 4;
8789
8790   /* PR 10263: Disassemble data if requested to do so by the user.  */
8791   if (is_data && ((info->flags & DISASSEMBLE_DATA) == 0))
8792     {
8793       int i;
8794
8795       /* Size was already set above.  */
8796       info->bytes_per_chunk = size;
8797       printer = print_insn_data;
8798
8799       status = info->read_memory_func (pc, (bfd_byte *) b, size, info);
8800       given = 0;
8801       if (little)
8802         for (i = size - 1; i >= 0; i--)
8803           given = b[i] | (given << 8);
8804       else
8805         for (i = 0; i < (int) size; i++)
8806           given = b[i] | (given << 8);
8807     }
8808   else if (!is_thumb)
8809     {
8810       /* In ARM mode endianness is a straightforward issue: the instruction
8811          is four bytes long and is either ordered 0123 or 3210.  */
8812       printer = print_insn_arm;
8813       info->bytes_per_chunk = 4;
8814       size = 4;
8815
8816       status = info->read_memory_func (pc, (bfd_byte *) b, 4, info);
8817       if (little_code)
8818         given = (b[0]) | (b[1] << 8) | (b[2] << 16) | (b[3] << 24);
8819       else
8820         given = (b[3]) | (b[2] << 8) | (b[1] << 16) | (b[0] << 24);
8821     }
8822   else
8823     {
8824       /* In Thumb mode we have the additional wrinkle of two
8825          instruction lengths.  Fortunately, the bits that determine
8826          the length of the current instruction are always to be found
8827          in the first two bytes.  */
8828       printer = print_insn_thumb16;
8829       info->bytes_per_chunk = 2;
8830       size = 2;
8831
8832       status = info->read_memory_func (pc, (bfd_byte *) b, 2, info);
8833       if (little_code)
8834         given = (b[0]) | (b[1] << 8);
8835       else
8836         given = (b[1]) | (b[0] << 8);
8837
8838       if (!status)
8839         {
8840           /* These bit patterns signal a four-byte Thumb
8841              instruction.  */
8842           if ((given & 0xF800) == 0xF800
8843               || (given & 0xF800) == 0xF000
8844               || (given & 0xF800) == 0xE800)
8845             {
8846               status = info->read_memory_func (pc + 2, (bfd_byte *) b, 2, info);
8847               if (little_code)
8848                 given = (b[0]) | (b[1] << 8) | (given << 16);
8849               else
8850                 given = (b[1]) | (b[0] << 8) | (given << 16);
8851
8852               printer = print_insn_thumb32;
8853               size = 4;
8854             }
8855         }
8856
8857       if (ifthen_address != pc)
8858         find_ifthen_state (pc, info, little_code);
8859
8860       if (ifthen_state)
8861         {
8862           if ((ifthen_state & 0xf) == 0x8)
8863             ifthen_next_state = 0;
8864           else
8865             ifthen_next_state = (ifthen_state & 0xe0)
8866                                 | ((ifthen_state & 0xf) << 1);
8867         }
8868     }
8869
8870   if (status)
8871     {
8872       info->memory_error_func (status, pc, info);
8873       return -1;
8874     }
8875   if (info->flags & INSN_HAS_RELOC)
8876     /* If the instruction has a reloc associated with it, then
8877        the offset field in the instruction will actually be the
8878        addend for the reloc.  (We are using REL type relocs).
8879        In such cases, we can ignore the pc when computing
8880        addresses, since the addend is not currently pc-relative.  */
8881     pc = 0;
8882
8883   printer (pc, info, given);
8884
8885   if (is_thumb)
8886     {
8887       ifthen_state = ifthen_next_state;
8888       ifthen_address += size;
8889     }
8890   return size;
8891 }
8892
8893 int
8894 print_insn_big_arm (bfd_vma pc, struct disassemble_info *info)
8895 {
8896   /* Detect BE8-ness and record it in the disassembler info.  */
8897   if (info->flavour == bfd_target_elf_flavour
8898       && info->section != NULL
8899       && (elf_elfheader (info->section->owner)->e_flags & EF_ARM_BE8))
8900     info->endian_code = BFD_ENDIAN_LITTLE;
8901
8902   return print_insn (pc, info, FALSE);
8903 }
8904
8905 int
8906 print_insn_little_arm (bfd_vma pc, struct disassemble_info *info)
8907 {
8908   return print_insn (pc, info, TRUE);
8909 }
8910
8911 const disasm_options_and_args_t *
8912 disassembler_options_arm (void)
8913 {
8914   static disasm_options_and_args_t *opts_and_args;
8915
8916   if (opts_and_args == NULL)
8917     {
8918       disasm_options_t *opts;
8919       unsigned int i;
8920
8921       opts_and_args = XNEW (disasm_options_and_args_t);
8922       opts_and_args->args = NULL;
8923
8924       opts = &opts_and_args->options;
8925       opts->name = XNEWVEC (const char *, NUM_ARM_OPTIONS + 1);
8926       opts->description = XNEWVEC (const char *, NUM_ARM_OPTIONS + 1);
8927       opts->arg = NULL;
8928       for (i = 0; i < NUM_ARM_OPTIONS; i++)
8929         {
8930           opts->name[i] = regnames[i].name;
8931           if (regnames[i].description != NULL)
8932             opts->description[i] = _(regnames[i].description);
8933           else
8934             opts->description[i] = NULL;
8935         }
8936       /* The array we return must be NULL terminated.  */
8937       opts->name[i] = NULL;
8938       opts->description[i] = NULL;
8939     }
8940
8941   return opts_and_args;
8942 }
8943
8944 void
8945 print_arm_disassembler_options (FILE *stream)
8946 {
8947   unsigned int i, max_len = 0;
8948   fprintf (stream, _("\n\
8949 The following ARM specific disassembler options are supported for use with\n\
8950 the -M switch:\n"));
8951
8952   for (i = 0; i < NUM_ARM_OPTIONS; i++)
8953     {
8954       unsigned int len = strlen (regnames[i].name);
8955       if (max_len < len)
8956         max_len = len;
8957     }
8958
8959   for (i = 0, max_len++; i < NUM_ARM_OPTIONS; i++)
8960     fprintf (stream, "  %s%*c %s\n",
8961              regnames[i].name,
8962              (int)(max_len - strlen (regnames[i].name)), ' ',
8963              _(regnames[i].description));
8964 }