[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
This commit is contained in:
Matthew Wahab 2015-11-27 15:25:08 +00:00
parent e19616610d
commit d685192a58
13 changed files with 1106 additions and 861 deletions

View File

@ -1,3 +1,8 @@
2015-11-27 Matthew Wahab <matthew.wahab@arm.com>
* gas/aarch64/alias-2.d: New.
* gas/aarch64/alias-2.s: New.
2015-11-27 Matthew Wahab <matthew.wahab@arm.com>
* gas/aarch64/sysreg-2.d: New.

View File

@ -0,0 +1,98 @@
#objdump: -dr
#as: -march=armv8.2-a
.*: file format .*
Disassembly of section \.text:
0000000000000000 <.*>:
[0-9a-f]+: b34107e0 bfxil x0, xzr, #1, #1
[0-9a-f]+: b3410420 bfxil x0, x1, #1, #1
[0-9a-f]+: b341043f bfxil xzr, x1, #1, #1
[0-9a-f]+: b34107ff bfxil xzr, xzr, #1, #1
[0-9a-f]+: b34123e0 bfxil x0, xzr, #1, #8
[0-9a-f]+: b3412020 bfxil x0, x1, #1, #8
[0-9a-f]+: b341203f bfxil xzr, x1, #1, #8
[0-9a-f]+: b34123ff bfxil xzr, xzr, #1, #8
[0-9a-f]+: b3413fe0 bfxil x0, xzr, #1, #15
[0-9a-f]+: b3413c20 bfxil x0, x1, #1, #15
[0-9a-f]+: b3413c3f bfxil xzr, x1, #1, #15
[0-9a-f]+: b3413fff bfxil xzr, xzr, #1, #15
[0-9a-f]+: b35007e0 bfc x0, #48, #2
[0-9a-f]+: b3500420 bfi x0, x1, #48, #2
[0-9a-f]+: b350043f bfi xzr, x1, #48, #2
[0-9a-f]+: b35007ff bfc xzr, #48, #2
[0-9a-f]+: b35023e0 bfc x0, #48, #9
[0-9a-f]+: b3502020 bfi x0, x1, #48, #9
[0-9a-f]+: b350203f bfi xzr, x1, #48, #9
[0-9a-f]+: b35023ff bfc xzr, #48, #9
[0-9a-f]+: b3503fe0 bfc x0, #48, #16
[0-9a-f]+: b3503c20 bfi x0, x1, #48, #16
[0-9a-f]+: b3503c3f bfi xzr, x1, #48, #16
[0-9a-f]+: b3503fff bfc xzr, #48, #16
[0-9a-f]+: b35f07e0 bfc x0, #33, #2
[0-9a-f]+: b35f0420 bfi x0, x1, #33, #2
[0-9a-f]+: b35f043f bfi xzr, x1, #33, #2
[0-9a-f]+: b35f07ff bfc xzr, #33, #2
[0-9a-f]+: b35f23e0 bfc x0, #33, #9
[0-9a-f]+: b35f2020 bfi x0, x1, #33, #9
[0-9a-f]+: b35f203f bfi xzr, x1, #33, #9
[0-9a-f]+: b35f23ff bfc xzr, #33, #9
[0-9a-f]+: b35f3fe0 bfc x0, #33, #16
[0-9a-f]+: b35f3c20 bfi x0, x1, #33, #16
[0-9a-f]+: b35f3c3f bfi xzr, x1, #33, #16
[0-9a-f]+: b35f3fff bfc xzr, #33, #16
[0-9a-f]+: b37f03e0 bfc x0, #1, #1
[0-9a-f]+: b37f0020 bfi x0, x1, #1, #1
[0-9a-f]+: b37f003f bfi xzr, x1, #1, #1
[0-9a-f]+: b37f03ff bfc xzr, #1, #1
[0-9a-f]+: b37f1fe0 bfc x0, #1, #8
[0-9a-f]+: b37f1c20 bfi x0, x1, #1, #8
[0-9a-f]+: b37f1c3f bfi xzr, x1, #1, #8
[0-9a-f]+: b37f1fff bfc xzr, #1, #8
[0-9a-f]+: b37f3be0 bfc x0, #1, #15
[0-9a-f]+: b37f3820 bfi x0, x1, #1, #15
[0-9a-f]+: b37f383f bfi xzr, x1, #1, #15
[0-9a-f]+: b37f3bff bfc xzr, #1, #15
[0-9a-f]+: b37003e0 bfc x0, #16, #1
[0-9a-f]+: b3700020 bfi x0, x1, #16, #1
[0-9a-f]+: b370003f bfi xzr, x1, #16, #1
[0-9a-f]+: b37003ff bfc xzr, #16, #1
[0-9a-f]+: b3701fe0 bfc x0, #16, #8
[0-9a-f]+: b3701c20 bfi x0, x1, #16, #8
[0-9a-f]+: b3701c3f bfi xzr, x1, #16, #8
[0-9a-f]+: b3701fff bfc xzr, #16, #8
[0-9a-f]+: b3703be0 bfc x0, #16, #15
[0-9a-f]+: b3703820 bfi x0, x1, #16, #15
[0-9a-f]+: b370383f bfi xzr, x1, #16, #15
[0-9a-f]+: b3703bff bfc xzr, #16, #15
[0-9a-f]+: b36103e0 bfc x0, #31, #1
[0-9a-f]+: b3610020 bfi x0, x1, #31, #1
[0-9a-f]+: b361003f bfi xzr, x1, #31, #1
[0-9a-f]+: b36103ff bfc xzr, #31, #1
[0-9a-f]+: b3611fe0 bfc x0, #31, #8
[0-9a-f]+: b3611c20 bfi x0, x1, #31, #8
[0-9a-f]+: b3611c3f bfi xzr, x1, #31, #8
[0-9a-f]+: b3611fff bfc xzr, #31, #8
[0-9a-f]+: b3613be0 bfc x0, #31, #15
[0-9a-f]+: b3613820 bfi x0, x1, #31, #15
[0-9a-f]+: b361383f bfi xzr, x1, #31, #15
[0-9a-f]+: b3613bff bfc xzr, #31, #15
[0-9a-f]+: b34003e0 bfxil x0, xzr, #0, #1
[0-9a-f]+: b36103ff bfc xzr, #31, #1
[0-9a-f]+: b3401fe0 bfxil x0, xzr, #0, #8
[0-9a-f]+: b3611fff bfc xzr, #31, #8
[0-9a-f]+: b3403be0 bfxil x0, xzr, #0, #15
[0-9a-f]+: b3613bff bfc xzr, #31, #15
[0-9a-f]+: b34003e0 bfxil x0, xzr, #0, #1
[0-9a-f]+: b36103ff bfc xzr, #31, #1
[0-9a-f]+: b3401fe0 bfxil x0, xzr, #0, #8
[0-9a-f]+: b3611fff bfc xzr, #31, #8
[0-9a-f]+: b3403be0 bfxil x0, xzr, #0, #15
[0-9a-f]+: b3613bff bfc xzr, #31, #15
[0-9a-f]+: b34003e0 bfxil x0, xzr, #0, #1
[0-9a-f]+: b36103ff bfc xzr, #31, #1
[0-9a-f]+: b3401fe0 bfxil x0, xzr, #0, #8
[0-9a-f]+: b3611fff bfc xzr, #31, #8
[0-9a-f]+: b3403be0 bfxil x0, xzr, #0, #15
[0-9a-f]+: b3613bff bfc xzr, #31, #15

View File

@ -0,0 +1,31 @@
/* alias-2.s Test file for ARMv8.2 AArch64 instructions aliases or disassembly
preference. */
/* <bfm> [Xd|xzr], [xzr|<Xr>], <imm>, <width> */
.macro bfm_inst op imm width
\op x0, xzr, #\imm, #\width
\op x0, x1, #\imm, #\width
\op xzr, x1, #\imm, #\width
\op xzr, xzr, #\imm, #\width
.endm
/* bfc [Xd|xzr], <imm>, <width> */
.macro bfc_inst imm width
bfc x0, #\imm, #\width
bfc xzr, #\imm, #\width
.endm
.text
.irp op, bfm, bfi
.irp imm, 1, 16, 31
.irp width, 1, 8, 15
bfm_inst \op, \imm, \width
.endr
.endr
.endr
.irp imm, 1, 16, 31
.irp width, 1, 8, 15
bfc_inst \imm, \width
.endr
.endr

View File

@ -1,3 +1,7 @@
2015-11-27 Matthew Wahab <matthew.wahab@arm.com>
* aarch64.h (aarch64_op): Add OP_BFC.
2015-11-27 Matthew Wahab <matthew.wahab@arm.com>
* aarch64.h (AARCH64_FEATURE_F16): New.

View File

@ -438,6 +438,7 @@ enum aarch64_op
OP_SBFX,
OP_SBFIZ,
OP_BFI,
OP_BFC, /* ARMv8.2. */
OP_UBFIZ,
OP_UXTB,
OP_UXTH,

View File

@ -1,3 +1,19 @@
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".
2015-11-27 Matthew Wahab <matthew.wahab@arm.com>
* aarch64-asm-2.c: Regenerate.

View File

@ -120,318 +120,319 @@ aarch64_find_real_opcode (const aarch64_opcode *opcode)
case 501: /* sbfm */
value = 501; /* --> sbfm. */
break;
case 510: /* bfxil */
case 510: /* bfc */
case 511: /* bfxil */
case 509: /* bfi */
case 508: /* bfm */
value = 508; /* --> bfm. */
break;
case 515: /* uxth */
case 514: /* uxtb */
case 517: /* lsr */
case 516: /* lsl */
case 513: /* ubfx */
case 512: /* ubfiz */
case 511: /* ubfm */
value = 511; /* --> ubfm. */
break;
case 535: /* cset */
case 534: /* cinc */
case 533: /* csinc */
value = 533; /* --> csinc. */
break;
case 538: /* csetm */
case 537: /* cinv */
case 536: /* csinv */
value = 536; /* --> csinv. */
break;
case 540: /* cneg */
case 539: /* csneg */
value = 539; /* --> csneg. */
break;
case 565: /* lsl */
case 564: /* lslv */
value = 564; /* --> lslv. */
break;
case 567: /* lsr */
case 566: /* lsrv */
value = 566; /* --> lsrv. */
break;
case 569: /* asr */
case 568: /* asrv */
value = 568; /* --> asrv. */
break;
case 571: /* ror */
case 570: /* rorv */
value = 570; /* --> rorv. */
break;
case 581: /* mul */
case 580: /* madd */
value = 580; /* --> madd. */
break;
case 583: /* mneg */
case 582: /* msub */
value = 582; /* --> msub. */
break;
case 585: /* smull */
case 584: /* smaddl */
value = 584; /* --> smaddl. */
break;
case 587: /* smnegl */
case 586: /* smsubl */
value = 586; /* --> smsubl. */
break;
case 590: /* umull */
case 589: /* umaddl */
value = 589; /* --> umaddl. */
break;
case 592: /* umnegl */
case 591: /* umsubl */
value = 591; /* --> umsubl. */
break;
case 603: /* ror */
case 602: /* extr */
value = 602; /* --> extr. */
break;
case 760: /* bic */
case 759: /* and */
value = 759; /* --> and. */
break;
case 762: /* mov */
case 761: /* orr */
value = 761; /* --> orr. */
break;
case 765: /* tst */
case 764: /* ands */
value = 764; /* --> ands. */
break;
case 770: /* uxtw */
case 769: /* mov */
case 768: /* orr */
value = 768; /* --> orr. */
break;
case 772: /* mvn */
case 771: /* orn */
value = 771; /* --> orn. */
break;
case 776: /* tst */
case 775: /* ands */
value = 775; /* --> ands. */
break;
case 902: /* staddb */
case 806: /* ldaddb */
value = 806; /* --> ldaddb. */
break;
case 903: /* staddh */
case 807: /* ldaddh */
value = 807; /* --> ldaddh. */
break;
case 904: /* stadd */
case 808: /* ldadd */
value = 808; /* --> ldadd. */
break;
case 905: /* staddlb */
case 810: /* ldaddlb */
value = 810; /* --> ldaddlb. */
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 906: /* staddlh */
case 813: /* ldaddlh */
value = 813; /* --> ldaddlh. */
case 907: /* staddlh */
case 814: /* ldaddlh */
value = 814; /* --> ldaddlh. */
break;
case 907: /* staddl */
case 816: /* ldaddl */
value = 816; /* --> ldaddl. */
case 908: /* staddl */
case 817: /* ldaddl */
value = 817; /* --> ldaddl. */
break;
case 908: /* stclrb */
case 818: /* ldclrb */
value = 818; /* --> ldclrb. */
case 909: /* stclrb */
case 819: /* ldclrb */
value = 819; /* --> ldclrb. */
break;
case 909: /* stclrh */
case 819: /* ldclrh */
value = 819; /* --> ldclrh. */
case 910: /* stclrh */
case 820: /* ldclrh */
value = 820; /* --> ldclrh. */
break;
case 910: /* stclr */
case 820: /* ldclr */
value = 820; /* --> ldclr. */
case 911: /* stclr */
case 821: /* ldclr */
value = 821; /* --> ldclr. */
break;
case 911: /* stclrlb */
case 822: /* ldclrlb */
value = 822; /* --> ldclrlb. */
case 912: /* stclrlb */
case 823: /* ldclrlb */
value = 823; /* --> ldclrlb. */
break;
case 912: /* stclrlh */
case 825: /* ldclrlh */
value = 825; /* --> ldclrlh. */
case 913: /* stclrlh */
case 826: /* ldclrlh */
value = 826; /* --> ldclrlh. */
break;
case 913: /* stclrl */
case 828: /* ldclrl */
value = 828; /* --> ldclrl. */
case 914: /* stclrl */
case 829: /* ldclrl */
value = 829; /* --> ldclrl. */
break;
case 914: /* steorb */
case 830: /* ldeorb */
value = 830; /* --> ldeorb. */
case 915: /* steorb */
case 831: /* ldeorb */
value = 831; /* --> ldeorb. */
break;
case 915: /* steorh */
case 831: /* ldeorh */
value = 831; /* --> ldeorh. */
case 916: /* steorh */
case 832: /* ldeorh */
value = 832; /* --> ldeorh. */
break;
case 916: /* steor */
case 832: /* ldeor */
value = 832; /* --> ldeor. */
case 917: /* steor */
case 833: /* ldeor */
value = 833; /* --> ldeor. */
break;
case 917: /* steorlb */
case 834: /* ldeorlb */
value = 834; /* --> ldeorlb. */
case 918: /* steorlb */
case 835: /* ldeorlb */
value = 835; /* --> ldeorlb. */
break;
case 918: /* steorlh */
case 837: /* ldeorlh */
value = 837; /* --> ldeorlh. */
case 919: /* steorlh */
case 838: /* ldeorlh */
value = 838; /* --> ldeorlh. */
break;
case 919: /* steorl */
case 840: /* ldeorl */
value = 840; /* --> ldeorl. */
case 920: /* steorl */
case 841: /* ldeorl */
value = 841; /* --> ldeorl. */
break;
case 920: /* stsetb */
case 842: /* ldsetb */
value = 842; /* --> ldsetb. */
case 921: /* stsetb */
case 843: /* ldsetb */
value = 843; /* --> ldsetb. */
break;
case 921: /* stseth */
case 843: /* ldseth */
value = 843; /* --> ldseth. */
case 922: /* stseth */
case 844: /* ldseth */
value = 844; /* --> ldseth. */
break;
case 922: /* stset */
case 844: /* ldset */
value = 844; /* --> ldset. */
case 923: /* stset */
case 845: /* ldset */
value = 845; /* --> ldset. */
break;
case 923: /* stsetlb */
case 846: /* ldsetlb */
value = 846; /* --> ldsetlb. */
case 924: /* stsetlb */
case 847: /* ldsetlb */
value = 847; /* --> ldsetlb. */
break;
case 924: /* stsetlh */
case 849: /* ldsetlh */
value = 849; /* --> ldsetlh. */
case 925: /* stsetlh */
case 850: /* ldsetlh */
value = 850; /* --> ldsetlh. */
break;
case 925: /* stsetl */
case 852: /* ldsetl */
value = 852; /* --> ldsetl. */
case 926: /* stsetl */
case 853: /* ldsetl */
value = 853; /* --> ldsetl. */
break;
case 926: /* stsmaxb */
case 854: /* ldsmaxb */
value = 854; /* --> ldsmaxb. */
case 927: /* stsmaxb */
case 855: /* ldsmaxb */
value = 855; /* --> ldsmaxb. */
break;
case 927: /* stsmaxh */
case 855: /* ldsmaxh */
value = 855; /* --> ldsmaxh. */
case 928: /* stsmaxh */
case 856: /* ldsmaxh */
value = 856; /* --> ldsmaxh. */
break;
case 928: /* stsmax */
case 856: /* ldsmax */
value = 856; /* --> ldsmax. */
break;
case 929: /* stsmaxlb */
case 858: /* ldsmaxlb */
value = 858; /* --> ldsmaxlb. */
break;
case 930: /* stsmaxlh */
case 861: /* ldsmaxlh */
value = 861; /* --> ldsmaxlh. */
break;
case 931: /* stsmaxl */
case 864: /* ldsmaxl */
value = 864; /* --> ldsmaxl. */
break;
case 932: /* stsminb */
case 866: /* ldsminb */
value = 866; /* --> ldsminb. */
break;
case 933: /* stsminh */
case 867: /* ldsminh */
value = 867; /* --> ldsminh. */
break;
case 934: /* stsmin */
case 868: /* ldsmin */
value = 868; /* --> ldsmin. */
break;
case 935: /* stsminlb */
case 870: /* ldsminlb */
value = 870; /* --> ldsminlb. */
break;
case 936: /* stsminlh */
case 873: /* ldsminlh */
value = 873; /* --> ldsminlh. */
break;
case 937: /* stsminl */
case 876: /* ldsminl */
value = 876; /* --> ldsminl. */
break;
case 938: /* stumaxb */
case 878: /* ldumaxb */
value = 878; /* --> ldumaxb. */
break;
case 939: /* stumaxh */
case 879: /* ldumaxh */
value = 879; /* --> ldumaxh. */
break;
case 940: /* stumax */
case 880: /* ldumax */
value = 880; /* --> ldumax. */
break;
case 941: /* stumaxlb */
case 882: /* ldumaxlb */
value = 882; /* --> ldumaxlb. */
break;
case 942: /* stumaxlh */
case 885: /* ldumaxlh */
value = 885; /* --> ldumaxlh. */
break;
case 943: /* stumaxl */
case 888: /* ldumaxl */
value = 888; /* --> ldumaxl. */
break;
case 944: /* stuminb */
case 890: /* lduminb */
value = 890; /* --> lduminb. */
break;
case 945: /* stuminh */
case 891: /* lduminh */
value = 891; /* --> lduminh. */
break;
case 946: /* stumin */
case 892: /* ldumin */
value = 892; /* --> ldumin. */
break;
case 947: /* stuminlb */
case 894: /* lduminlb */
value = 894; /* --> lduminlb. */
break;
case 948: /* stuminlh */
case 897: /* lduminlh */
value = 897; /* --> lduminlh. */
break;
case 949: /* stuminl */
case 900: /* lduminl */
value = 900; /* --> lduminl. */
break;
case 951: /* mov */
case 950: /* movn */
value = 950; /* --> movn. */
break;
case 953: /* mov */
case 952: /* movz */
value = 952; /* --> movz. */
break;
case 964: /* sevl */
case 963: /* sev */
case 962: /* wfi */
case 961: /* wfe */
case 960: /* yield */
case 959: /* nop */
case 958: /* hint */
value = 958; /* --> hint. */
break;
case 973: /* tlbi */
case 972: /* ic */
case 971: /* dc */
case 970: /* at */
case 969: /* sys */
value = 969; /* --> sys. */
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;
}

