From ccb84d658f5d626c1cbc09024da88faecbb4bbf3 Mon Sep 17 00:00:00 2001 From: Jan Beulich Date: Wed, 10 Apr 2013 13:18:33 +0000 Subject: [PATCH] gas/ 2013-04-10 Jan Beulich * gas/config/tc-arm.c (parse_operands): Re-write po_barrier_or_imm(). (do_barrier): Remove bogus constraint(). (do_t_barrier): Remove. gas/testsuite/ 2013-04-10 Jan Beulich * gas/arm/barrier-bad.d: Change title. * gas/arm/barrier-bad.s: Add immediate form of ISB and DSB as well as one symbolic form of DSB. * gas/arm/barrier-bad.l: Update accordingly. * gas/arm/barrier-bad-thumb.d: Adjust title. Use barrier-bad.s as source. Pass -mthumb to gas. * gas/arm/barrier-bad-thumb.l: Remove. * gas/arm/barrier-bad-thumb.s: Remove. * gas/arm/barrier-thumb.d: Adjust title. Use barrier.s as source. Pass -mthumb to gas. * gas/arm/barrier-thumb.s: Remove. --- gas/ChangeLog | 7 +++ gas/config/tc-arm.c | 53 ++++------------ gas/testsuite/ChangeLog | 14 +++++ gas/testsuite/gas/arm/barrier-bad-thumb.d | 6 +- gas/testsuite/gas/arm/barrier-bad-thumb.l | 8 --- gas/testsuite/gas/arm/barrier-bad-thumb.s | 11 ---- gas/testsuite/gas/arm/barrier-bad.d | 2 +- gas/testsuite/gas/arm/barrier-bad.l | 3 + gas/testsuite/gas/arm/barrier-bad.s | 4 +- gas/testsuite/gas/arm/barrier-thumb.d | 5 +- gas/testsuite/gas/arm/barrier-thumb.s | 74 ----------------------- 11 files changed, 48 insertions(+), 139 deletions(-) delete mode 100644 gas/testsuite/gas/arm/barrier-bad-thumb.l delete mode 100644 gas/testsuite/gas/arm/barrier-bad-thumb.s delete mode 100644 gas/testsuite/gas/arm/barrier-thumb.s diff --git a/gas/ChangeLog b/gas/ChangeLog index 37954ead5fc..3818536c027 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,10 @@ +2013-04-10 Jan Beulich + + * gas/config/tc-arm.c (parse_operands): Re-write + po_barrier_or_imm(). + (do_barrier): Remove bogus constraint(). + (do_t_barrier): Remove. + 2013-04-09 Joerg Wunsch * gas/config/tc-avr.c (mcu_types): Add ATmega64RFR2, diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c index 78fa733bb00..10399d6c976 100644 --- a/gas/config/tc-arm.c +++ b/gas/config/tc-arm.c @@ -6338,22 +6338,16 @@ parse_operands (char *str, const unsigned int *pattern, bfd_boolean thumb) do \ { \ val = parse_barrier (&str); \ - if (val == FAIL) \ + if (val == FAIL && ! ISALPHA (*str)) \ + goto immediate; \ + if (val == FAIL \ + /* ISB can only take SY as an option. */ \ + || ((inst.instruction & 0xf0) == 0x60 \ + && val != 0xf)) \ { \ - if (ISALPHA (*str)) \ - goto failure; \ - else \ - goto immediate; \ - } \ - else \ - { \ - if ((inst.instruction & 0xf0) == 0x60 \ - && val != 0xf) \ - { \ - /* ISB can only take SY as an option. */ \ - inst.error = _("invalid barrier type"); \ - goto failure; \ - } \ + inst.error = _("invalid barrier type"); \ + backtrack_pos = 0; \ + goto failure; \ } \ } \ while (0) @@ -7541,13 +7535,7 @@ static void do_barrier (void) { if (inst.operands[0].present) - { - constraint ((inst.instruction & 0xf0) != 0x40 - && inst.operands[0].imm > 0xf - && inst.operands[0].imm < 0x0, - _("bad barrier type")); - inst.instruction |= inst.operands[0].imm; - } + inst.instruction |= inst.operands[0].imm; else inst.instruction |= 0xf; } @@ -10050,21 +10038,6 @@ do_t_arit3c (void) } } -static void -do_t_barrier (void) -{ - if (inst.operands[0].present) - { - constraint ((inst.instruction & 0xf0) != 0x40 - && inst.operands[0].imm > 0xf - && inst.operands[0].imm < 0x0, - _("bad barrier type")); - inst.instruction |= inst.operands[0].imm; - } - else - inst.instruction |= 0xf; -} - static void do_t_bfc (void) { @@ -18510,9 +18483,9 @@ static const struct asm_opcode insns[] = #undef THUMB_VARIANT #define THUMB_VARIANT & arm_ext_barrier - TUF("dmb", 57ff050, f3bf8f50, 1, (oBARRIER_I15), barrier, t_barrier), - TUF("dsb", 57ff040, f3bf8f40, 1, (oBARRIER_I15), barrier, t_barrier), - TUF("isb", 57ff060, f3bf8f60, 1, (oBARRIER_I15), barrier, t_barrier), + TUF("dmb", 57ff050, f3bf8f50, 1, (oBARRIER_I15), barrier, barrier), + TUF("dsb", 57ff040, f3bf8f40, 1, (oBARRIER_I15), barrier, barrier), + TUF("isb", 57ff060, f3bf8f60, 1, (oBARRIER_I15), barrier, barrier), /* ARM V7 instructions. */ #undef ARM_VARIANT diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog index ba42c258440..28aa94778c4 100644 --- a/gas/testsuite/ChangeLog +++ b/gas/testsuite/ChangeLog @@ -1,3 +1,17 @@ +2013-04-10 Jan Beulich + + * gas/arm/barrier-bad.d: Change title. + * gas/arm/barrier-bad.s: Add immediate form of ISB and DSB as + well as one symbolic form of DSB. + * gas/arm/barrier-bad.l: Update accordingly. + * gas/arm/barrier-bad-thumb.d: Adjust title. Use barrier-bad.s as + source. Pass -mthumb to gas. + * gas/arm/barrier-bad-thumb.l: Remove. + * gas/arm/barrier-bad-thumb.s: Remove. + * gas/arm/barrier-thumb.d: Adjust title. Use barrier.s as source. + Pass -mthumb to gas. + * gas/arm/barrier-thumb.s: Remove. + 2013-04-09 Jan Beulich * gas/arm/vfp1xD.s: Add VMRS/VMSR tests with FPINST, FPINST2, diff --git a/gas/testsuite/gas/arm/barrier-bad-thumb.d b/gas/testsuite/gas/arm/barrier-bad-thumb.d index 3df3f76c206..384b7ef89b8 100644 --- a/gas/testsuite/gas/arm/barrier-bad-thumb.d +++ b/gas/testsuite/gas/arm/barrier-bad-thumb.d @@ -1,3 +1,5 @@ -#name: All options expect SY are reserved for ISB +#name: Bad barrier options (Thumb) #skip: *-*-*coff *-*-pe *-*-wince *-*-*aout* *-*-netbsd -#error-output: barrier-bad-thumb.l +#source: barrier-bad.s +#as: -mthumb +#error-output: barrier-bad.l diff --git a/gas/testsuite/gas/arm/barrier-bad-thumb.l b/gas/testsuite/gas/arm/barrier-bad-thumb.l deleted file mode 100644 index a03a9e740be..00000000000 --- a/gas/testsuite/gas/arm/barrier-bad-thumb.l +++ /dev/null @@ -1,8 +0,0 @@ -[^:]*: Assembler messages: -[^:]*:4: Error: invalid barrier type -- `isb st' -[^:]*:5: Error: invalid barrier type -- `isb ish' -[^:]*:6: Error: invalid barrier type -- `isb ishst' -[^:]*:7: Error: invalid barrier type -- `isb nsh' -[^:]*:8: Error: invalid barrier type -- `isb nshst' -[^:]*:9: Error: invalid barrier type -- `isb osh' -[^:]*:10: Error: invalid barrier type -- `isb oshst' diff --git a/gas/testsuite/gas/arm/barrier-bad-thumb.s b/gas/testsuite/gas/arm/barrier-bad-thumb.s deleted file mode 100644 index 67fc40a68d8..00000000000 --- a/gas/testsuite/gas/arm/barrier-bad-thumb.s +++ /dev/null @@ -1,11 +0,0 @@ -.syntax unified -.thumb -.arch armv7a -isb st -isb ish -isb ishst -isb nsh -isb nshst -isb osh -isb oshst - diff --git a/gas/testsuite/gas/arm/barrier-bad.d b/gas/testsuite/gas/arm/barrier-bad.d index 1e351bcd84f..6e19717f3bd 100644 --- a/gas/testsuite/gas/arm/barrier-bad.d +++ b/gas/testsuite/gas/arm/barrier-bad.d @@ -1,3 +1,3 @@ -#name: All options expect SY are reserved for ISB +#name: Bad barrier options (ARM) #skip: *-*-*coff *-*-pe *-*-wince *-*-*aout* *-*-netbsd #error-output: barrier-bad.l diff --git a/gas/testsuite/gas/arm/barrier-bad.l b/gas/testsuite/gas/arm/barrier-bad.l index 045ef478153..fc91fd2213e 100644 --- a/gas/testsuite/gas/arm/barrier-bad.l +++ b/gas/testsuite/gas/arm/barrier-bad.l @@ -6,3 +6,6 @@ [^:]*:7: Error: invalid barrier type -- `isb nshst' [^:]*:8: Error: invalid barrier type -- `isb osh' [^:]*:9: Error: invalid barrier type -- `isb oshst' +[^:]*:10: Error: immediate value out of range -- `isb #23' +[^:]*:11: Error: invalid barrier type -- `dsb xyz' +[^:]*:12: Error: immediate value out of range -- `dsb #34' diff --git a/gas/testsuite/gas/arm/barrier-bad.s b/gas/testsuite/gas/arm/barrier-bad.s index 3dfae788f7f..fb7dfb8b140 100644 --- a/gas/testsuite/gas/arm/barrier-bad.s +++ b/gas/testsuite/gas/arm/barrier-bad.s @@ -7,4 +7,6 @@ isb nsh isb nshst isb osh isb oshst - +isb #23 +dsb xyz +dsb #34 diff --git a/gas/testsuite/gas/arm/barrier-thumb.d b/gas/testsuite/gas/arm/barrier-thumb.d index 075a6632d33..592994699ca 100644 --- a/gas/testsuite/gas/arm/barrier-thumb.d +++ b/gas/testsuite/gas/arm/barrier-thumb.d @@ -1,6 +1,7 @@ #objdump: -dr --prefix-addresses --show-raw-insn -#name: Barrier Instruction Operands -#as: -mcpu=cortex-a8 +#name: Barrier Instruction Operands (Thumb) +#source: barrier.s +#as: -mcpu=cortex-a8 -mthumb # This test is only valid on ELF based ports. #not-target: *-*-*coff *-*-pe *-*-wince *-*-*aout* *-*-netbsd diff --git a/gas/testsuite/gas/arm/barrier-thumb.s b/gas/testsuite/gas/arm/barrier-thumb.s deleted file mode 100644 index cc420766703..00000000000 --- a/gas/testsuite/gas/arm/barrier-thumb.s +++ /dev/null @@ -1,74 +0,0 @@ -@ Test case to validate barrier instruction operands for T2 -.thumb -.section .text -.syntax unified - @Tests to verify dsb, dmb and isb operand acceptance - dmb sy - dmb st - dmb ish - dmb sh - dmb ishst - dmb shst - dmb nsh - dmb un - dmb nshst - dmb unst - dmb osh - dmb oshst - dsb sy - dsb st - dsb ish - dsb sh - dsb ishst - dsb shst - dsb nsh - dsb un - dsb nshst - dsb unst - dsb osh - isb sy - isb - - @Sanity checks for operands in upper case - dmb SY - dmb ST - dmb ISH - dmb SH - dmb ISHST - dmb SHST - dmb NSH - dmb UN - dmb NSHST - dmb UNST - dmb OSH - dmb OSHST - dsb SY - dsb ST - dsb ISH - dsb SH - dsb ISHST - dsb SHST - dsb NSH - dsb UN - dsb NSHST - dsb UNST - dsb OSH - isb SY - - @Tests to verify immediate operands - dsb 0 - dsb #15 - - dmb 0 - dmb #15 - - isb 0 - isb #14 - isb #11 - isb #10 - isb #7 - isb #6 - isb #3 - isb #2 - - isb #15 -- 2.30.2