From 35822b3812f74319dfad28876d37645589b83a80 Mon Sep 17 00:00:00 2001 From: Matthew Wahab Date: Fri, 27 Nov 2015 15:02:26 +0000 Subject: [AArch64] Let aliased instructions be their preferred form. Although the AArch64 backend supports aliased instructions, the aliasing forms are always preferred over the real instruction. This makes it awkward to handle instructions which have aliases but which are their own preferred form. This patch includes the instruction being aliased in the list of alternatives which is searched when considering which form to use. opcodes/ 2015-11-27 Matthew Wahab * aarch64-asm-2.c: Regenerate. * aarch64-dis-2.c: Regenerate. * aarch64-dis.c: Weaken assert. * aarch64-gen.c: Include the instruction in the list of its possible aliases. Change-Id: I1f23eb25fccef76a64d3d732d58761bd25fad94e --- opcodes/aarch64-dis-2.c | 95 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 95 insertions(+) (limited to 'opcodes/aarch64-dis-2.c') diff --git a/opcodes/aarch64-dis-2.c b/opcodes/aarch64-dis-2.c index 3c7d5c6..d83bae0 100644 --- a/opcodes/aarch64-dis-2.c +++ b/opcodes/aarch64-dis-2.c @@ -9060,29 +9060,124 @@ aarch64_find_next_alias_opcode (const aarch64_opcode *opcode) int value; switch (key) { + case 3: value = 2; break; /* ngc --> sbc. */ + case 5: value = 4; break; /* ngcs --> sbcs. */ + case 8: value = 7; break; /* cmn --> adds. */ + case 11: value = 10; break; /* cmp --> subs. */ + case 13: value = 12; break; /* mov --> add. */ + case 15: value = 14; break; /* cmn --> adds. */ + case 18: value = 17; break; /* cmp --> subs. */ + case 21: value = 20; break; /* cmn --> adds. */ + case 23: value = 22; break; /* neg --> sub. */ case 26: value = 25; break; /* negs --> cmp. */ + case 25: value = 24; break; /* cmp --> subs. */ + case 141: value = 140; break; /* mov --> umov. */ + case 143: value = 142; break; /* mov --> ins. */ + case 145: value = 144; break; /* mov --> ins. */ + case 206: value = 205; break; /* mvn --> not. */ + case 261: value = 260; break; /* mov --> orr. */ + case 318: value = 317; break; /* sxtl --> sshll. */ + case 320: value = 319; break; /* sxtl2 --> sshll2. */ + case 340: value = 339; break; /* uxtl --> ushll. */ + case 342: value = 341; break; /* uxtl2 --> ushll2. */ + case 437: value = 436; break; /* mov --> dup. */ case 506: value = 505; break; /* sxtw --> sxth. */ case 505: value = 504; break; /* sxth --> sxtb. */ case 504: value = 507; break; /* sxtb --> asr. */ case 507: value = 503; break; /* asr --> sbfx. */ case 503: value = 502; break; /* sbfx --> sbfiz. */ + case 502: value = 501; break; /* sbfiz --> sbfm. */ case 510: value = 509; break; /* bfxil --> bfi. */ + case 509: value = 508; break; /* bfi --> bfm. */ case 515: value = 514; break; /* uxth --> uxtb. */ case 514: value = 517; break; /* uxtb --> lsr. */ case 517: value = 516; break; /* lsr --> lsl. */ case 516: value = 513; break; /* lsl --> ubfx. */ case 513: value = 512; break; /* ubfx --> ubfiz. */ + case 512: value = 511; break; /* ubfiz --> ubfm. */ case 535: value = 534; break; /* cset --> cinc. */ + case 534: value = 533; break; /* cinc --> csinc. */ case 538: value = 537; break; /* csetm --> cinv. */ + case 537: value = 536; break; /* cinv --> csinv. */ + case 540: value = 539; break; /* cneg --> csneg. */ + case 565: value = 564; break; /* lsl --> lslv. */ + case 567: value = 566; break; /* lsr --> lsrv. */ + case 569: value = 568; break; /* asr --> asrv. */ + case 571: value = 570; break; /* ror --> rorv. */ + case 581: value = 580; break; /* mul --> madd. */ + case 583: value = 582; break; /* mneg --> msub. */ + case 585: value = 584; break; /* smull --> smaddl. */ + case 587: value = 586; break; /* smnegl --> smsubl. */ + case 590: value = 589; break; /* umull --> umaddl. */ + case 592: value = 591; break; /* umnegl --> umsubl. */ + case 603: value = 602; break; /* ror --> extr. */ + case 760: value = 759; break; /* bic --> and. */ + case 762: value = 761; break; /* mov --> orr. */ + case 765: value = 764; break; /* tst --> ands. */ case 770: value = 769; break; /* uxtw --> mov. */ + case 769: value = 768; break; /* mov --> orr. */ + case 772: value = 771; break; /* mvn --> orn. */ + case 776: value = 775; break; /* tst --> ands. */ + case 902: value = 806; break; /* staddb --> ldaddb. */ + case 903: value = 807; break; /* staddh --> ldaddh. */ + case 904: value = 808; break; /* stadd --> ldadd. */ + case 905: value = 810; break; /* staddlb --> ldaddlb. */ + case 906: value = 813; break; /* staddlh --> ldaddlh. */ + case 907: value = 816; break; /* staddl --> ldaddl. */ + case 908: value = 818; break; /* stclrb --> ldclrb. */ + case 909: value = 819; break; /* stclrh --> ldclrh. */ + case 910: value = 820; break; /* stclr --> ldclr. */ + case 911: value = 822; break; /* stclrlb --> ldclrlb. */ + case 912: value = 825; break; /* stclrlh --> ldclrlh. */ + case 913: value = 828; break; /* stclrl --> ldclrl. */ + case 914: value = 830; break; /* steorb --> ldeorb. */ + case 915: value = 831; break; /* steorh --> ldeorh. */ + case 916: value = 832; break; /* steor --> ldeor. */ + case 917: value = 834; break; /* steorlb --> ldeorlb. */ + case 918: value = 837; break; /* steorlh --> ldeorlh. */ + case 919: value = 840; break; /* steorl --> ldeorl. */ + case 920: value = 842; break; /* stsetb --> ldsetb. */ + case 921: value = 843; break; /* stseth --> ldseth. */ + case 922: value = 844; break; /* stset --> ldset. */ + case 923: value = 846; break; /* stsetlb --> ldsetlb. */ + case 924: value = 849; break; /* stsetlh --> ldsetlh. */ + case 925: value = 852; break; /* stsetl --> ldsetl. */ + case 926: value = 854; break; /* stsmaxb --> ldsmaxb. */ + case 927: value = 855; break; /* stsmaxh --> ldsmaxh. */ + case 928: value = 856; break; /* stsmax --> ldsmax. */ + case 929: value = 858; break; /* stsmaxlb --> ldsmaxlb. */ + case 930: value = 861; break; /* stsmaxlh --> ldsmaxlh. */ + case 931: value = 864; break; /* stsmaxl --> ldsmaxl. */ + case 932: value = 866; break; /* stsminb --> ldsminb. */ + case 933: value = 867; break; /* stsminh --> ldsminh. */ + case 934: value = 868; break; /* stsmin --> ldsmin. */ + case 935: value = 870; break; /* stsminlb --> ldsminlb. */ + case 936: value = 873; break; /* stsminlh --> ldsminlh. */ + case 937: value = 876; break; /* stsminl --> ldsminl. */ + case 938: value = 878; break; /* stumaxb --> ldumaxb. */ + case 939: value = 879; break; /* stumaxh --> ldumaxh. */ + case 940: value = 880; break; /* stumax --> ldumax. */ + case 941: value = 882; break; /* stumaxlb --> ldumaxlb. */ + case 942: value = 885; break; /* stumaxlh --> ldumaxlh. */ + case 943: value = 888; break; /* stumaxl --> ldumaxl. */ + case 944: value = 890; break; /* stuminb --> lduminb. */ + case 945: value = 891; break; /* stuminh --> lduminh. */ + case 946: value = 892; break; /* stumin --> ldumin. */ + case 947: value = 894; break; /* stuminlb --> lduminlb. */ + case 948: value = 897; break; /* stuminlh --> lduminlh. */ + case 949: value = 900; break; /* stuminl --> lduminl. */ + case 951: value = 950; break; /* mov --> movn. */ + case 953: value = 952; break; /* mov --> movz. */ case 964: value = 963; break; /* sevl --> sev. */ case 963: value = 962; break; /* sev --> wfi. */ case 962: value = 961; break; /* wfi --> wfe. */ case 961: value = 960; break; /* wfe --> yield. */ case 960: value = 959; break; /* yield --> nop. */ + case 959: value = 958; break; /* nop --> hint. */ case 973: value = 972; break; /* tlbi --> ic. */ case 972: value = 971; break; /* ic --> dc. */ case 971: value = 970; break; /* dc --> at. */ + case 970: value = 969; break; /* at --> sys. */ default: return NULL; } -- cgit v1.1