1 /* This file is automatically generated by aarch64-gen. Do not edit! */
2 /* Copyright (C) 2012-2018 Free Software Foundation, Inc.
3 Contributed by ARM Ltd.
5 This file is part of the GNU opcodes library.
7 This library is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 3, or (at your option)
12 It is distributed in the hope that it will be useful, but WITHOUT
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
14 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
15 License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program; see the file COPYING3. If not,
19 see <http://www.gnu.org/licenses/>. */
22 #include "aarch64-asm.h"
25 const aarch64_opcode *
26 aarch64_find_real_opcode (const aarch64_opcode *opcode)
28 /* Use the index as the key to locate the real opcode. */
29 int key = opcode - aarch64_opcode_table;
35 value = 2; /* --> sbc. */
39 value = 4; /* --> sbcs. */
43 value = 7; /* --> adds. */
47 value = 10; /* --> subs. */
51 value = 12; /* --> add. */
55 value = 14; /* --> adds. */
59 value = 17; /* --> subs. */
63 value = 22; /* --> adds. */
67 value = 24; /* --> sub. */
72 value = 26; /* --> subs. */
76 value = 152; /* --> umov. */
80 value = 154; /* --> ins. */
84 value = 156; /* --> ins. */
88 value = 242; /* --> not. */
92 value = 317; /* --> orr. */
96 value = 388; /* --> sshll. */
99 case 390: /* sshll2 */
100 value = 390; /* --> sshll2. */
103 case 412: /* ushll */
104 value = 412; /* --> ushll. */
106 case 415: /* uxtl2 */
107 case 414: /* ushll2 */
108 value = 414; /* --> ushll2. */
112 value = 535; /* --> dup. */
119 case 619: /* sbfiz */
121 value = 618; /* --> sbfm. */
124 case 628: /* bfxil */
127 value = 625; /* --> bfm. */
134 case 630: /* ubfiz */
136 value = 629; /* --> ubfm. */
140 case 663: /* csinc */
141 value = 663; /* --> csinc. */
143 case 668: /* csetm */
145 case 666: /* csinv */
146 value = 666; /* --> csinv. */
149 case 669: /* csneg */
150 value = 669; /* --> csneg. */
153 case 689: /* rev64 */
154 value = 688; /* --> rev. */
158 value = 713; /* --> lslv. */
162 value = 715; /* --> lsrv. */
166 value = 717; /* --> asrv. */
170 value = 719; /* --> rorv. */
173 case 722: /* subps */
174 value = 722; /* --> subps. */
178 value = 735; /* --> madd. */
182 value = 737; /* --> msub. */
184 case 740: /* smull */
185 case 739: /* smaddl */
186 value = 739; /* --> smaddl. */
188 case 742: /* smnegl */
189 case 741: /* smsubl */
190 value = 741; /* --> smsubl. */
192 case 745: /* umull */
193 case 744: /* umaddl */
194 value = 744; /* --> umaddl. */
196 case 747: /* umnegl */
197 case 746: /* umsubl */
198 value = 746; /* --> umsubl. */
202 value = 757; /* --> extr. */
206 value = 987; /* --> and. */
210 value = 989; /* --> orr. */
214 value = 992; /* --> ands. */
219 value = 996; /* --> orr. */
223 value = 999; /* --> orn. */
226 case 1003: /* ands */
227 value = 1003; /* --> ands. */
229 case 1130: /* staddb */
230 case 1034: /* ldaddb */
231 value = 1034; /* --> ldaddb. */
233 case 1131: /* staddh */
234 case 1035: /* ldaddh */
235 value = 1035; /* --> ldaddh. */
237 case 1132: /* stadd */
238 case 1036: /* ldadd */
239 value = 1036; /* --> ldadd. */
241 case 1133: /* staddlb */
242 case 1038: /* ldaddlb */
243 value = 1038; /* --> ldaddlb. */
245 case 1134: /* staddlh */
246 case 1041: /* ldaddlh */
247 value = 1041; /* --> ldaddlh. */
249 case 1135: /* staddl */
250 case 1044: /* ldaddl */
251 value = 1044; /* --> ldaddl. */
253 case 1136: /* stclrb */
254 case 1046: /* ldclrb */
255 value = 1046; /* --> ldclrb. */
257 case 1137: /* stclrh */
258 case 1047: /* ldclrh */
259 value = 1047; /* --> ldclrh. */
261 case 1138: /* stclr */
262 case 1048: /* ldclr */
263 value = 1048; /* --> ldclr. */
265 case 1139: /* stclrlb */
266 case 1050: /* ldclrlb */
267 value = 1050; /* --> ldclrlb. */
269 case 1140: /* stclrlh */
270 case 1053: /* ldclrlh */
271 value = 1053; /* --> ldclrlh. */
273 case 1141: /* stclrl */
274 case 1056: /* ldclrl */
275 value = 1056; /* --> ldclrl. */
277 case 1142: /* steorb */
278 case 1058: /* ldeorb */
279 value = 1058; /* --> ldeorb. */
281 case 1143: /* steorh */
282 case 1059: /* ldeorh */
283 value = 1059; /* --> ldeorh. */
285 case 1144: /* steor */
286 case 1060: /* ldeor */
287 value = 1060; /* --> ldeor. */
289 case 1145: /* steorlb */
290 case 1062: /* ldeorlb */
291 value = 1062; /* --> ldeorlb. */
293 case 1146: /* steorlh */
294 case 1065: /* ldeorlh */
295 value = 1065; /* --> ldeorlh. */
297 case 1147: /* steorl */
298 case 1068: /* ldeorl */
299 value = 1068; /* --> ldeorl. */
301 case 1148: /* stsetb */
302 case 1070: /* ldsetb */
303 value = 1070; /* --> ldsetb. */
305 case 1149: /* stseth */
306 case 1071: /* ldseth */
307 value = 1071; /* --> ldseth. */
309 case 1150: /* stset */
310 case 1072: /* ldset */
311 value = 1072; /* --> ldset. */
313 case 1151: /* stsetlb */
314 case 1074: /* ldsetlb */
315 value = 1074; /* --> ldsetlb. */
317 case 1152: /* stsetlh */
318 case 1077: /* ldsetlh */
319 value = 1077; /* --> ldsetlh. */
321 case 1153: /* stsetl */
322 case 1080: /* ldsetl */
323 value = 1080; /* --> ldsetl. */
325 case 1154: /* stsmaxb */
326 case 1082: /* ldsmaxb */
327 value = 1082; /* --> ldsmaxb. */
329 case 1155: /* stsmaxh */
330 case 1083: /* ldsmaxh */
331 value = 1083; /* --> ldsmaxh. */
333 case 1156: /* stsmax */
334 case 1084: /* ldsmax */
335 value = 1084; /* --> ldsmax. */
337 case 1157: /* stsmaxlb */
338 case 1086: /* ldsmaxlb */
339 value = 1086; /* --> ldsmaxlb. */
341 case 1158: /* stsmaxlh */
342 case 1089: /* ldsmaxlh */
343 value = 1089; /* --> ldsmaxlh. */
345 case 1159: /* stsmaxl */
346 case 1092: /* ldsmaxl */
347 value = 1092; /* --> ldsmaxl. */
349 case 1160: /* stsminb */
350 case 1094: /* ldsminb */
351 value = 1094; /* --> ldsminb. */
353 case 1161: /* stsminh */
354 case 1095: /* ldsminh */
355 value = 1095; /* --> ldsminh. */
357 case 1162: /* stsmin */
358 case 1096: /* ldsmin */
359 value = 1096; /* --> ldsmin. */
361 case 1163: /* stsminlb */
362 case 1098: /* ldsminlb */
363 value = 1098; /* --> ldsminlb. */
365 case 1164: /* stsminlh */
366 case 1101: /* ldsminlh */
367 value = 1101; /* --> ldsminlh. */
369 case 1165: /* stsminl */
370 case 1104: /* ldsminl */
371 value = 1104; /* --> ldsminl. */
373 case 1166: /* stumaxb */
374 case 1106: /* ldumaxb */
375 value = 1106; /* --> ldumaxb. */
377 case 1167: /* stumaxh */
378 case 1107: /* ldumaxh */
379 value = 1107; /* --> ldumaxh. */
381 case 1168: /* stumax */
382 case 1108: /* ldumax */
383 value = 1108; /* --> ldumax. */
385 case 1169: /* stumaxlb */
386 case 1110: /* ldumaxlb */
387 value = 1110; /* --> ldumaxlb. */
389 case 1170: /* stumaxlh */
390 case 1113: /* ldumaxlh */
391 value = 1113; /* --> ldumaxlh. */
393 case 1171: /* stumaxl */
394 case 1116: /* ldumaxl */
395 value = 1116; /* --> ldumaxl. */
397 case 1172: /* stuminb */
398 case 1118: /* lduminb */
399 value = 1118; /* --> lduminb. */
401 case 1173: /* stuminh */
402 case 1119: /* lduminh */
403 value = 1119; /* --> lduminh. */
405 case 1174: /* stumin */
406 case 1120: /* ldumin */
407 value = 1120; /* --> ldumin. */
409 case 1175: /* stuminlb */
410 case 1122: /* lduminlb */
411 value = 1122; /* --> lduminlb. */
413 case 1176: /* stuminlh */
414 case 1125: /* lduminlh */
415 value = 1125; /* --> lduminlh. */
417 case 1177: /* stuminl */
418 case 1128: /* lduminl */
419 value = 1128; /* --> lduminl. */
422 case 1178: /* movn */
423 value = 1178; /* --> movn. */
426 case 1180: /* movz */
427 value = 1180; /* --> movz. */
429 case 1227: /* autibsp */
430 case 1226: /* autibz */
431 case 1225: /* autiasp */
432 case 1224: /* autiaz */
433 case 1223: /* pacibsp */
434 case 1222: /* pacibz */
435 case 1221: /* paciasp */
436 case 1220: /* paciaz */
439 case 1199: /* autib1716 */
440 case 1198: /* autia1716 */
441 case 1197: /* pacib1716 */
442 case 1196: /* pacia1716 */
443 case 1195: /* xpaclri */
444 case 1194: /* sevl */
448 case 1190: /* yield */
450 case 1188: /* csdb */
452 case 1186: /* hint */
453 value = 1186; /* --> hint. */
455 case 1205: /* pssbb */
456 case 1204: /* ssbb */
458 value = 1203; /* --> dsb. */
463 case 1213: /* tlbi */
468 value = 1209; /* --> sys. */
472 value = 1275; /* --> and. */
476 value = 1277; /* --> and. */
478 case 1262: /* movs */
479 case 1278: /* ands */
480 value = 1278; /* --> ands. */
482 case 2026: /* cmple */
483 case 1313: /* cmpge */
484 value = 1313; /* --> cmpge. */
486 case 2029: /* cmplt */
487 case 1316: /* cmpgt */
488 value = 1316; /* --> cmpgt. */
490 case 2027: /* cmplo */
491 case 1318: /* cmphi */
492 value = 1318; /* --> cmphi. */
494 case 2028: /* cmpls */
495 case 1321: /* cmphs */
496 value = 1321; /* --> cmphs. */
500 value = 1343; /* --> cpy. */
504 value = 1344; /* --> cpy. */
506 case 2036: /* fmov */
509 value = 1345; /* --> cpy. */
513 value = 1357; /* --> dup. */
518 value = 1358; /* --> dup. */
520 case 2035: /* fmov */
523 value = 1359; /* --> dup. */
526 case 1360: /* dupm */
527 value = 1360; /* --> dupm. */
531 value = 1362; /* --> eor. */
535 value = 1364; /* --> eor. */
537 case 1264: /* nots */
538 case 1365: /* eors */
539 value = 1365; /* --> eors. */
541 case 2031: /* facle */
542 case 1370: /* facge */
543 value = 1370; /* --> facge. */
545 case 2032: /* faclt */
546 case 1371: /* facgt */
547 value = 1371; /* --> facgt. */
549 case 2033: /* fcmle */
550 case 1384: /* fcmge */
551 value = 1384; /* --> fcmge. */
553 case 2034: /* fcmlt */
554 case 1386: /* fcmgt */
555 value = 1386; /* --> fcmgt. */
557 case 1247: /* fmov */
558 case 1392: /* fcpy */
559 value = 1392; /* --> fcpy. */
561 case 1246: /* fmov */
562 case 1415: /* fdup */
563 value = 1415; /* --> fdup. */
567 value = 1746; /* --> orr. */
571 value = 1747; /* --> orr. */
575 value = 1749; /* --> orr. */
577 case 1261: /* movs */
578 case 1750: /* orrs */
579 value = 1750; /* --> orrs. */
583 value = 1812; /* --> sel. */
587 value = 1813; /* --> sel. */
589 default: return NULL;
592 return aarch64_opcode_table + value;
596 aarch64_insert_operand (const aarch64_operand *self,
597 const aarch64_opnd_info *info,
598 aarch64_insn *code, const aarch64_inst *inst,
599 aarch64_operand_error *errors)
601 /* Use the index as the key. */
602 int key = self - aarch64_operands;
651 return aarch64_ins_regno (self, info, code, inst, errors);
653 return aarch64_ins_reg_extended (self, info, code, inst, errors);
655 return aarch64_ins_reg_shifted (self, info, code, inst, errors);
657 return aarch64_ins_ft (self, info, code, inst, errors);
663 return aarch64_ins_reglane (self, info, code, inst, errors);
665 return aarch64_ins_reglist (self, info, code, inst, errors);
667 return aarch64_ins_ldst_reglist (self, info, code, inst, errors);
669 return aarch64_ins_ldst_reglist_r (self, info, code, inst, errors);
671 return aarch64_ins_ldst_elemlist (self, info, code, inst, errors);
706 return aarch64_ins_imm (self, info, code, inst, errors);
709 return aarch64_ins_advsimd_imm_shift (self, info, code, inst, errors);
713 return aarch64_ins_advsimd_imm_modified (self, info, code, inst, errors);
716 return aarch64_ins_fpimm (self, info, code, inst, errors);
719 return aarch64_ins_limm (self, info, code, inst, errors);
721 return aarch64_ins_aimm (self, info, code, inst, errors);
723 return aarch64_ins_imm_half (self, info, code, inst, errors);
725 return aarch64_ins_fbits (self, info, code, inst, errors);
729 return aarch64_ins_imm_rotate2 (self, info, code, inst, errors);
732 return aarch64_ins_imm_rotate1 (self, info, code, inst, errors);
735 return aarch64_ins_cond (self, info, code, inst, errors);
738 return aarch64_ins_addr_simple (self, info, code, inst, errors);
740 return aarch64_ins_addr_regoff (self, info, code, inst, errors);
746 return aarch64_ins_addr_simm (self, info, code, inst, errors);
748 return aarch64_ins_addr_simm10 (self, info, code, inst, errors);
750 return aarch64_ins_addr_uimm12 (self, info, code, inst, errors);
752 return aarch64_ins_addr_offset (self, info, code, inst, errors);
754 return aarch64_ins_simd_addr_post (self, info, code, inst, errors);
756 return aarch64_ins_sysreg (self, info, code, inst, errors);
758 return aarch64_ins_pstatefield (self, info, code, inst, errors);
764 return aarch64_ins_sysins_op (self, info, code, inst, errors);
767 return aarch64_ins_barrier (self, info, code, inst, errors);
769 return aarch64_ins_prfop (self, info, code, inst, errors);
772 return aarch64_ins_hint (self, info, code, inst, errors);
774 return aarch64_ins_sve_addr_ri_s4 (self, info, code, inst, errors);
779 return aarch64_ins_sve_addr_ri_s4xvl (self, info, code, inst, errors);
781 return aarch64_ins_sve_addr_ri_s6xvl (self, info, code, inst, errors);
783 return aarch64_ins_sve_addr_ri_s9xvl (self, info, code, inst, errors);
788 return aarch64_ins_sve_addr_ri_u6 (self, info, code, inst, errors);
802 return aarch64_ins_sve_addr_rr_lsl (self, info, code, inst, errors);
811 return aarch64_ins_sve_addr_rz_xtw (self, info, code, inst, errors);
816 return aarch64_ins_sve_addr_zi_u5 (self, info, code, inst, errors);
818 return aarch64_ins_sve_addr_zz_lsl (self, info, code, inst, errors);
820 return aarch64_ins_sve_addr_zz_sxtw (self, info, code, inst, errors);
822 return aarch64_ins_sve_addr_zz_uxtw (self, info, code, inst, errors);
824 return aarch64_ins_sve_aimm (self, info, code, inst, errors);
826 return aarch64_ins_sve_asimm (self, info, code, inst, errors);
828 return aarch64_ins_sve_float_half_one (self, info, code, inst, errors);
830 return aarch64_ins_sve_float_half_two (self, info, code, inst, errors);
832 return aarch64_ins_sve_float_zero_one (self, info, code, inst, errors);
834 return aarch64_ins_inv_limm (self, info, code, inst, errors);
836 return aarch64_ins_sve_limm_mov (self, info, code, inst, errors);
838 return aarch64_ins_sve_scale (self, info, code, inst, errors);
841 return aarch64_ins_sve_shlimm (self, info, code, inst, errors);
844 return aarch64_ins_sve_shrimm (self, info, code, inst, errors);
848 return aarch64_ins_sve_quad_index (self, info, code, inst, errors);
850 return aarch64_ins_sve_index (self, info, code, inst, errors);
853 return aarch64_ins_sve_reglist (self, info, code, inst, errors);
854 default: assert (0); abort ();