aarch64: Fix DSB instruction 'missing immediate expression' errors

This patch fixes errors with DSB instruction after introduction of DSB nXS
variant. That change would cause GAS to reject valid DSB immediate string
operands.

gas/ChangeLog:

2020-10-28  Przemyslaw Wirkus  <przemyslaw.wirkus@arm.com>

	* config/tc-aarch64.c (parse_operands): Check for C0-C15 value of DSB
	immediate string operand.
	* testsuite/gas/aarch64/system-4.d: Update test.
	* testsuite/gas/aarch64/system-4.s: Update test.
This commit is contained in:
Przemyslaw Wirkus 2020-10-29 16:30:46 +00:00
parent 76868f3606
commit 59d5613e42
3 changed files with 34 additions and 1 deletions

View File

@ -6714,7 +6714,11 @@ parse_operands (char *str, const aarch64_opcode *opcode)
{
/* Regular barriers accept options CRm (C0-C15).
DSB nXS barrier variant accepts values > 15. */
po_imm_or_fail (0, 15);
if (val < 0 || val > 15)
{
set_syntax_error (_("the specified option is not accepted in DSB"));
goto failure;
}
}
/* This is an extension to accept a 0..15 immediate. */
if (val == PARSE_FAIL)

View File

@ -193,6 +193,20 @@ Disassembly of section \.text:
.*: d5033fdf isb
.*: d503309f ssbb
.*: d503349f pssbb
.*: d503319f dsb oshld
.*: d503329f dsb oshst
.*: d503339f dsb osh
.*: d503359f dsb nshld
.*: d503369f dsb nshst
.*: d503379f dsb nsh
.*: d503389f dsb #0x08
.*: d503399f dsb ishld
.*: d5033a9f dsb ishst
.*: d5033b9f dsb ish
.*: d5033c9f dsb #0x0c
.*: d5033d9f dsb ld
.*: d5033e9f dsb st
.*: d5033f9f dsb sy
.*: d8000000 prfm pldl1keep, 0 <LABEL1>
.*: R_AARCH64_(P32_|)LD_PREL_LO19 LABEL1
.*: f8af6be0 prfm pldl1keep, \[sp, x15\]

View File

@ -48,6 +48,21 @@
ssbb
pssbb
dsb oshld
dsb oshst
dsb osh
dsb nshld
dsb nshst
dsb nsh
dsb #0x08
dsb ishld
dsb ishst
dsb ish
dsb #0x0c
dsb ld
dsb st
dsb sy
//
// PREFETCHS
//