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. */
174 value = 732; /* --> madd. */
178 value = 734; /* --> msub. */
180 case 737: /* smull */
181 case 736: /* smaddl */
182 value = 736; /* --> smaddl. */
184 case 739: /* smnegl */
185 case 738: /* smsubl */
186 value = 738; /* --> smsubl. */
188 case 742: /* umull */
189 case 741: /* umaddl */
190 value = 741; /* --> umaddl. */
192 case 744: /* umnegl */
193 case 743: /* umsubl */
194 value = 743; /* --> umsubl. */
198 value = 754; /* --> extr. */
202 value = 973; /* --> and. */
206 value = 975; /* --> orr. */
210 value = 978; /* --> ands. */
215 value = 982; /* --> orr. */
219 value = 985; /* --> orn. */
223 value = 989; /* --> ands. */
225 case 1116: /* staddb */
226 case 1020: /* ldaddb */
227 value = 1020; /* --> ldaddb. */
229 case 1117: /* staddh */
230 case 1021: /* ldaddh */
231 value = 1021; /* --> ldaddh. */
233 case 1118: /* stadd */
234 case 1022: /* ldadd */
235 value = 1022; /* --> ldadd. */
237 case 1119: /* staddlb */
238 case 1024: /* ldaddlb */
239 value = 1024; /* --> ldaddlb. */
241 case 1120: /* staddlh */
242 case 1027: /* ldaddlh */
243 value = 1027; /* --> ldaddlh. */
245 case 1121: /* staddl */
246 case 1030: /* ldaddl */
247 value = 1030; /* --> ldaddl. */
249 case 1122: /* stclrb */
250 case 1032: /* ldclrb */
251 value = 1032; /* --> ldclrb. */
253 case 1123: /* stclrh */
254 case 1033: /* ldclrh */
255 value = 1033; /* --> ldclrh. */
257 case 1124: /* stclr */
258 case 1034: /* ldclr */
259 value = 1034; /* --> ldclr. */
261 case 1125: /* stclrlb */
262 case 1036: /* ldclrlb */
263 value = 1036; /* --> ldclrlb. */
265 case 1126: /* stclrlh */
266 case 1039: /* ldclrlh */
267 value = 1039; /* --> ldclrlh. */
269 case 1127: /* stclrl */
270 case 1042: /* ldclrl */
271 value = 1042; /* --> ldclrl. */
273 case 1128: /* steorb */
274 case 1044: /* ldeorb */
275 value = 1044; /* --> ldeorb. */
277 case 1129: /* steorh */
278 case 1045: /* ldeorh */
279 value = 1045; /* --> ldeorh. */
281 case 1130: /* steor */
282 case 1046: /* ldeor */
283 value = 1046; /* --> ldeor. */
285 case 1131: /* steorlb */
286 case 1048: /* ldeorlb */
287 value = 1048; /* --> ldeorlb. */
289 case 1132: /* steorlh */
290 case 1051: /* ldeorlh */
291 value = 1051; /* --> ldeorlh. */
293 case 1133: /* steorl */
294 case 1054: /* ldeorl */
295 value = 1054; /* --> ldeorl. */
297 case 1134: /* stsetb */
298 case 1056: /* ldsetb */
299 value = 1056; /* --> ldsetb. */
301 case 1135: /* stseth */
302 case 1057: /* ldseth */
303 value = 1057; /* --> ldseth. */
305 case 1136: /* stset */
306 case 1058: /* ldset */
307 value = 1058; /* --> ldset. */
309 case 1137: /* stsetlb */
310 case 1060: /* ldsetlb */
311 value = 1060; /* --> ldsetlb. */
313 case 1138: /* stsetlh */
314 case 1063: /* ldsetlh */
315 value = 1063; /* --> ldsetlh. */
317 case 1139: /* stsetl */
318 case 1066: /* ldsetl */
319 value = 1066; /* --> ldsetl. */
321 case 1140: /* stsmaxb */
322 case 1068: /* ldsmaxb */
323 value = 1068; /* --> ldsmaxb. */
325 case 1141: /* stsmaxh */
326 case 1069: /* ldsmaxh */
327 value = 1069; /* --> ldsmaxh. */
329 case 1142: /* stsmax */
330 case 1070: /* ldsmax */
331 value = 1070; /* --> ldsmax. */
333 case 1143: /* stsmaxlb */
334 case 1072: /* ldsmaxlb */
335 value = 1072; /* --> ldsmaxlb. */
337 case 1144: /* stsmaxlh */
338 case 1075: /* ldsmaxlh */
339 value = 1075; /* --> ldsmaxlh. */
341 case 1145: /* stsmaxl */
342 case 1078: /* ldsmaxl */
343 value = 1078; /* --> ldsmaxl. */
345 case 1146: /* stsminb */
346 case 1080: /* ldsminb */
347 value = 1080; /* --> ldsminb. */
349 case 1147: /* stsminh */
350 case 1081: /* ldsminh */
351 value = 1081; /* --> ldsminh. */
353 case 1148: /* stsmin */
354 case 1082: /* ldsmin */
355 value = 1082; /* --> ldsmin. */
357 case 1149: /* stsminlb */
358 case 1084: /* ldsminlb */
359 value = 1084; /* --> ldsminlb. */
361 case 1150: /* stsminlh */
362 case 1087: /* ldsminlh */
363 value = 1087; /* --> ldsminlh. */
365 case 1151: /* stsminl */
366 case 1090: /* ldsminl */
367 value = 1090; /* --> ldsminl. */
369 case 1152: /* stumaxb */
370 case 1092: /* ldumaxb */
371 value = 1092; /* --> ldumaxb. */
373 case 1153: /* stumaxh */
374 case 1093: /* ldumaxh */
375 value = 1093; /* --> ldumaxh. */
377 case 1154: /* stumax */
378 case 1094: /* ldumax */
379 value = 1094; /* --> ldumax. */
381 case 1155: /* stumaxlb */
382 case 1096: /* ldumaxlb */
383 value = 1096; /* --> ldumaxlb. */
385 case 1156: /* stumaxlh */
386 case 1099: /* ldumaxlh */
387 value = 1099; /* --> ldumaxlh. */
389 case 1157: /* stumaxl */
390 case 1102: /* ldumaxl */
391 value = 1102; /* --> ldumaxl. */
393 case 1158: /* stuminb */
394 case 1104: /* lduminb */
395 value = 1104; /* --> lduminb. */
397 case 1159: /* stuminh */
398 case 1105: /* lduminh */
399 value = 1105; /* --> lduminh. */
401 case 1160: /* stumin */
402 case 1106: /* ldumin */
403 value = 1106; /* --> ldumin. */
405 case 1161: /* stuminlb */
406 case 1108: /* lduminlb */
407 value = 1108; /* --> lduminlb. */
409 case 1162: /* stuminlh */
410 case 1111: /* lduminlh */
411 value = 1111; /* --> lduminlh. */
413 case 1163: /* stuminl */
414 case 1114: /* lduminl */
415 value = 1114; /* --> lduminl. */
418 case 1164: /* movn */
419 value = 1164; /* --> movn. */
422 case 1166: /* movz */
423 value = 1166; /* --> movz. */
425 case 1213: /* autibsp */
426 case 1212: /* autibz */
427 case 1211: /* autiasp */
428 case 1210: /* autiaz */
429 case 1209: /* pacibsp */
430 case 1208: /* pacibz */
431 case 1207: /* paciasp */
432 case 1206: /* paciaz */
435 case 1185: /* autib1716 */
436 case 1184: /* autia1716 */
437 case 1183: /* pacib1716 */
438 case 1182: /* pacia1716 */
439 case 1181: /* xpaclri */
440 case 1180: /* sevl */
444 case 1176: /* yield */
446 case 1174: /* csdb */
448 case 1172: /* hint */
449 value = 1172; /* --> hint. */
451 case 1191: /* pssbb */
452 case 1190: /* ssbb */
454 value = 1189; /* --> dsb. */
459 case 1199: /* tlbi */
464 value = 1195; /* --> sys. */
468 value = 1261; /* --> and. */
472 value = 1263; /* --> and. */
474 case 1248: /* movs */
475 case 1264: /* ands */
476 value = 1264; /* --> ands. */
478 case 2012: /* cmple */
479 case 1299: /* cmpge */
480 value = 1299; /* --> cmpge. */
482 case 2015: /* cmplt */
483 case 1302: /* cmpgt */
484 value = 1302; /* --> cmpgt. */
486 case 2013: /* cmplo */
487 case 1304: /* cmphi */
488 value = 1304; /* --> cmphi. */
490 case 2014: /* cmpls */
491 case 1307: /* cmphs */
492 value = 1307; /* --> cmphs. */
496 value = 1329; /* --> cpy. */
500 value = 1330; /* --> cpy. */
502 case 2022: /* fmov */
505 value = 1331; /* --> cpy. */
509 value = 1343; /* --> dup. */
514 value = 1344; /* --> dup. */
516 case 2021: /* fmov */
519 value = 1345; /* --> dup. */
522 case 1346: /* dupm */
523 value = 1346; /* --> dupm. */
527 value = 1348; /* --> eor. */
531 value = 1350; /* --> eor. */
533 case 1250: /* nots */
534 case 1351: /* eors */
535 value = 1351; /* --> eors. */
537 case 2017: /* facle */
538 case 1356: /* facge */
539 value = 1356; /* --> facge. */
541 case 2018: /* faclt */
542 case 1357: /* facgt */
543 value = 1357; /* --> facgt. */
545 case 2019: /* fcmle */
546 case 1370: /* fcmge */
547 value = 1370; /* --> fcmge. */
549 case 2020: /* fcmlt */
550 case 1372: /* fcmgt */
551 value = 1372; /* --> fcmgt. */
553 case 1233: /* fmov */
554 case 1378: /* fcpy */
555 value = 1378; /* --> fcpy. */
557 case 1232: /* fmov */
558 case 1401: /* fdup */
559 value = 1401; /* --> fdup. */
563 value = 1732; /* --> orr. */
567 value = 1733; /* --> orr. */
571 value = 1735; /* --> orr. */
573 case 1247: /* movs */
574 case 1736: /* orrs */
575 value = 1736; /* --> orrs. */
579 value = 1798; /* --> sel. */
583 value = 1799; /* --> sel. */
585 default: return NULL;
588 return aarch64_opcode_table + value;
592 aarch64_insert_operand (const aarch64_operand *self,
593 const aarch64_opnd_info *info,
594 aarch64_insn *code, const aarch64_inst *inst,
595 aarch64_operand_error *errors)
597 /* Use the index as the key. */
598 int key = self - aarch64_operands;
647 return aarch64_ins_regno (self, info, code, inst, errors);
649 return aarch64_ins_reg_extended (self, info, code, inst, errors);
651 return aarch64_ins_reg_shifted (self, info, code, inst, errors);
653 return aarch64_ins_ft (self, info, code, inst, errors);
659 return aarch64_ins_reglane (self, info, code, inst, errors);
661 return aarch64_ins_reglist (self, info, code, inst, errors);
663 return aarch64_ins_ldst_reglist (self, info, code, inst, errors);
665 return aarch64_ins_ldst_reglist_r (self, info, code, inst, errors);
667 return aarch64_ins_ldst_elemlist (self, info, code, inst, errors);
702 return aarch64_ins_imm (self, info, code, inst, errors);
705 return aarch64_ins_advsimd_imm_shift (self, info, code, inst, errors);
709 return aarch64_ins_advsimd_imm_modified (self, info, code, inst, errors);
712 return aarch64_ins_fpimm (self, info, code, inst, errors);
715 return aarch64_ins_limm (self, info, code, inst, errors);
717 return aarch64_ins_aimm (self, info, code, inst, errors);
719 return aarch64_ins_imm_half (self, info, code, inst, errors);
721 return aarch64_ins_fbits (self, info, code, inst, errors);
725 return aarch64_ins_imm_rotate2 (self, info, code, inst, errors);
728 return aarch64_ins_imm_rotate1 (self, info, code, inst, errors);
731 return aarch64_ins_cond (self, info, code, inst, errors);
734 return aarch64_ins_addr_simple (self, info, code, inst, errors);
736 return aarch64_ins_addr_regoff (self, info, code, inst, errors);
740 return aarch64_ins_addr_simm (self, info, code, inst, errors);
742 return aarch64_ins_addr_simm10 (self, info, code, inst, errors);
744 return aarch64_ins_addr_uimm12 (self, info, code, inst, errors);
746 return aarch64_ins_addr_offset (self, info, code, inst, errors);
748 return aarch64_ins_simd_addr_post (self, info, code, inst, errors);
750 return aarch64_ins_sysreg (self, info, code, inst, errors);
752 return aarch64_ins_pstatefield (self, info, code, inst, errors);
758 return aarch64_ins_sysins_op (self, info, code, inst, errors);
761 return aarch64_ins_barrier (self, info, code, inst, errors);
763 return aarch64_ins_prfop (self, info, code, inst, errors);
766 return aarch64_ins_hint (self, info, code, inst, errors);
768 return aarch64_ins_sve_addr_ri_s4 (self, info, code, inst, errors);
773 return aarch64_ins_sve_addr_ri_s4xvl (self, info, code, inst, errors);
775 return aarch64_ins_sve_addr_ri_s6xvl (self, info, code, inst, errors);
777 return aarch64_ins_sve_addr_ri_s9xvl (self, info, code, inst, errors);
782 return aarch64_ins_sve_addr_ri_u6 (self, info, code, inst, errors);
796 return aarch64_ins_sve_addr_rr_lsl (self, info, code, inst, errors);
805 return aarch64_ins_sve_addr_rz_xtw (self, info, code, inst, errors);
810 return aarch64_ins_sve_addr_zi_u5 (self, info, code, inst, errors);
812 return aarch64_ins_sve_addr_zz_lsl (self, info, code, inst, errors);
814 return aarch64_ins_sve_addr_zz_sxtw (self, info, code, inst, errors);
816 return aarch64_ins_sve_addr_zz_uxtw (self, info, code, inst, errors);
818 return aarch64_ins_sve_aimm (self, info, code, inst, errors);
820 return aarch64_ins_sve_asimm (self, info, code, inst, errors);
822 return aarch64_ins_sve_float_half_one (self, info, code, inst, errors);
824 return aarch64_ins_sve_float_half_two (self, info, code, inst, errors);
826 return aarch64_ins_sve_float_zero_one (self, info, code, inst, errors);
828 return aarch64_ins_inv_limm (self, info, code, inst, errors);
830 return aarch64_ins_sve_limm_mov (self, info, code, inst, errors);
832 return aarch64_ins_sve_scale (self, info, code, inst, errors);
835 return aarch64_ins_sve_shlimm (self, info, code, inst, errors);
838 return aarch64_ins_sve_shrimm (self, info, code, inst, errors);
842 return aarch64_ins_sve_quad_index (self, info, code, inst, errors);
844 return aarch64_ins_sve_index (self, info, code, inst, errors);
847 return aarch64_ins_sve_reglist (self, info, code, inst, errors);
848 default: assert (0); abort ();