gas/
authorJan Beulich <jbeulich@novell.com>
Wed, 10 Apr 2013 13:18:33 +0000 (13:18 +0000)
committerJan Beulich <jbeulich@novell.com>
Wed, 10 Apr 2013 13:18:33 +0000 (13:18 +0000)
2013-04-10  Jan Beulich <jbeulich@suse.com>

* 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 <jbeulich@suse.com>

* 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
gas/config/tc-arm.c
gas/testsuite/ChangeLog
gas/testsuite/gas/arm/barrier-bad-thumb.d
gas/testsuite/gas/arm/barrier-bad-thumb.l [deleted file]
gas/testsuite/gas/arm/barrier-bad-thumb.s [deleted file]
gas/testsuite/gas/arm/barrier-bad.d
gas/testsuite/gas/arm/barrier-bad.l
gas/testsuite/gas/arm/barrier-bad.s
gas/testsuite/gas/arm/barrier-thumb.d
gas/testsuite/gas/arm/barrier-thumb.s [deleted file]

index 37954ead5fc787fc2203be5b9b29836c65bd3bc9..3818536c027b1597cbd933aa824bb9555f1fda01 100644 (file)
@@ -1,3 +1,10 @@
+2013-04-10  Jan Beulich <jbeulich@suse.com>
+
+       * 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 <joerg.wunsch@atmel.com>
 
        * gas/config/tc-avr.c (mcu_types): Add ATmega64RFR2,
index 78fa733bb00ae1e6fdedb0c0e0c1a8cd83026e4f..10399d6c976a749060c90cbd03038413855520ea 100644 (file)
@@ -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
index ba42c25844022af9d7b26fc2ddd39019109f3ba6..28aa94778c43db689e839770e4d81d7d4fc84efb 100644 (file)
@@ -1,3 +1,17 @@
+2013-04-10  Jan Beulich <jbeulich@suse.com>
+
+       * 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 <jbeulich@suse.com>
 
        * gas/arm/vfp1xD.s: Add VMRS/VMSR tests with FPINST, FPINST2,
index 3df3f76c206741f8f9c01fc3dbdd8f0e7dd667da..384b7ef89b877caaa8ebbd7a451ac8e061fc82a5 100644 (file)
@@ -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 (file)
index a03a9e7..0000000
+++ /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 (file)
index 67fc40a..0000000
+++ /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
-
index 1e351bcd84f3978dfa6590fea23b96fbeea0c33b..6e19717f3bd36663b2c5b03bcf01094f0317fb65 100644 (file)
@@ -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
index 045ef478153c2a93b46311fdb9cd0af7b1b8468a..fc91fd2213e330318463a9b2bd91cdcff378f7c3 100644 (file)
@@ -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'
index 3dfae788f7fda69314663546f3fa2ffdcaa2475f..fb7dfb8b140d66c8bcdd7f6c0f652c78b288a996 100644 (file)
@@ -7,4 +7,6 @@ isb nsh
 isb nshst
 isb osh
 isb oshst
-
+isb #23
+dsb xyz
+dsb #34
index 075a6632d336f27edc6d572e2e05c95faf112624..592994699ca7ebdebe4977d76f36c893a826a09a 100644 (file)
@@ -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 (file)
index cc42076..0000000
+++ /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