View File

@ -1038,6 +1038,37 @@ convert_bfi_to_bfm (aarch64_inst *inst)
}
}
/* The instruction written:
BFC <Xd>, #<lsb>, #<width>
is equivalent to:
BFM <Xd>, XZR, #((64-<lsb>)&0x3f), #(<width>-1). */
static void
convert_bfc_to_bfm (aarch64_inst *inst)
{
int64_t lsb, width;
/* Insert XZR. */
copy_operand_info (inst, 3, 2);
copy_operand_info (inst, 2, 1);
copy_operand_info (inst, 2, 0);
inst->operands[1].reg.regno = 0x1f;
/* Convert the immedate operand. */
lsb = inst->operands[2].imm.value;
width = inst->operands[3].imm.value;
if (inst->operands[2].qualifier == AARCH64_OPND_QLF_imm_0_31)
{
inst->operands[2].imm.value = (32 - lsb) & 0x1f;
inst->operands[3].imm.value = width - 1;
}
else
{
inst->operands[2].imm.value = (64 - lsb) & 0x3f;
inst->operands[3].imm.value = width - 1;
}
}
/* The instruction written:
LSL <Xd>, <Xn>, #<shift>
is equivalent to:
@ -1171,6 +1202,9 @@ convert_to_real (aarch64_inst *inst, const aarch64_opcode *real)
case OP_UBFIZ:
convert_bfi_to_bfm (inst);
break;
case OP_BFC:
convert_bfc_to_bfm (inst);
break;
case OP_MOV_V:
convert_mov_to_orr (inst);
break;

File diff suppressed because it is too large Load Diff

View File

@ -1600,6 +1600,45 @@ convert_bfm_to_bfi (aarch64_inst *inst)
return 0;
}
/* The instruction written:
BFC <Xd>, #<lsb>, #<width>
is equivalent to:
BFM <Xd>, XZR, #((64-<lsb>)&0x3f), #(<width>-1). */
static int
convert_bfm_to_bfc (aarch64_inst *inst)
{
int64_t immr, imms, val;
/* Should have been assured by the base opcode value. */
assert (inst->operands[1].reg.regno == 0x1f);
immr = inst->operands[2].imm.value;
imms = inst->operands[3].imm.value;
val = inst->operands[2].qualifier == AARCH64_OPND_QLF_imm_0_31 ? 32 : 64;
if (imms < immr)
{
/* Drop XZR from the second operand. */
copy_operand_info (inst, 1, 2);
copy_operand_info (inst, 2, 3);
inst->operands[3].type = AARCH64_OPND_NIL;
/* Recalculate the immediates. */
inst->operands[1].imm.value = (val - immr) & (val - 1);
inst->operands[2].imm.value = imms + 1;
/* The two opcodes have different qualifiers for the operands; reset to
help the checking. */
reset_operand_qualifier (inst, 1);
reset_operand_qualifier (inst, 2);
reset_operand_qualifier (inst, 3);
return 1;
}
return 0;
}
/* The instruction written:
LSL <Xd>, <Xn>, #<shift>
is equivalent to:
@ -1759,6 +1798,8 @@ convert_to_alias (aarch64_inst *inst, const aarch64_opcode *alias)
case OP_BFI:
case OP_UBFIZ:
return convert_bfm_to_bfi (inst);
case OP_BFC:
return convert_bfm_to_bfc (inst);
case OP_MOV_V:
return convert_orr_to_mov (inst);
case OP_MOV_IMM_WIDE:

View File

@ -121,69 +121,70 @@ const struct aarch64_operand aarch64_operands[] =
static const unsigned op_enum_table [] =
{
0,
668,
669,
670,
673,
671,
674,
675,
676,
677,
671,
672,
678,
672,
673,
679,
701,
680,
702,
703,
706,
704,
707,
708,
709,
710,
704,
705,
711,
705,
706,
712,
755,
713,
756,
757,
758,
759,
12,
518,
519,
950,
952,
954,
762,
953,
520,
951,
953,
955,
763,
954,
952,
261,
507,
518,
517,
516,
760,
513,
510,
761,
514,
511,
503,
502,
509,
512,
514,
510,
513,
515,
770,
534,
537,
540,
516,
771,
535,
538,
634,
541,
536,
539,
635,
162,
163,
164,
165,
426,
603,
604,
318,
320,
340,

View File

@ -1659,7 +1659,7 @@ operand_general_constraint_met_p (const aarch64_opnd_info *opnds, int idx,
break;
case AARCH64_OPND_WIDTH:
assert (idx == 3 && opnds[idx-1].type == AARCH64_OPND_IMM
assert (idx > 1 && opnds[idx-1].type == AARCH64_OPND_IMM
&& opnds[0].type == AARCH64_OPND_Rd);
size = get_upper_bound (qualifier);
if (opnd->imm.value + opnds[idx-1].imm.value > size)

View File

@ -236,6 +236,13 @@
QLF4(X,X,imm_0_63,imm_0_63), \
}
/* e.g. BFC <Wd>, #<immr>, #<imms>. */
#define QL_BF1 \
{ \
QLF3 (W, imm_0_31, imm_1_32), \
QLF3 (X, imm_0_63, imm_1_64), \
}
/* e.g. UBFIZ <Wd>, <Wn>, #<lsb>, #<width>. */
#define QL_BF2 \
{ \
@ -1226,6 +1233,8 @@ static const aarch64_feature_set aarch64_feature_lor =
AARCH64_FEATURE (AARCH64_FEATURE_LOR, 0);
static const aarch64_feature_set aarch64_feature_rdma =
AARCH64_FEATURE (AARCH64_FEATURE_RDMA, 0);
static const aarch64_feature_set aarch64_feature_v8_2 =
AARCH64_FEATURE (AARCH64_FEATURE_V8_2, 0);
#define CORE &aarch64_feature_v8
#define FP &aarch64_feature_fp
@ -1235,6 +1244,7 @@ static const aarch64_feature_set aarch64_feature_rdma =
#define LSE &aarch64_feature_lse
#define LOR &aarch64_feature_lor
#define RDMA &aarch64_feature_rdma
#define ARMV8_2 &aarch64_feature_v8_2
struct aarch64_opcode aarch64_opcode_table[] =
{
@ -1777,6 +1787,8 @@ struct aarch64_opcode aarch64_opcode_table[] =
{"asr", 0x13000000, 0x7f800000, bitfield, OP_ASR_IMM, CORE, OP3 (Rd, Rn, IMM), QL_SHIFT, F_ALIAS | F_P2 | F_CONV},
{"bfm", 0x33000000, 0x7f800000, bitfield, 0, CORE, OP4 (Rd, Rn, IMMR, IMMS), QL_BF, F_HAS_ALIAS | F_SF | F_N},
{"bfi", 0x33000000, 0x7f800000, bitfield, OP_BFI, CORE, OP4 (Rd, Rn, IMM, WIDTH), QL_BF2, F_ALIAS | F_P1 | F_CONV},
{"bfc", 0x330003e0, 0x7f8003e0, bitfield, OP_BFC, ARMV8_2,
OP3 (Rd, IMM, WIDTH), QL_BF1, F_ALIAS | F_P2 | F_CONV},
{"bfxil", 0x33000000, 0x7f800000, bitfield, OP_BFXIL, CORE, OP4 (Rd, Rn, IMM, WIDTH), QL_BF2, F_ALIAS | F_P1 | F_CONV},
{"ubfm", 0x53000000, 0x7f800000, bitfield, 0, CORE, OP4 (Rd, Rn, IMMR, IMMS), QL_BF, F_HAS_ALIAS | F_SF | F_N},
{"ubfiz", 0x53000000, 0x7f800000, bitfield, OP_UBFIZ, CORE, OP4 (Rd, Rn, IMM, WIDTH), QL_BF2, F_ALIAS | F_P1 | F_CONV},