Files
binutils-gdb/opcodes/aarch64-asm-2.c
Matthew Wahab d685192a58 [AArch64] Add ARMv8.2 instructions BFC and REV64.
ARMv8.2 adds two new instructions: BFC as an alias for BFM and REV64 as
an alias for REV. This patch set adds support for these to binutils,
enabled when the -march=armv8.2-a is given. It depends on the support
for an instruction being its preferred form which was added in an
earlier patch.

This patch adds the alias BFC <Rd>, #<imm>, #<width> as the preferred
form for BFM when the source is a zero register and the conditions for
using the BFI form are met (in other words, BFC is the preferred form
for BFI <Rd>, <Rs>, #<imm>, #<width> when the <Rs> is a zero register).

gas/testsuite/
2015-11-27  Matthew Wahab  <matthew.wahab@arm.com>

	* gas/aarch64/alias-2.d: New.
	* gas/aarch64/alias-2.s: New.

include/opcode/
2015-11-27  Matthew Wahab  <matthew.wahab@arm.com>

	* aarch64.h (aarch64_op): Add OP_BFC.

opcodes/
2015-11-27  Matthew Wahab  <matthew.wahab@arm.com>

	* aarch64-asm-2.c: Regenerate.
	* aarch64-asm.c (convert_bfc_to_bfm): New.
	(convert_to_real): Add case for OP_BFC.
	* aarch64-dis-2.c: Regenerate.
	* aarch64-dis.c: (convert_bfm_to_bfc): New.
	(convert_to_alias): Add case for OP_BFC.
	* aarch64-opc-2.c: Regenerate.
	* aarch64-opc.c (operand_general_constraint_met_p): Weaken assert
	to allow width operand in three-operand instructions.
	* aarch64-tbl.h (QL_BF1): New.
	(aarch64_feature_v8_2): New.
	(ARMV8_2): New.
	(aarch64_opcode_table): Add "bfc".

Change-Id: I6efe318b2538ba11f0caece7c6d70957441c872b
2015-11-27 15:28:42 +00:00

563 lines
14 KiB
C

/* This file is automatically generated by aarch64-gen. Do not edit! */
/* Copyright (C) 2012-2015 Free Software Foundation, Inc.
Contributed by ARM Ltd.
This file is part of the GNU opcodes library.
This library is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3, or (at your option)
any later version.
It is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
License for more details.
You should have received a copy of the GNU General Public License
along with this program; see the file COPYING3. If not,
see <http://www.gnu.org/licenses/>. */
#include "sysdep.h"
#include "aarch64-asm.h"
const aarch64_opcode *
aarch64_find_real_opcode (const aarch64_opcode *opcode)
{
/* Use the index as the key to locate the real opcode. */
int key = opcode - aarch64_opcode_table;
int value;
switch (key)
{
case 3: /* ngc */
case 2: /* sbc */
value = 2; /* --> sbc. */
break;
case 5: /* ngcs */
case 4: /* sbcs */
value = 4; /* --> sbcs. */
break;
case 8: /* cmn */
case 7: /* adds */
value = 7; /* --> adds. */
break;
case 11: /* cmp */
case 10: /* subs */
value = 10; /* --> subs. */
break;
case 13: /* mov */
case 12: /* add */
value = 12; /* --> add. */
break;
case 15: /* cmn */
case 14: /* adds */
value = 14; /* --> adds. */
break;
case 18: /* cmp */
case 17: /* subs */
value = 17; /* --> subs. */
break;
case 21: /* cmn */
case 20: /* adds */
value = 20; /* --> adds. */
break;
case 23: /* neg */
case 22: /* sub */
value = 22; /* --> sub. */
break;
case 26: /* negs */
case 25: /* cmp */
case 24: /* subs */
value = 24; /* --> subs. */
break;
case 141: /* mov */
case 140: /* umov */
value = 140; /* --> umov. */
break;
case 143: /* mov */
case 142: /* ins */
value = 142; /* --> ins. */
break;
case 145: /* mov */
case 144: /* ins */
value = 144; /* --> ins. */
break;
case 206: /* mvn */
case 205: /* not */
value = 205; /* --> not. */
break;
case 261: /* mov */
case 260: /* orr */
value = 260; /* --> orr. */
break;
case 318: /* sxtl */
case 317: /* sshll */
value = 317; /* --> sshll. */
break;
case 320: /* sxtl2 */
case 319: /* sshll2 */
value = 319; /* --> sshll2. */
break;
case 340: /* uxtl */
case 339: /* ushll */
value = 339; /* --> ushll. */
break;
case 342: /* uxtl2 */
case 341: /* ushll2 */
value = 341; /* --> ushll2. */
break;
case 437: /* mov */
case 436: /* dup */
value = 436; /* --> dup. */
break;
case 506: /* sxtw */
case 505: /* sxth */
case 504: /* sxtb */
case 507: /* asr */
case 503: /* sbfx */
case 502: /* sbfiz */
case 501: /* sbfm */
value = 501; /* --> sbfm. */
break;
case 510: /* bfc */
case 511: /* bfxil */
case 509: /* bfi */
case 508: /* bfm */
value = 508; /* --> bfm. */
break;
case 516: /* uxth */
case 515: /* uxtb */
case 518: /* lsr */
case 517: /* lsl */
case 514: /* ubfx */
case 513: /* ubfiz */
case 512: /* ubfm */
value = 512; /* --> ubfm. */
break;
case 536: /* cset */
case 535: /* cinc */
case 534: /* csinc */
value = 534; /* --> csinc. */
break;
case 539: /* csetm */
case 538: /* cinv */
case 537: /* csinv */
value = 537; /* --> csinv. */
break;
case 541: /* cneg */
case 540: /* csneg */
value = 540; /* --> csneg. */
break;
case 566: /* lsl */
case 565: /* lslv */
value = 565; /* --> lslv. */
break;
case 568: /* lsr */
case 567: /* lsrv */
value = 567; /* --> lsrv. */
break;
case 570: /* asr */
case 569: /* asrv */
value = 569; /* --> asrv. */
break;
case 572: /* ror */
case 571: /* rorv */
value = 571; /* --> rorv. */
break;
case 582: /* mul */
case 581: /* madd */
value = 581; /* --> madd. */
break;
case 584: /* mneg */
case 583: /* msub */
value = 583; /* --> msub. */
break;
case 586: /* smull */
case 585: /* smaddl */
value = 585; /* --> smaddl. */
break;
case 588: /* smnegl */
case 587: /* smsubl */
value = 587; /* --> smsubl. */
break;
case 591: /* umull */
case 590: /* umaddl */
value = 590; /* --> umaddl. */
break;
case 593: /* umnegl */
case 592: /* umsubl */
value = 592; /* --> umsubl. */
break;
case 604: /* ror */
case 603: /* extr */
value = 603; /* --> extr. */
break;
case 761: /* bic */
case 760: /* and */
value = 760; /* --> and. */
break;
case 763: /* mov */
case 762: /* orr */
value = 762; /* --> orr. */
break;
case 766: /* tst */
case 765: /* ands */
value = 765; /* --> ands. */
break;
case 771: /* uxtw */
case 770: /* mov */
case 769: /* orr */
value = 769; /* --> orr. */
break;
case 773: /* mvn */
case 772: /* orn */
value = 772; /* --> orn. */
break;
case 777: /* tst */
case 776: /* ands */
value = 776; /* --> ands. */
break;
case 903: /* staddb */
case 807: /* ldaddb */
value = 807; /* --> ldaddb. */
break;
case 904: /* staddh */
case 808: /* ldaddh */
value = 808; /* --> ldaddh. */
break;
case 905: /* stadd */
case 809: /* ldadd */
value = 809; /* --> ldadd. */
break;
case 906: /* staddlb */
case 811: /* ldaddlb */
value = 811; /* --> ldaddlb. */
break;
case 907: /* staddlh */
case 814: /* ldaddlh */
value = 814; /* --> ldaddlh. */
break;
case 908: /* staddl */
case 817: /* ldaddl */
value = 817; /* --> ldaddl. */
break;
case 909: /* stclrb */
case 819: /* ldclrb */
value = 819; /* --> ldclrb. */
break;
case 910: /* stclrh */
case 820: /* ldclrh */
value = 820; /* --> ldclrh. */
break;
case 911: /* stclr */
case 821: /* ldclr */
value = 821; /* --> ldclr. */
break;
case 912: /* stclrlb */
case 823: /* ldclrlb */
value = 823; /* --> ldclrlb. */
break;
case 913: /* stclrlh */
case 826: /* ldclrlh */
value = 826; /* --> ldclrlh. */
break;
case 914: /* stclrl */
case 829: /* ldclrl */
value = 829; /* --> ldclrl. */
break;
case 915: /* steorb */
case 831: /* ldeorb */
value = 831; /* --> ldeorb. */
break;
case 916: /* steorh */
case 832: /* ldeorh */
value = 832; /* --> ldeorh. */
break;
case 917: /* steor */
case 833: /* ldeor */
value = 833; /* --> ldeor. */
break;
case 918: /* steorlb */
case 835: /* ldeorlb */
value = 835; /* --> ldeorlb. */
break;
case 919: /* steorlh */
case 838: /* ldeorlh */
value = 838; /* --> ldeorlh. */
break;
case 920: /* steorl */
case 841: /* ldeorl */
value = 841; /* --> ldeorl. */
break;
case 921: /* stsetb */
case 843: /* ldsetb */
value = 843; /* --> ldsetb. */
break;
case 922: /* stseth */
case 844: /* ldseth */
value = 844; /* --> ldseth. */
break;
case 923: /* stset */
case 845: /* ldset */
value = 845; /* --> ldset. */
break;
case 924: /* stsetlb */
case 847: /* ldsetlb */
value = 847; /* --> ldsetlb. */
break;
case 925: /* stsetlh */
case 850: /* ldsetlh */
value = 850; /* --> ldsetlh. */
break;
case 926: /* stsetl */
case 853: /* ldsetl */
value = 853; /* --> ldsetl. */
break;
case 927: /* stsmaxb */
case 855: /* ldsmaxb */
value = 855; /* --> ldsmaxb. */
break;
case 928: /* stsmaxh */
case 856: /* ldsmaxh */
value = 856; /* --> ldsmaxh. */
break;
case 929: /* stsmax */
case 857: /* ldsmax */
value = 857; /* --> ldsmax. */
break;
case 930: /* stsmaxlb */
case 859: /* ldsmaxlb */
value = 859; /* --> ldsmaxlb. */
break;
case 931: /* stsmaxlh */
case 862: /* ldsmaxlh */
value = 862; /* --> ldsmaxlh. */
break;
case 932: /* stsmaxl */
case 865: /* ldsmaxl */
value = 865; /* --> ldsmaxl. */
break;
case 933: /* stsminb */
case 867: /* ldsminb */
value = 867; /* --> ldsminb. */
break;
case 934: /* stsminh */
case 868: /* ldsminh */
value = 868; /* --> ldsminh. */
break;
case 935: /* stsmin */
case 869: /* ldsmin */
value = 869; /* --> ldsmin. */
break;
case 936: /* stsminlb */
case 871: /* ldsminlb */
value = 871; /* --> ldsminlb. */
break;
case 937: /* stsminlh */
case 874: /* ldsminlh */
value = 874; /* --> ldsminlh. */
break;
case 938: /* stsminl */
case 877: /* ldsminl */
value = 877; /* --> ldsminl. */
break;
case 939: /* stumaxb */
case 879: /* ldumaxb */
value = 879; /* --> ldumaxb. */
break;
case 940: /* stumaxh */
case 880: /* ldumaxh */
value = 880; /* --> ldumaxh. */
break;
case 941: /* stumax */
case 881: /* ldumax */
value = 881; /* --> ldumax. */
break;
case 942: /* stumaxlb */
case 883: /* ldumaxlb */
value = 883; /* --> ldumaxlb. */
break;
case 943: /* stumaxlh */
case 886: /* ldumaxlh */
value = 886; /* --> ldumaxlh. */
break;
case 944: /* stumaxl */
case 889: /* ldumaxl */
value = 889; /* --> ldumaxl. */
break;
case 945: /* stuminb */
case 891: /* lduminb */
value = 891; /* --> lduminb. */
break;
case 946: /* stuminh */
case 892: /* lduminh */
value = 892; /* --> lduminh. */
break;
case 947: /* stumin */
case 893: /* ldumin */
value = 893; /* --> ldumin. */
break;
case 948: /* stuminlb */
case 895: /* lduminlb */
value = 895; /* --> lduminlb. */
break;
case 949: /* stuminlh */
case 898: /* lduminlh */
value = 898; /* --> lduminlh. */
break;
case 950: /* stuminl */
case 901: /* lduminl */
value = 901; /* --> lduminl. */
break;
case 952: /* mov */
case 951: /* movn */
value = 951; /* --> movn. */
break;
case 954: /* mov */
case 953: /* movz */
value = 953; /* --> movz. */
break;
case 965: /* sevl */
case 964: /* sev */
case 963: /* wfi */
case 962: /* wfe */
case 961: /* yield */
case 960: /* nop */
case 959: /* hint */
value = 959; /* --> hint. */
break;
case 974: /* tlbi */
case 973: /* ic */
case 972: /* dc */
case 971: /* at */
case 970: /* sys */
value = 970; /* --> sys. */
break;
default: return NULL;
}
return aarch64_opcode_table + value;
}
const char*
aarch64_insert_operand (const aarch64_operand *self,
const aarch64_opnd_info *info,
aarch64_insn *code, const aarch64_inst *inst)
{
/* Use the index as the key. */
int key = self - aarch64_operands;
switch (key)
{
case 1:
case 2:
case 3:
case 4:
case 5:
case 6:
case 7:
case 8:
case 9:
case 10:
case 14:
case 15:
case 16:
case 17:
case 19:
case 20:
case 21:
case 22:
case 23:
case 24:
case 25:
case 26:
case 27:
case 35:
case 36:
return aarch64_ins_regno (self, info, code, inst);
case 12:
return aarch64_ins_reg_extended (self, info, code, inst);
case 13:
return aarch64_ins_reg_shifted (self, info, code, inst);
case 18:
return aarch64_ins_ft (self, info, code, inst);
case 28:
case 29:
case 30:
return aarch64_ins_reglane (self, info, code, inst);
case 31:
return aarch64_ins_reglist (self, info, code, inst);
case 32:
return aarch64_ins_ldst_reglist (self, info, code, inst);
case 33:
return aarch64_ins_ldst_reglist_r (self, info, code, inst);
case 34:
return aarch64_ins_ldst_elemlist (self, info, code, inst);
case 37:
case 46:
case 47:
case 48:
case 49:
case 50:
case 51:
case 52:
case 53:
case 54:
case 55:
case 56:
case 57:
case 58:
case 67:
case 68:
case 69:
case 70:
return aarch64_ins_imm (self, info, code, inst);
case 38:
case 39:
return aarch64_ins_advsimd_imm_shift (self, info, code, inst);
case 40:
case 41:
case 42:
return aarch64_ins_advsimd_imm_modified (self, info, code, inst);
case 59:
return aarch64_ins_limm (self, info, code, inst);
case 60:
return aarch64_ins_aimm (self, info, code, inst);
case 61:
return aarch64_ins_imm_half (self, info, code, inst);
case 62:
return aarch64_ins_fbits (self, info, code, inst);
case 64:
case 65:
return aarch64_ins_cond (self, info, code, inst);
case 71:
case 77:
return aarch64_ins_addr_simple (self, info, code, inst);
case 72:
return aarch64_ins_addr_regoff (self, info, code, inst);
case 73:
case 74:
case 75:
return aarch64_ins_addr_simm (self, info, code, inst);
case 76:
return aarch64_ins_addr_uimm12 (self, info, code, inst);
case 78:
return aarch64_ins_simd_addr_post (self, info, code, inst);
case 79:
return aarch64_ins_sysreg (self, info, code, inst);
case 80:
return aarch64_ins_pstatefield (self, info, code, inst);
case 81:
case 82:
case 83:
case 84:
return aarch64_ins_sysins_op (self, info, code, inst);
case 85:
case 86:
return aarch64_ins_barrier (self, info, code, inst);
case 87:
return aarch64_ins_prfop (self, info, code, inst);
default: assert (0); abort ();
}
}